Skip to content

Sync SDK DTOs with Unit API docs (automated)#71

Closed
cursor[bot] wants to merge 5 commits into
masterfrom
cursor/unit-sdk-dtos-sync-1bd5
Closed

Sync SDK DTOs with Unit API docs (automated)#71
cursor[bot] wants to merge 5 commits into
masterfrom
cursor/unit-sdk-dtos-sync-1bd5

Conversation

@cursor

@cursor cursor Bot commented May 13, 2026

Copy link
Copy Markdown

Automated drift sync against docs.unit.co/resources. Adds optional fields that exist on Unit's live API resources but were missing from the SDK DTOs. All new fields default to None and are passed via keyword arguments so existing call sites continue to work.

Drift found and fixed

DTO Added fields
AchPaymentDTO expectedCompletionDate, counterpartyVerificationMethod, sameDay, secCode
AchReceivedPaymentDTO isAdvanceable, direction, originatorEntityId, receivingEntityName (also now assigns self.id, which was previously dropped)
AccountEndOfDayDTO overdraftLimit
DepositAccountDTO updatedAt, freezeReason, fraudReason, dacaStatus, interestTerms
IndividualCustomerDTO eligibleProducts, ein
BusinessCustomerDTO eligibleProducts
CounterpartyDTO tags
DisputeDTO updatedAt

Other fixes

  • DisputeDTO.from_json_api was passing positional arguments in the wrong order, so self.attributes["source"] was actually getting the createdAt value, etc. Switched to keyword arguments per the SDK convention to fix it.
  • AchReceivedPaymentDTO.__init__ did not assign self.id; now does.

Verification

  • All edited modules import cleanly.
  • Ran a smoke test that feeds representative JSON-API attribute dicts through every modified from_json_api and asserts the new fields land in self.attributes.

Out of scope

The Unit docs page lists ~100 resource types. This pass focused on existing DTO drift; entirely missing resources (e.g. accountHold, wireReceivedPayment, declinedIncomingPayment, account limit overrides, positive-pay resources, credit application resources) were not added. A follow-up can introduce them with codec mappings if/when the API repo needs them.

Open in Web View Automation 

cursoragent and others added 5 commits May 13, 2026 18:43
Per https://docs.unit.co/resources:

AchPayment: add expectedCompletionDate, counterpartyVerificationMethod,
sameDay, secCode.

AchReceivedPayment: add isAdvanceable, direction, originatorEntityId,
receivingEntityName. Also assign self.id which was previously missing.

Co-authored-by: Avery Kushner <avesk@users.noreply.github.com>
Per https://docs.unit.co/resources:

DepositAccount: add updatedAt, freezeReason, fraudReason, dacaStatus,
interestTerms.

AccountEndOfDay: add overdraftLimit.

Co-authored-by: Avery Kushner <avesk@users.noreply.github.com>
Per https://docs.unit.co/resources:

IndividualCustomer: add eligibleProducts (Array of Product) and ein
(Optional, sole-prop with EIN).

BusinessCustomer: add eligibleProducts.

Co-authored-by: Avery Kushner <avesk@users.noreply.github.com>
Per https://docs.unit.co/resources, ACH counterparties expose a tags
attribute that the DTO was not deserializing.

Co-authored-by: Avery Kushner <avesk@users.noreply.github.com>
Per https://docs.unit.co/resources, Dispute exposes an optional updatedAt
attribute. Also switch from_json_api to use keyword arguments — the
previous positional call assigned attributes to the wrong constructor
parameters (createdAt was being passed as 'source', etc.) but happened
to work since values were stored in self.attributes by name in __init__.

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