Skip to content

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

Closed
cursor[bot] wants to merge 5 commits into
masterfrom
cursor/unit-sdk-docs-sync-a677
Closed

Sync SDK DTOs with Unit API docs (automated, 2026-05-13)#73
cursor[bot] wants to merge 5 commits into
masterfrom
cursor/unit-sdk-docs-sync-a677

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. IndividualApplicationDTO (unit/models/application.py)

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

Added optional fields

Field Type Docs note
updatedAt RFC3339 datetime The date the resource was updated.
nationality ISO31661-Alpha2 string Always when Passport is populated and optional when SSN is populated.
industry Industry enum Indicates if the individual is a sole proprietor who has a business industry.
idTheftScore number Score (0-1000) for ID theft verification, >900 is auto rejected as default.

Manual review needed

  • passport is described in the docs (no Optional marker) as "Either ssn or passport will be populated", but the DTO does not currently hydrate attributes["passport"]. Effectively a missing required-or-conditional field — breaking-change candidate, left untouched here.
  • archived is described in the docs without an Optional marker but is currently absent from self.attributes. Breaking-change candidate, left untouched here.
  • ApplicationStatus literal in code is Literal["Approved", "Denied", "Pending", "PendingReview"] — narrower than the documented enum which also includes AwaitingDocuments. Existing typing limitation, not changed.
  • V2-style attributes already on the DTO (accountPurpose, sourceOfFunds, transactionVolume, businessIndustry, isIncorporated, website, countriesOfOperation) are not in the v1 docs page; verify they still match Unit's payloads when a v2-aware docs surface lands.

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

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

Added optional fields

Field Type Docs note
updatedAt RFC3339 datetime The date the resource was updated.
industry Industry enum Business industry, if specified.
stockSymbol string The stock symbol (ticker) of the business.

Manual review needed

  • archived is documented without an Optional marker but is absent from self.attributes. Breaking-change candidate, left untouched here.
  • ssn is on the DTO (attributes["ssn"]) but is not listed on the BusinessApplication docs table — possible removal candidate, left untouched here.
  • ApplicationStatus literal narrower than docs enum (same caveat as above).
  • entityType literal in code includes "Corporation"; docs list LLC, Partnership, PubliclyTradedCorporation, PrivatelyHeldCorporation, NotForProfitOrganization. Possible enum drift, not changed.

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

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

Added optional fields

Field Type Docs note
updatedAt RFC3339 datetime The date the resource was updated.
freezeReason string Reason the account was frozen, either Fraud, ByBank, or free-text.
fraudReason FraudReason enum Expanded fraud reason when Fraud is the close reason.
dacaStatus DacaStatus enum (Entered | Activated) DACA program state.

A new DacaStatus literal alias was added next to the existing AccountStatus / CloseReason aliases.

Manual review needed

  • interestTerms is documented without an Optional marker (only available when extraFields[account] is requested) but is absent from self.attributes. Conditional/required-ish field — left untouched here.
  • CloseReason literal in code is Literal["ByCustomer", "Fraud"] but docs list ByCustomer, Fraud, and ByBank. Possible enum drift, not changed.

4. AchPaymentDTO (unit/models/payment.py)

Source: https://docs.unit.co/resources#ach-payment

Added optional fields

Field Type Docs note
settlementDate RFC3339 datetime Decoded value was assigned to self.settlement_date but never copied into self.attributes; now hydrated into both.
expectedCompletionDate RFC3339 datetime For ACH credit with statuses Pending/Sent.
counterpartyVerificationMethod string Verification method of the counterparty (e.g. Plaid).

Manual review needed

  • sameDay (boolean) and secCode (string) are listed on the docs without an Optional marker but are absent from self.attributes. Breaking-change candidates, left untouched here.

5. AchReceivedPaymentDTO (unit/models/payment.py)

Source: https://docs.unit.co/resources#ach-received-payment

Added optional fields

Field Type Docs note
originatorEntityId string Unique identifier by which the originator is formally recognized within the ACH network.
receivingEntityName string Name of the recipient as declared by the originator of the payment.

Manual review needed

  • direction (Debit/Credit) and isAdvanceable (boolean) are listed in the docs without an Optional marker but are absent from self.attributes. Breaking-change candidates, left untouched here.
  • AchReceivedPaymentStatus literal in code is Literal["Pending", "Advanced", "Completed", "Returned"] but docs include PendingReview and MarkedForReturn. Enum drift, not changed.

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 all imports (117 mappings).

Queued for next run

Drift surfaced during scoping that did not fit in this 5-resource run:

  • PurchaseTransactionDTO, AtmTransactionDTO, CardTransactionDTO — likely missing networkTransactionId, internationalServiceFee per OpenAPI; needs docs cross-check.
  • WirePaymentDTOimadOmad object, settlementDate.
  • BookPaymentDTOtransactionSummaryOverride.
  • OriginatedAchTransactionDTOsecCode, traceNumber.
  • ReceivedAchTransactionDTOcounterpartyName.
  • ReturnedAchTransactionDTOachReason.
  • AccountEndOfDayDTOoverdraftLimit (docs-confirmed Optional).
  • WireReceivedPaymentDTO, DeclinedIncomingPaymentDTO, AccountHoldDTO, WireDrawdownDTO, etc. — no DTO at all today; would need brand-new classes plus codec entries (out of scope for an additive sync run).
  • CheckDepositDTO, DisputeDTO, CardReversalTransactionDTO, CheckStopPaymentDTO, repayment DTOs — class exists but is not wired into codecs.py mappings. Worth a follow-up.

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 21:54
Add docs-listed optional response fields that the DTO did not previously
hydrate into self.attributes:

- updatedAt (RFC3339 datetime)
- nationality (ISO31661-Alpha2 string)
- industry (Industry enum)
- idTheftScore (integer 0-1000)

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

Co-authored-by: Avery Kushner <avesk@users.noreply.github.com>
Add docs-listed optional response fields that the DTO did not previously
hydrate into self.attributes:

- updatedAt (RFC3339 datetime)
- industry (Industry enum)
- stockSymbol (string)

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

Co-authored-by: Avery Kushner <avesk@users.noreply.github.com>
Add docs-listed optional response fields that the DTO did not previously
hydrate into self.attributes:

- updatedAt (RFC3339 datetime)
- freezeReason (string)
- fraudReason (FraudReason enum)
- dacaStatus (Entered | Activated)

Also introduces a DacaStatus literal alias for the new enum.

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

Co-authored-by: Avery Kushner <avesk@users.noreply.github.com>
Add docs-listed optional response fields that the DTO did not previously
hydrate into self.attributes:

- settlementDate (RFC3339 datetime) -- value was decoded into self.settlement_date
  but never copied into the attributes bag that consumers read
- expectedCompletionDate (RFC3339 datetime)
- counterpartyVerificationMethod (string, e.g. 'Plaid')

Source: https://docs.unit.co/resources#ach-payment

Co-authored-by: Avery Kushner <avesk@users.noreply.github.com>
Add docs-listed optional response fields that the DTO did not previously
hydrate into self.attributes:

- originatorEntityId (string)
- receivingEntityName (string)

Source: https://docs.unit.co/resources#ach-received-payment

Co-authored-by: Avery Kushner <avesk@users.noreply.github.com>
@avesk avesk closed this May 13, 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