Sync SDK DTOs with Unit API docs (automated, 2026-05-13)#73
Closed
cursor[bot] wants to merge 5 commits into
Closed
Sync SDK DTOs with Unit API docs (automated, 2026-05-13)#73cursor[bot] wants to merge 5 commits into
cursor[bot] wants to merge 5 commits into
Conversation
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>
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 or cherry-pick.
Resources synced
1.
IndividualApplicationDTO(unit/models/application.py)Source: https://docs.unit.co/resources#individualapplication
Added optional fields
updatedAtnationalityindustryIndustryenumidTheftScoreManual review needed
passportis described in the docs (noOptionalmarker) as "Either ssn or passport will be populated", but the DTO does not currently hydrateattributes["passport"]. Effectively a missing required-or-conditional field — breaking-change candidate, left untouched here.archivedis described in the docs without anOptionalmarker but is currently absent fromself.attributes. Breaking-change candidate, left untouched here.ApplicationStatusliteral in code isLiteral["Approved", "Denied", "Pending", "PendingReview"]— narrower than the documented enum which also includesAwaitingDocuments. Existing typing limitation, not changed.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
updatedAtindustryIndustryenumstockSymbolManual review needed
archivedis documented without anOptionalmarker but is absent fromself.attributes. Breaking-change candidate, left untouched here.ssnis on the DTO (attributes["ssn"]) but is not listed on the BusinessApplication docs table — possible removal candidate, left untouched here.ApplicationStatusliteral narrower than docs enum (same caveat as above).entityTypeliteral in code includes"Corporation"; docs listLLC,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
updatedAtfreezeReasonFraud,ByBank, or free-text.fraudReasonFraudReasonenumFraudis the close reason.dacaStatusDacaStatusenum (Entered|Activated)A new
DacaStatusliteral alias was added next to the existingAccountStatus/CloseReasonaliases.Manual review needed
interestTermsis documented without anOptionalmarker (only available whenextraFields[account]is requested) but is absent fromself.attributes. Conditional/required-ish field — left untouched here.CloseReasonliteral in code isLiteral["ByCustomer", "Fraud"]but docs listByCustomer,Fraud, andByBank. Possible enum drift, not changed.4.
AchPaymentDTO(unit/models/payment.py)Source: https://docs.unit.co/resources#ach-payment
Added optional fields
settlementDateself.settlement_datebut never copied intoself.attributes; now hydrated into both.expectedCompletionDatePending/Sent.counterpartyVerificationMethodPlaid).Manual review needed
sameDay(boolean) andsecCode(string) are listed on the docs without anOptionalmarker but are absent fromself.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
originatorEntityIdreceivingEntityNameManual review needed
direction(Debit/Credit) andisAdvanceable(boolean) are listed in the docs without anOptionalmarker but are absent fromself.attributes. Breaking-change candidates, left untouched here.AchReceivedPaymentStatusliteral in code isLiteral["Pending", "Advanced", "Completed", "Returned"]but docs includePendingReviewandMarkedForReturn. Enum drift, not changed.Backward compatibility
All additions are optional kwargs with
Nonedefaults; 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 missingnetworkTransactionId,internationalServiceFeeper OpenAPI; needs docs cross-check.WirePaymentDTO—imadOmadobject,settlementDate.BookPaymentDTO—transactionSummaryOverride.OriginatedAchTransactionDTO—secCode,traceNumber.ReceivedAchTransactionDTO—counterpartyName.ReturnedAchTransactionDTO—achReason.AccountEndOfDayDTO—overdraftLimit(docs-confirmedOptional).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 intocodecs.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.