Sync SDK DTOs with Unit API docs (automated, 2026-05-13)#72
Closed
cursor[bot] wants to merge 5 commits into
Closed
Sync SDK DTOs with Unit API docs (automated, 2026-05-13)#72cursor[bot] wants to merge 5 commits into
cursor[bot] wants to merge 5 commits into
Conversation
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>
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/cherry-pick if desired.
Resources synced
1.
AchPaymentDTO(unit/models/payment.py)Source: https://docs.unit.co/resources#ach-payment
Added optional fields
expectedCompletionDatePending/Sent, the date on which the counterparty will handle the request.counterpartyVerificationMethodPlaid.Manual review needed
sameDay—boolean. Required in docs; absent from the DTO. Adding may break stored payloads.secCode—string(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
originatorEntityIdreceivingEntityNameManual review needed
isAdvanceable—boolean. Required in docs; absent from the DTO.direction—string(Debit/Credit). Required in docs; absent from the DTO.attributes.get("companyName"),attributes.get("counterpartyRoutingNumber"), andattributes.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
updatedAtManual review needed
bin—string(9-digit BIN). Marked required in docs; absent from the DTO. Same gap exists onBusinessDebitCardDTO,IndividualVirtualDebitCardDTO, andBusinessVirtualDebitCardDTO— 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
eineligibleProductsProductstringsList[str]since the SDK has no typedProductenum yet.Manual review needed
BusinessCustomerDTOis also missingeligibleProductsper 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
updatedAtfreezeReasonFraud,ByBank, or free text).fraudReasoncloseReason=Fraud. Reuses the existingFraudReasonLiteral in this file.dacaStatusEntered,Activated.Manual review needed
interestTerms— typed object (Interest Terms). Only returned whenextraFields[account]is supplied; would require a new nested DTO. Skipped to keep this run additive-only.Backward compatibility
All additions are optional kwargs with
Nonedefaults.from_json_apiusesattributes.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:
Recent upstream activity
git log --since="30 days ago" HEAD..upstream/masterreturned no recent commits touchingunit/models/payment.py,unit/models/card.py,unit/models/customer.py, orunit/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.