Skip to content

feat: add optional ownershipType to external account schema - #784

Open
shreyav wants to merge 3 commits into
mainfrom
claude/external-account-ownership-type-il2hl2
Open

feat: add optional ownershipType to external account schema#784
shreyav wants to merge 3 commits into
mainfrom
claude/external-account-ownership-type-il2hl2

Conversation

@shreyav

@shreyav shreyav commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Adds an optional ownershipType field to the external account resource, so external accounts can indicate whether they belong to the customer themselves (FIRST_PARTY) or to a third party (THIRD_PARTY).

Changes

  • New enum openapi/components/schemas/external_accounts/OwnershipType.yaml with values FIRST_PARTY and THIRD_PARTY.
  • ExternalAccount.yaml: adds an optional top-level ownershipType property, alongside the other resource-level fields (customerId, currency, platformAccountId, ...).
  • ExternalAccountCreateRequest.yaml and PlatformExternalAccountCreateRequest.yaml: add the same optional ownershipType property so it can be set at creation time for both customer and platform-owned accounts.
  • Rebundled openapi.yaml and mintlify/openapi.yaml via make build.

The field lives on the resource envelope rather than inside the per-rail accountInfo payloads, matching where the other account-level metadata sits. It is optional, so this is backwards compatible and info.version is unchanged.

Testing

  • make build — bundles cleanly.
  • npx @redocly/cli lint openapi.yaml — valid (warnings only, all pre-existing).

Note: the npx spectral lint step of make lint fails in this environment because the spectral binary isn't resolvable, and make lint-markdown fails because package.json has no lint:markdown script. Both are pre-existing and unrelated to this change.

Adds an optional `ownershipType` field to `BaseExternalAccountInfo`,
backed by a new `OwnershipType` enum with `FIRST_PARTY` and
`THIRD_PARTY` values, so external accounts can indicate whether they
belong to the customer themselves or to a third party.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GAqqDX3oY33G7LcHNv5T2J
@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown

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

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
grid-flow-builder Ignored Ignored Preview Jul 31, 2026 10:01pm
grid-wallet-demo Ignored Ignored Preview Jul 31, 2026 10:01pm

Request Review

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

✱ Stainless preview builds for grid

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

cli

feat(api): add ownershipType to agent/customer/platform external-accounts

go

feat(api): add ownership_type parameter to external account creation

kotlin

feat(api): add ownershipType field to external account create models

openapi

feat(api): add ownershipType field to BaseExternalAccountInfo

php

feat(api): add ownershipType field to external account models

python

feat(api): add ownership_type parameter to external account creation

ruby

feat(api): add ownership_type parameter to external account models

typescript

feat(api): add ownershipType field to external accounts

Edit this comment to update them. They will appear in their respective SDK's changelogs.

grid-typescript studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅build ✅lint ❗test ✅

npm install https://pkg.stainless.com/s/grid-typescript/72c9baf8aab0e0d41011c2d402237d3b1dbd9cb2/dist.tar.gz
grid-openapi studio · code · diff

Your SDK build had at least one "warning" diagnostic, but this did not represent a regression.
generate ⚠️

⚠️ grid-ruby studio · code · diff

Your SDK build had a failure in the test CI job, which is a regression from the base state.
generate ✅build ✅ (prev: build ⏭️) → lint ✅test ❗ (prev: test ✅)

grid-go studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅build ✅ (prev: build ⏭️) → lint ❗test ❗

go get github.com/stainless-sdks/grid-go@c10cde75864d713bb7bf7a6d35806a07eac863d3
grid-kotlin studio · code · diff

Your SDK build had at least one "warning" diagnostic, but this did not represent a regression.
generate ⚠️build ✅ (prev: build ⏭️) → lint ✅ (prev: lint ⏭️) → test ❗

⚠️ grid-python studio · code · diff

Your SDK build had a failure in the lint CI job, which is a regression from the base state.
generate ✅build ✅ (prev: build ⏭️) → lint ❗ (prev: lint ⏭️) → test ❗

pip install https://pkg.stainless.com/s/grid-python/27cad6ce6a8f5a6f30bca698e0506ed5d8e51cc5/grid-0.0.1-py3-none-any.whl
grid-php studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅lint ✅test ✅

grid-cli studio · code · diff

Your SDK build had at least one "warning" diagnostic, but this did not represent a regression.
generate ⚠️build ❗lint ❗test ❗


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-07-31 22:06:46 UTC

@mintlify

mintlify Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Grid 🟢 Ready View Preview Jul 31, 2026, 9:46 PM

@greptile-apps

greptile-apps Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds an optional external-account ownership classification throughout the API contract.

  • Defines OwnershipType with FIRST_PARTY and THIRD_PARTY values.
  • Adds ownershipType to the shared BaseExternalAccountInfo schema.
  • Updates both committed OpenAPI bundles consistently.

Confidence Score: 5/5

The PR appears safe to merge with no actionable defects identified.

The new optional property follows existing schema conventions, resolves through the shared external-account composition hierarchy, and is represented consistently in both generated bundles.

Important Files Changed

Filename Overview
openapi/components/schemas/external_accounts/OwnershipType.yaml Defines a valid string enum for first- and third-party external-account ownership.
openapi/components/schemas/external_accounts/BaseExternalAccountInfo.yaml Adds the ownership classification as an optional property inherited by external-account create and response schemas.
openapi.yaml Correctly bundles the new component and shared optional property.
mintlify/openapi.yaml Remains consistent with the root bundled OpenAPI artifact.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  O[OwnershipType enum] --> B[BaseExternalAccountInfo]
  B --> C[External-account create schemas]
  B --> R[External-account response schemas]
  C --> S[Bundled OpenAPI and generated SDK inputs]
  R --> S
Loading

Reviews (1): Last reviewed commit: "feat: add optional ownershipType to exte..." | Re-trigger Greptile

…eateRequest

Relocate the optional ownershipType field from BaseExternalAccountInfo
(inside the accountInfo oneOf) to the top-level ExternalAccount resource
and ExternalAccountCreateRequest, alongside the other resource-level
fields like customerId and currency.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GAqqDX3oY33G7LcHNv5T2J
Make ownershipType settable on platform-owned external account creation
as well, matching ExternalAccountCreateRequest.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GAqqDX3oY33G7LcHNv5T2J
@jklein24

Copy link
Copy Markdown
Contributor

Is the main reason to put this top-level just because we don't have a base crypto wallet account type? This is currently only needed for crypto wallets, right? Do you anticipate it might be used or needed for some fiat rails too?

Also, how will people know when this is required or not? Should we add something to docs or the field desription?

@shreyav

shreyav commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

Is the main reason to put this top-level just because we don't have a base crypto wallet account type? This is currently only needed for crypto wallets, right? Do you anticipate it might be used or needed for some fiat rails too?

Also, how will people know when this is required or not? Should we add something to docs or the field desription?

we do have a base but for some reason I couldn't figure out all the other fields are at this level and only the discriminator is on the base, so i put it here for consistency -- I don't feel strongly about it and can change it if you do. We also need for fiat in some cases, will share context offline

I haven't figure out exactly when its required yet, will update the description when I do

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