Skip to content

feat(openapi): add type discriminator to InternalAccount#390

Merged
pengying merged 1 commit intomainfrom
04-23-feat_openapi_add_type_discriminator_to_internalaccount
Apr 23, 2026
Merged

feat(openapi): add type discriminator to InternalAccount#390
pengying merged 1 commit intomainfrom
04-23-feat_openapi_add_type_discriminator_to_internalaccount

Conversation

@pengying
Copy link
Copy Markdown
Contributor

Add an InternalAccountType enum (INTERNAL_FIAT, INTERNAL_CRYPTO,
EMBEDDED_WALLET) as a required field on InternalAccount and as an
optional query filter on GET /internal-accounts. Needed so integrators
can distinguish the self-custodial Embedded Wallet from platform-managed
holding accounts on the same customer.

Also updates the internal-account-status webhook example to carry the
new required field.

Add an InternalAccountType enum (INTERNAL_FIAT, INTERNAL_CRYPTO,
EMBEDDED_WALLET) as a required field on InternalAccount and as an
optional query filter on GET /internal-accounts. Needed so integrators
can distinguish the self-custodial Embedded Wallet from platform-managed
holding accounts on the same customer.

Also updates the internal-account-status webhook example to carry the
new required field.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
grid-flow-builder Ready Ready Preview, Comment Apr 23, 2026 11:44pm

Request Review

Copy link
Copy Markdown
Contributor Author

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 23, 2026

✱ Stainless preview builds

This PR will update the grid SDKs with the following commit messages.

kotlin

feat(api): add type field to InternalAccount

openapi

feat(api): add type field and InternalAccountType enum to InternalAccount

python

feat(api): add type field to InternalAccount model

typescript

feat(api): add type field to InternalAccount
⚠️ grid-openapi studio · code

Your SDK build had at least one "error" diagnostic.
generate ❗

⚠️ grid-kotlin studio · code

Your SDK build had at least one "error" diagnostic.
generate ❗build ✅lint ✅test ✅

⚠️ grid-typescript studio · code

Your SDK build had at least one "error" diagnostic.
generate ❗build ✅lint ✅test ✅

npm install https://pkg.stainless.com/s/grid-typescript/b248988d4d4a1897c2e563c2354021a26d7abdb1/dist.tar.gz
⚠️ grid-python studio · code

Your SDK build had at least one "error" diagnostic.
generate ❗build ✅lint ✅test ✅

pip install https://pkg.stainless.com/s/grid-python/7ec3392522c2684b92f9b47733cc81d7914ed817/grid-0.0.1-py3-none-any.whl

This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
If you push custom code to the preview branch, re-run this workflow to update the comment.
Last updated: 2026-04-24 00:05:42 UTC

@pengying pengying marked this pull request as ready for review April 23, 2026 23:59
@pengying pengying merged commit 101dcb2 into main Apr 23, 2026
6 checks passed
@pengying pengying deleted the 04-23-feat_openapi_add_type_discriminator_to_internalaccount branch April 23, 2026 23:59
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 24, 2026

Greptile Summary

This PR introduces InternalAccountType as a new required field on the InternalAccount schema and as an optional query filter on GET /internal-accounts, enabling integrators to distinguish self-custodial Embedded Wallets from platform-managed fiat/crypto holding accounts. Both generated bundles (openapi.yaml and mintlify/openapi.yaml) are correctly updated via make build, the webhook example is kept schema-valid, and the enum values are clearly documented.

Confidence Score: 5/5

Safe to merge — all changes are additive and well-formed; the only finding is a P2 style suggestion.

All six files are consistent with each other and with the build process. The single comment is a missing hyperlink in the EMBEDDED_WALLET description, which is a P2 style issue and does not block merge.

No files require special attention.

Important Files Changed

Filename Overview
openapi/components/schemas/customers/InternalAccountType.yaml New enum schema with three values (INTERNAL_FIAT, INTERNAL_CRYPTO, EMBEDDED_WALLET); well-formed and properly described. Minor: missing link in EMBEDDED_WALLET description.
openapi/components/schemas/customers/InternalAccount.yaml Adds type as a required field with $ref to InternalAccountType; consistent placement and formatting with existing properties.
openapi/paths/internal-accounts/internal_accounts.yaml Adds optional type query parameter using the new InternalAccountType enum schema; description is clear and practical.
openapi/webhooks/internal-account-status.yaml Webhook example updated to include the new required type field with INTERNAL_FIAT value, keeping the example schema-valid.
openapi.yaml Generated bundle reflecting all source changes; identical diff to mintlify/openapi.yaml as expected from make build.
mintlify/openapi.yaml Mintlify-targeted generated bundle; changes are identical to the root openapi.yaml bundle, consistent with the build process.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[GET /internal-accounts] -->|optional ?type=| B{InternalAccountType filter}
    B -->|INTERNAL_FIAT| C[Grid-managed fiat holding account]
    B -->|INTERNAL_CRYPTO| D[Grid-managed crypto / stablecoin account]
    B -->|EMBEDDED_WALLET| E[Self-custodial Embedded Wallet]
    B -->|no filter| F[All account types returned]

    G[InternalAccount response object] --> H[type: InternalAccountType REQUIRED]
    H --> C
    H --> D
    H --> E

    E -->|outbound transfers| I[Requires session signature from customer device]
Loading

Fix All in Claude Code

Prompt To Fix All With AI
This is a comment left during a code review.
Path: openapi/components/schemas/customers/InternalAccountType.yaml
Line: 16-19

Comment:
**Missing link in `EMBEDDED_WALLET` description**

The description says "see the Embedded Wallets guide" but provides no URL or `$ref` to the actual guide. Integrators hitting this in the rendered docs won't know where to look for the session-signature flow details.

```suggestion
  customer. Outbound transfers require a session signature produced by the
  customer's device — see the [Embedded Wallets guide](/embedded-wallets).
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "feat(openapi): add type discriminator to..." | Re-trigger Greptile

Comment on lines +16 to +19

- `EMBEDDED_WALLET`: A self-custodial Embedded Wallet provisioned for the
customer. Outbound transfers require a session signature produced by the
customer's device — see the Embedded Wallets guide.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Missing link in EMBEDDED_WALLET description

The description says "see the Embedded Wallets guide" but provides no URL or $ref to the actual guide. Integrators hitting this in the rendered docs won't know where to look for the session-signature flow details.

Suggested change
- `EMBEDDED_WALLET`: A self-custodial Embedded Wallet provisioned for the
customer. Outbound transfers require a session signature produced by the
customer's device — see the Embedded Wallets guide.
customer. Outbound transfers require a session signature produced by the
customer's device — see the [Embedded Wallets guide](/embedded-wallets).
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/customers/InternalAccountType.yaml
Line: 16-19

Comment:
**Missing link in `EMBEDDED_WALLET` description**

The description says "see the Embedded Wallets guide" but provides no URL or `$ref` to the actual guide. Integrators hitting this in the rendered docs won't know where to look for the session-signature flow details.

```suggestion
  customer. Outbound transfers require a session signature produced by the
  customer's device — see the [Embedded Wallets guide](/embedded-wallets).
```

How can I resolve this? If you propose a fix, please make it concise.

Fix in Claude Code

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.

3 participants