Sync SDK DTOs with Unit API docs (automated, 2026-05-13)#74
Closed
cursor[bot] wants to merge 5 commits into
Closed
Sync SDK DTOs with Unit API docs (automated, 2026-05-13)#74cursor[bot] wants to merge 5 commits into
cursor[bot] wants to merge 5 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
merchant_idOptional[str]merchant.idsub-field — unique network merchant identifierecommerceOptional[bool]card_presentOptional[bool]payment_methodOptional[str]Manual,Swipe,Contactless,ChipAndPin,Stored,Otherdigital_walletOptional[str]Google,Apple,Othercard_verification_dataOptional[CardVerificationData]unit/models/__init__.pycard_networkOptional[str]Visa,Interlink,Accel,Allpoint,Otherhealthcare_amountsOptional[HealthcareAmounts]unit/models/__init__.py(no codec entry); IIAS data for FSA/HRA cardscash_withdrawal_amountOptional[int]currency_conversionOptional[CurrencyConversion]is_internationalOptional[bool]Manual review needed
2.
DepositAccountDTO(unit/models/account.py)Source: https://docs.unit.co/resources#depositaccount
Added optional fields
updated_atOptional[datetime]freeze_reasonOptional[str]Fraud,ByBank, or free-textfraud_reasonOptional[FraudReason]daca_statusOptional[str]EnteredorActivatedManual review needed
interestTerms— docs list this without anOptionalsuffix, so per the no-silent-changes rule we did not add it. The docs do clarify "Only available ifextraFields[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
updated_atOptional[datetime]nationalityOptional[str]industryOptional[Industry]id_theft_scoreOptional[int]Manual review needed
passport— listed in docs withoutOptionalbut described as "Eitherssnorpassportwill be populated", i.e. semantically optional. Currently absent from the DTO; not added because the docs row has noOptionalsuffix.archived— listed as a non-optionalbooleanin 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
updated_atOptional[datetime]industryOptional[Industry]stock_symbolOptional[str]Manual review needed
archived— listed as a non-optionalbooleanin 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
gross_interchangeOptional[str]rich_merchant_dataOptional[RichMerchantData]currency_conversionOptional[CurrencyConversion]Manual review needed
Backward compatibility
All additions are optional kwargs with
Nonedefaults; 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. ThewireReceivedPaymentJSON:API type isn't inunit/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 optionalexpectedCompletionDate,counterpartyVerificationMethod; plussameDayandsecCodelisted as required in docs but absent from the DTO (manual-review candidates).AchReceivedPaymentDTO— missing optionaloriginatorEntityId,receivingEntityName; plus requiredisAdvanceableanddirectionabsent (manual review).BeneficialOwner(sub-object) — missing optionaloccupation,annualIncome,sourceOfIncome.BusinessCustomerDTO— missing optionaleligibleProducts.AtmTransactionDTO— missing optionalgrossInterchange,currencyConversion.AccountEndOfDayDTO— missing optionaloverdraftLimit.CounterpartyDTO(ACH Counterparty) — missingtags(docs list as requiredobject; treat as manual review).CheckDepositDTO— missing optionalclearingDaysOverride.DisputeDTO— missing optionalupdatedAt.RewardDTO— missing optionalrejectReason(plus requiredcreatedAtfor manual review).IndividualDebitCardDTO,IndividualVirtualDebitCardDTO,BusinessDebitCardDTO,BusinessVirtualDebitCardDTO— each missing optionalupdatedAt; some also missing requiredbin(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.