Skip to content

[High] SDK Sync: Fix schema/type drift — Entity, Account, Payment#75

Open
mack-ship-it wants to merge 3 commits into
masterfrom
mack/sdk-sync-python-high
Open

[High] SDK Sync: Fix schema/type drift — Entity, Account, Payment#75
mack-ship-it wants to merge 3 commits into
masterfrom
mack/sdk-sync-python-high

Conversation

@mack-ship-it

Copy link
Copy Markdown

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines 7 to +11
'c_corporation',
's_corporation',
'llc',
'partnership',
'sole_proprietorship',
'receive_only'
]


EntityCapabilitiesLiterals = Literal[
'payments:send',
'payments:receive',
'payments:limited-send',
'data:retrieve'
'sole_proprietorship'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@mack-ship-it mack-ship-it force-pushed the mack/sdk-sync-python-high branch from a4f6492 to 8ef0c7d Compare June 26, 2026 18:21
High-priority SDK sync — schema alignment with current API.
@mack-ship-it

Copy link
Copy Markdown
Author

Codex Review Assessment

Comment 1 (P2) - Corporation type variants removed in API v2:
False positive. The OpenAPI spec (which we're syncing against) includes c_corporation, s_corporation, llc, partnership, sole_proprietorship as valid entity types. The Node SDK also has these types. Both SDKs match the spec.

Comment 2 (P2) - reversal_account only in PaymentCreateOpts, not in Payment response type:
Valid. The reversal_account field should also be added to the Payment response TypedDict since the API returns it. Will fix.

@mack-ship-it mack-ship-it reopened this Jun 26, 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.

1 participant