Skip to content

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

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

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

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/cherry-pick if desired.

Note: per the docs-sync automation spec, this run should ideally open one PR per
resource. The current cloud-agent runner is constrained to a single designated
branch, so the 5 resource updates are bundled here as 5 separate commits on
cursor/unit-sdk-docs-sync-167a. Reviewers can merge as one or split per commit.

Resources synced

1. 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 status Pending / Sent, the date on which the counterparty will handle the request.
counterpartyVerificationMethod string Verification method of the counterparty, e.g. Plaid.

Manual review needed

  • sameDayboolean. Required in docs; absent from the DTO. Adding may break stored payloads.
  • secCodestring (WEB / CCD / PPD). Required 3-letter ACH SEC code per docs; absent from the DTO.

2. 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

  • isAdvanceableboolean. Required in docs; absent from the DTO.
  • directionstring (Debit / Credit). Required in docs; absent from the DTO.
  • The current SDK uses attributes.get("companyName"), attributes.get("counterpartyRoutingNumber"), and attributes.get("traceNumber") even though docs mark these as required (Required ↔ Optional flip in the SDK direction). Likely a defensive choice — left alone.

3. IndividualDebitCardDTO (unit/models/card.py)

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

Added optional fields

Field Type Docs note
updatedAt RFC3339 Date string Date the card resource was updated.

Manual review needed

  • binstring (9-digit BIN). Marked required in docs; absent from the DTO. Same gap exists on BusinessDebitCardDTO, IndividualVirtualDebitCardDTO, and BusinessVirtualDebitCardDTO — not touched in this PR but worth a follow-up.

4. IndividualCustomerDTO (unit/models/customer.py)

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

Added optional fields

Field Type Docs note
ein string Present when the individual is a sole proprietor with an EIN.
eligibleProducts array of Product strings Products the customer is eligible for. Stored as a raw List[str] since the SDK has no typed Product enum yet.

Manual review needed

  • BusinessCustomerDTO is also missing eligibleProducts per docs — out of scope for this PR; flagged for a follow-up sync.

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

Source: https://docs.unit.co/resources#deposit-account

Added optional fields

Field Type Docs note
updatedAt RFC3339 Date string Date the deposit account was updated.
freezeReason string Reason the account was frozen (Fraud, ByBank, or free text).
fraudReason enum string Expanded fraud reason when closeReason=Fraud. Reuses the existing FraudReason Literal in this file.
dacaStatus string DACA status, one of Entered, Activated.

Manual review needed

  • interestTerms — typed object (Interest Terms). Only returned when extraFields[account] is supplied; would require a new nested DTO. Skipped to keep this run additive-only.

Backward compatibility

All additions are optional kwargs with None defaults. from_json_api uses attributes.get(...) for every new field. No existing call site needs to change; constructor signatures remain compatible because new kwargs were appended at the end.

Verified post-edit:

$ python3 -c "from unit.models.codecs import DtoDecoder, mappings; print(len(mappings))"
117

Recent upstream activity

git log --since="30 days ago" HEAD..upstream/master returned no recent commits touching unit/models/payment.py, unit/models/card.py, unit/models/customer.py, or unit/models/account.py, so no upstream cherry-pick candidates to flag.


Opened by the docs-sync automation. Paired API PR will be opened by automation 2.

Open in Web View Automation 

cursoragent and others added 5 commits May 13, 2026 19:25
Add optional fields documented in https://docs.unit.co/resources#ach-payment:
- expectedCompletionDate (RFC3339 date) — for ACH credit with status
  Pending/Sent indicating when the counterparty will handle the request
- counterpartyVerificationMethod (string) — verification method of the
  counterparty (e.g. 'Plaid')

Both default to None so existing callers are unaffected.

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

Both default to None so existing callers are unaffected.

Co-authored-by: Avery Kushner <avesk@users.noreply.github.com>
Add optional field documented in https://docs.unit.co/resources#individualdebitcard:
- updatedAt (RFC3339 date) — date the card resource was updated

Defaults to None so existing callers are unaffected.

Co-authored-by: Avery Kushner <avesk@users.noreply.github.com>
Add optional fields documented in https://docs.unit.co/resources#individualcustomer:
- ein (string) — present when the individual is a sole proprietor with an EIN
- eligibleProducts (array of Product strings) — products the customer is
  eligible for

Both default to None so existing callers are unaffected. eligibleProducts
is stored as a raw list of strings since the SDK does not yet have a
typed Product enum.

Co-authored-by: Avery Kushner <avesk@users.noreply.github.com>
Add optional fields documented in https://docs.unit.co/resources#deposit-account:
- updatedAt (RFC3339 date) — date the deposit account was updated
- freezeReason (string) — reason the account was frozen (Fraud, ByBank,
  or free-text)
- fraudReason (FraudReason enum) — expanded fraud reason when closeReason
  is Fraud
- dacaStatus (string) — DACA status, one of Entered, Activated

All default to None so existing callers are unaffected.

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