[High] SDK Sync: Fix schema/type drift — Entity, Account, Payment#75
[High] SDK Sync: Fix schema/type drift — Entity, Account, Payment#75mack-ship-it wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a4f64929e3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| 'c_corporation', | ||
| 's_corporation', | ||
| 'llc', | ||
| 'partnership', | ||
| 'sole_proprietorship', | ||
| 'receive_only' | ||
| ] | ||
|
|
||
|
|
||
| EntityCapabilitiesLiterals = Literal[ | ||
| 'payments:send', | ||
| 'payments:receive', | ||
| 'payments:limited-send', | ||
| 'data:retrieve' | ||
| 'sole_proprietorship' |
There was a problem hiding this comment.
Remove deprecated corporation entity literals
For the SDK's pinned API version, corporation creation is done with type: "corporation"; the older c_corporation, s_corporation, llc, partnership, and sole_proprietorship values were removed in API v2. Since EntityResource.create() forwards opts unchanged, typed users can now pass one of these newly allowed literals and receive an API validation error instead of type-checker guidance.
Useful? React with 👍 / 👎.
| metadata: Optional[Dict[str, Any]] | ||
| fee: Optional[PaymentFee] | ||
| dry_run: Optional[bool] | ||
| reversal_account: Optional[str] |
There was a problem hiding this comment.
Add reversal_account to the Payment response type
This adds reversal_account only to PaymentCreateOpts, but create(), retrieve(), and list() all return MethodResponse[Payment], and the API's Payment object includes the same reversal_account field. Typed callers who create or retrieve a payment with a reversal account still cannot access that returned value through the Payment type, so the schema drift remains for the response path.
Useful? React with 👍 / 👎.
a4f6492 to
8ef0c7d
Compare
High-priority SDK sync — schema alignment with current API.
Codex Review AssessmentComment 1 (P2) - Corporation type variants removed in API v2: Comment 2 (P2) - reversal_account only in PaymentCreateOpts, not in Payment response type: |
High priority — fixes schema drift between the Python SDK and the current API. Entity TypedDict updated (capabilities to products/subscriptions model), Account types updated (clearing, debit_card, consent_status), Payment types updated (5 missing fund statuses, reversal_account), Entity corporation subtypes added, request_opts positional bug fixed.