Skip to content

Sync SDK DTOs with Unit API docs (automated, 2026-05-13)#74

Closed
cursor[bot] wants to merge 5 commits into
masterfrom
cursor/sdk-dtos-documentation-sync-10d0
Closed

Sync SDK DTOs with Unit API docs (automated, 2026-05-13)#74
cursor[bot] wants to merge 5 commits into
masterfrom
cursor/sdk-dtos-documentation-sync-10d0

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented May 13, 2026

Summary

Automated sync against https://docs.unit.co/resources covering 5 resource DTOs. Each resource is a separate commit so reviewers can split or cherry-pick.

Resources synced

1. PurchaseAuthorizationRequestDTO (unit/models/authorization_request.py)

Source: https://docs.unit.co/resources#purchase-authorization-request

Added optional fields

Field Type Docs note
merchant_id Optional[str] merchant.id sub-field — unique network merchant identifier
ecommerce Optional[bool] Whether the transaction was created over an electronic network
card_present Optional[bool] Whether the card was present at transaction time
payment_method Optional[str] One of Manual, Swipe, Contactless, ChipAndPin, Stored, Other
digital_wallet Optional[str] One of Google, Apple, Other
card_verification_data Optional[CardVerificationData] Re-uses existing sub-type from unit/models/__init__.py
card_network Optional[str] One of Visa, Interlink, Accel, Allpoint, Other
healthcare_amounts Optional[HealthcareAmounts] New sub-object added to unit/models/__init__.py (no codec entry); IIAS data for FSA/HRA cards
cash_withdrawal_amount Optional[int] Cash withdrawal amount
currency_conversion Optional[CurrencyConversion] When original currency for transaction is not USD
is_international Optional[bool] Whether the transaction is international

Manual review needed

  • None.

2. DepositAccountDTO (unit/models/account.py)

Source: https://docs.unit.co/resources#depositaccount

Added optional fields

Field Type Docs note
updated_at Optional[datetime] The date the resource was updated
freeze_reason Optional[str] Fraud, ByBank, or free-text
fraud_reason Optional[FraudReason] Expanded fraud reason when frozen for fraud (re-uses existing literal)
daca_status Optional[str] Entered or Activated

Manual review needed

  • interestTerms — docs list this without an Optional suffix, so per the no-silent-changes rule we did not add it. The docs do clarify "Only available if extraFields[account] is used", which means it is effectively optional in practice. Consider promoting it to a typed sub-object if Truss needs interest data.

3. IndividualApplicationDTO (unit/models/application.py)

Source: https://docs.unit.co/resources#individualapplication

Added optional fields

Field Type Docs note
updated_at Optional[datetime] The date the resource was updated
nationality Optional[str] ISO 3166-1 alpha-2; required when passport is populated, optional when SSN is populated
industry Optional[Industry] Sole-proprietor industry
id_theft_score Optional[int] Score 0-1000; >900 auto-rejected by default

Manual review needed

  • passport — listed in docs without Optional but described as "Either ssn or passport will be populated", i.e. semantically optional. Currently absent from the DTO; not added because the docs row has no Optional suffix.
  • archived — listed as a non-optional boolean in docs and currently absent from the DTO. Treating as a possible breaking-change candidate if Unit ever returns it as a required field.

4. BusinessApplicationDTO (unit/models/application.py)

Source: https://docs.unit.co/resources#businessapplication

Added optional fields

Field Type Docs note
updated_at Optional[datetime] The date the resource was updated
industry Optional[Industry] Business industry
stock_symbol Optional[str] Stock ticker

Manual review needed

  • archived — listed as a non-optional boolean in docs and currently absent from the DTO. Treating as a possible breaking-change candidate.

5. CardTransactionDTO (unit/models/transaction.py)

Source: https://docs.unit.co/resources#transaction-card

Added optional fields

Field Type Docs note
gross_interchange Optional[str] Gross interchange share for the transaction
rich_merchant_data Optional[RichMerchantData] Re-uses existing sub-type
currency_conversion Optional[CurrencyConversion] When original currency for transaction is not USD

Manual review needed

  • None.

Backward compatibility

All additions are optional kwargs with None defaults; existing callers are unaffected. python -c "from unit.models.codecs import DtoDecoder, mappings; print(len(mappings))" still resolves and reports 117 mappings.

Queued for next run

The following resources also have docs drift but didn't fit in this run's 5-resource cap. Prioritize the ones with the highest field counts in the next sync:

  • WireReceivedPaymentDTO — entire DTO is missing from the SDK. The wireReceivedPayment JSON:API type isn't in unit/models/codecs.py. Needs a new DTO file plus a codec entry; out of scope for an additive-only sync.
  • AccountHoldDTO — entire resource (accountHold) is absent from the SDK. Same shape concern as above.
  • Account limit overrides (achLimitOverride, wireLimitOverride, checkDepositLimitOverride, checkPaymentLimitOverride, bookTransferLimitOverride) — no DTOs exist in the SDK.
  • AchPaymentDTO — missing optional expectedCompletionDate, counterpartyVerificationMethod; plus sameDay and secCode listed as required in docs but absent from the DTO (manual-review candidates).
  • AchReceivedPaymentDTO — missing optional originatorEntityId, receivingEntityName; plus required isAdvanceable and direction absent (manual review).
  • BeneficialOwner (sub-object) — missing optional occupation, annualIncome, sourceOfIncome.
  • BusinessCustomerDTO — missing optional eligibleProducts.
  • AtmTransactionDTO — missing optional grossInterchange, currencyConversion.
  • AccountEndOfDayDTO — missing optional overdraftLimit.
  • CounterpartyDTO (ACH Counterparty) — missing tags (docs list as required object; treat as manual review).
  • CheckDepositDTO — missing optional clearingDaysOverride.
  • DisputeDTO — missing optional updatedAt.
  • RewardDTO — missing optional rejectReason (plus required createdAt for manual review).
  • IndividualDebitCardDTO, IndividualVirtualDebitCardDTO, BusinessDebitCardDTO, BusinessVirtualDebitCardDTO — each missing optional updatedAt; some also missing required bin (manual review for the latter).

Opened by the docs-sync automation. Mirror automation will open a paired API PR against Truss-pmts/api once this PR is opened.

Open in Web View Automation 

cursoragent and others added 5 commits May 13, 2026 22:20
Added the following optional fields per https://docs.unit.co/resources#purchase-authorization-request:

- merchant_id (Optional[str]): merchant.id sub-field
- ecommerce (Optional[bool])
- card_present (Optional[bool])
- payment_method (Optional[str])
- digital_wallet (Optional[str])
- card_verification_data (Optional[CardVerificationData])
- card_network (Optional[str])
- healthcare_amounts (Optional[HealthcareAmounts])
- cash_withdrawal_amount (Optional[int])
- currency_conversion (Optional[CurrencyConversion])
- is_international (Optional[bool])

Introduced HealthcareAmounts sub-object in unit/models/__init__.py mirroring the OpenAPI schema (transitAmount, prescriptionRXAmount, visionOpticalAmount, clinicOtherQualifiedMedicalAmount, dentalAmount, totalHealthcareAmount). All new kwargs default to None so existing callers are unaffected.

Co-authored-by: Avery Kushner <avesk@users.noreply.github.com>
Added the following optional fields per https://docs.unit.co/resources#depositaccount:

- updated_at (Optional[datetime])
- freeze_reason (Optional[str])
- fraud_reason (Optional[FraudReason])
- daca_status (Optional[str])

All new kwargs default to None so existing callers are unaffected.

Co-authored-by: Avery Kushner <avesk@users.noreply.github.com>
Added the following optional fields per https://docs.unit.co/resources#individualapplication:

- updated_at (Optional[datetime])
- nationality (Optional[str]): ISO 3166-1 alpha-2
- industry (Optional[Industry]): for sole proprietors
- id_theft_score (Optional[int])

All new kwargs default to None so existing callers are unaffected.

Co-authored-by: Avery Kushner <avesk@users.noreply.github.com>
Added the following optional fields per https://docs.unit.co/resources#businessapplication:

- updated_at (Optional[datetime])
- industry (Optional[Industry])
- stock_symbol (Optional[str]): ticker symbol

All new kwargs default to None so existing callers are unaffected.

Co-authored-by: Avery Kushner <avesk@users.noreply.github.com>
Added the following optional fields per https://docs.unit.co/resources#transaction-card:

- gross_interchange (Optional[str])
- rich_merchant_data (Optional[RichMerchantData])
- currency_conversion (Optional[CurrencyConversion])

All new kwargs default to None so existing callers are unaffected.

Co-authored-by: Avery Kushner <avesk@users.noreply.github.com>
@cursor cursor Bot marked this pull request as ready for review May 13, 2026 22:24
@avesk avesk closed this May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants