Skip to content

Sync SDK DTOs with Unit API docs (automated, 2026-05-14)#76

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

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

Conversation

@cursor

@cursor cursor Bot commented May 14, 2026

Copy link
Copy Markdown

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. All additions are optional kwargs with None defaults.

Resources synced

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

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

Added optional fields

Field Type Docs note
updatedAt RFC3339 Date string The date the resource was updated.
passport string Individual passport number. Either ssn or passport will be populated.
nationality ISO 3166-1 alpha-2 Always set when passport is populated, optional with ssn.
industry Industry Sole-prop business industry, when specified.
idTheftScore number (0-1000) Score for ID theft verification (>900 auto-rejected by default).

Manual review needed

  • Docs list archived (boolean, non-Optional) which is missing from the DTO. Possible new required field — flag as breaking-change candidate before adding.

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

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

Added optional fields

Field Type Docs note
updatedAt RFC3339 Date string The date the resource was updated.
freezeReason string Reason the account was frozen (Fraud, ByBank, or free-text).
fraudReason FraudReason Expanded fraud reason when Fraud is the reason (e.g. CardActivity, IdentityTheft, ...).
dacaStatus Entered | Activated DACA status. New DacaStatus literal alias added.

Manual review needed

  • Docs list interestTerms (Interest Terms object) as non-Optional but conditionally returned (only when extraFields[account] is requested). Skipped to avoid creating a new nested type without spec; flag for follow-up if SDK callers need typed access.

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

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

Added optional fields

Field Type Docs note
updatedAt RFC3339 Date string The date the resource was updated.
industry Industry Business industry, when specified.
stockSymbol string Stock symbol (ticker) of the business.

Manual review needed

  • Docs list archived (boolean, non-Optional) which is missing from the DTO. Possible new required field — flag as breaking-change candidate before adding.
  • Docs treat businessVertical as non-Optional, but the DTO has it Optional. Required ↔ Optional flip; defer to humans.

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

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

Added optional fields

Field Type Docs note
expectedCompletionDate RFC3339 Date string For ACH credit with statuses Pending or Sent — when the counterparty handles the request.
counterpartyVerificationMethod string Verification method of the counterparty (e.g. Plaid).

Manual review needed

  • Docs list sameDay (boolean) and secCode (string) as non-Optional but they aren't on the DTO. Possible new required fields — flag as breaking-change candidates.

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

  • Docs list direction (string) and isAdvanceable (boolean) as non-Optional but they aren't on the DTO. Possible new required fields — flag as breaking-change candidates.

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))" returns 117 (unchanged).

Queued for next run

Resources with detected optional drift that did not fit in this run (5-resource cap):

  • IndividualCustomerDTO (unit/models/customer.py) — missing eligibleProducts, ein. Also: docs archiveReason enum adds FraudLinkedToFraudulentCustomer not in code (manual review).
  • BusinessCustomerDTO (unit/models/customer.py) — missing eligibleProducts. Same archiveReason enum drift (manual review).
  • IndividualDebitCardDTO / BusinessDebitCardDTO (unit/models/card.py) — missing updatedAt. Docs also list bin as non-Optional (manual review).
  • WirePaymentDTO (unit/models/payment.py) — missing imadOmad.
  • BusinessVirtualDebitCardDTO (unit/models/card.py) — missing updatedAt, shippingAddress, tags, design.

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 14, 2026 15:25
Add the following optional fields to IndividualApplicationDTO,
sourced from https://docs.unit.co/resources#individualapplication:

- updatedAt (RFC3339 Date string) -- date the resource was last updated
- passport (string) -- individual passport number, set when ssn absent
- nationality (ISO 3166-1 alpha-2) -- always set when passport is populated
- industry (Industry) -- sole-prop business industry
- idTheftScore (number 0-1000) -- ID theft verification score

Co-authored-by: Avery Kushner <avesk@users.noreply.github.com>
Add the following optional fields to DepositAccountDTO,
sourced from https://docs.unit.co/resources#depositaccount:

- updatedAt (RFC3339 Date string) -- date the resource was last updated
- freezeReason (string) -- reason an account was frozen (Fraud, ByBank,
  or free-text description)
- fraudReason (FraudReason) -- expanded fraud reason when Fraud is the
  close/freeze reason
- dacaStatus (Entered | Activated) -- Deposit Account Control Agreement
  status

Also exposes a DacaStatus literal type for consumers.

Co-authored-by: Avery Kushner <avesk@users.noreply.github.com>
Add the following optional fields to BusinessApplicationDTO,
sourced from https://docs.unit.co/resources#businessapplication:

- updatedAt (RFC3339 Date string) -- date the resource was last updated
- industry (Industry) -- business industry, when specified
- stockSymbol (string) -- stock symbol (ticker) of the business

Co-authored-by: Avery Kushner <avesk@users.noreply.github.com>
Add the following optional fields to AchPaymentDTO,
sourced from https://docs.unit.co/resources#ach-payment:

- expectedCompletionDate (RFC3339 Date string) -- only for ACH credit
  with statuses Pending or Sent; date the counterparty will handle the
  request
- counterpartyVerificationMethod (string) -- verification method of the
  counterparty (e.g. 'Plaid')

Co-authored-by: Avery Kushner <avesk@users.noreply.github.com>
Add the following optional fields to AchReceivedPaymentDTO,
sourced from https://docs.unit.co/resources#ach-received-payment:

- 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

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