Skip to content

External Accounts updates#188

Merged
AaryamanBhute merged 4 commits intomainfrom
auto/sync-grid-schemas-20260212-212337
Feb 13, 2026
Merged

External Accounts updates#188
AaryamanBhute merged 4 commits intomainfrom
auto/sync-grid-schemas-20260212-212337

Conversation

@lightspark-copybara
Copy link
Contributor

Auto-synced account schemas.

These schemas are generated from VASP adapter field definitions in sparkcore.

Synced directories:

  • common/ — per-currency account info and beneficiary schemas
  • external_accounts/ — per-currency external account schemas (reference common/)

Please review the changes before merging.

Lightspark Eng and others added 2 commits February 12, 2026 21:23
@github-actions
Copy link

github-actions bot commented Feb 12, 2026

✱ Stainless preview builds

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

kotlin

chore: Sync account schemas

openapi

feat(api): add external account types for 15+ currencies, update existing account validation

python

chore: Sync account schemas

typescript

feat(api): add 20 currency account types to customers external-accounts
grid-openapi studio · code

Your SDK built successfully.
generate ✅

grid-python studio · code

Your SDK built successfully.
generate ✅build ✅lint ✅test ✅

pip install https://pkg.stainless.com/s/grid-python/afcfefea8b74bad26de8d578dd03582158ea3bff/grid-0.0.1-py3-none-any.whl
grid-typescript studio · code

Your SDK built successfully.
generate ✅build ✅lint ✅test ✅

npm install https://pkg.stainless.com/s/grid-typescript/7fac5ee05345d1dc003f53ed185ca21a2ea87cd9/dist.tar.gz
grid-kotlin studio · code

Your SDK built successfully.
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-02-13 19:48:42 UTC

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 12, 2026

Greptile Overview

Greptile Summary

This PR implements a major restructuring of external account schemas, transitioning from generic account types to currency-specific schemas. The sync adds 10 new currencies (BRL, DKK, HKD, IDR, INR, MXN, MYR, THB, USD, VND) with dedicated account info and beneficiary schemas.

Key changes:

  • Removed deprecated account types: US_ACCOUNT, CLABE, PIX, IBAN, UPI, NGN_ACCOUNT, CAD_ACCOUNT
  • Added currency-specific external account schemas for 10 currencies
  • Each new currency has dedicated AccountInfo, Beneficiary, and ExternalAccountInfo schemas
  • New beneficiary schemas use inline oneOf discriminators for INDIVIDUAL/BUSINESS types instead of referencing a shared BeneficiaryOneOf
  • Existing schemas like GbpAccountInfo, SgdAccountInfo, and PhpAccountInfo only received formatting changes - all validation patterns and required fields remain intact

Breaking API change:
This sync removes several account types from the ExternalAccountType enum, which will break existing API clients using these types.

Confidence Score: 3/5

  • This PR introduces breaking changes and has a configuration issue that needs resolution before merging.
  • The schema changes are structurally consistent and well-formed, but this is a breaking API change that removes support for 7 existing account types. Additionally, there's a broken reference in .stainless/stainless.yml to NgnExternalAccountInfo which doesn't exist.
  • Pay close attention to .stainless/stainless.yml which contains a broken schema reference, and ExternalAccountType.yaml which removes several account types.

Important Files Changed

Filename Overview
openapi/components/schemas/external_accounts/ExternalAccountType.yaml Removed 7 account types (US_ACCOUNT, CLABE, PIX, IBAN, UPI, NGN_ACCOUNT, CAD_ACCOUNT) and added 10 new currency-specific types (BRL, DKK, HKD, IDR, INR, MXN, MYR, THB, USD, VND). This is a breaking change.
openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml Replaced account type references to align with new currency-specific external account schema files. Updated discriminator mapping to reference new files.
openapi/components/schemas/external_accounts/BaseExternalAccountInfo.yaml Updated discriminator mapping to reflect new currency-specific external account files and removed mappings for deprecated account types.
.stainless/stainless.yml Updated reference from NgnAccountExternalAccountInfo to NgnExternalAccountInfo, but this file doesn't exist in the schema, indicating a potential configuration error.
openapi/components/schemas/common/BrlAccountInfo.yaml New schema for Brazilian Real account info with PIX key, PIX key type, and tax ID fields. Well-structured.
openapi/components/schemas/external_accounts/BrlExternalAccountInfo.yaml New external account schema for BRL that combines BaseExternalAccountInfo, BrlAccountInfo, and adds currency-specific beneficiary with oneOf discriminator for INDIVIDUAL/BUSINESS types.
openapi/components/schemas/common/UsdAccountInfo.yaml New schema for USD account info with routing number and account number. Replaces UsAccountInfo for external accounts.
openapi/components/schemas/external_accounts/UsdExternalAccountInfo.yaml New external account schema for USD replacing US_ACCOUNT. Follows same structure as other currency-specific external accounts with oneOf beneficiary discriminator.

Sequence Diagram

sequenceDiagram
    participant Client
    participant API
    participant Schema Validator
    participant Currency Schema
    
    Client->>API: Create External Account Request
    API->>Schema Validator: Validate accountType
    Schema Validator->>Schema Validator: Check ExternalAccountType enum
    
    alt Currency-Specific Account (BRL, DKK, HKD, etc.)
        Schema Validator->>Currency Schema: Validate with {Currency}ExternalAccountInfo
        Currency Schema->>Currency Schema: Validate {Currency}AccountInfo (account fields)
        Currency Schema->>Currency Schema: Validate beneficiary (oneOf INDIVIDUAL/BUSINESS)
        Currency Schema-->>Schema Validator: Schema valid
    else Legacy Account Type (US_ACCOUNT, CLABE, PIX, etc.)
        Schema Validator-->>API: ERROR: Account type no longer supported
    end
    
    Schema Validator-->>API: Validation result
    API-->>Client: Response
Loading

Last reviewed commit: f78067f

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

49 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Comment on lines 1 to 72
oneOf:
- title: US Account
$ref: ./UsAccountExternalAccountInfo.yaml
- title: CLABE Account
$ref: ./ClabeAccountExternalAccountInfo.yaml
- title: PIX Account
$ref: ./PixAccountExternalAccountInfo.yaml
- title: IBAN Account
$ref: ./IbanAccountExternalAccountInfo.yaml
- title: UPI Account
$ref: ./UpiAccountExternalAccountInfo.yaml
- title: NGN Account
$ref: ./NgnAccountExternalAccountInfo.yaml
- title: CAD Account
$ref: ./CadAccountExternalAccountInfo.yaml
- title: GBP Account
$ref: ./GbpAccountExternalAccountInfo.yaml
- title: PHP Account
$ref: ./PhpAccountExternalAccountInfo.yaml
- title: SGD Account
$ref: ./SgdAccountExternalAccountInfo.yaml
- title: Spark Wallet
$ref: ./SparkWalletExternalAccountInfo.yaml
- title: Lightning
$ref: ./LightningExternalAccountInfo.yaml
- title: Solana Wallet
$ref: ./SolanaWalletExternalAccountInfo.yaml
- title: Tron Wallet
$ref: ./TronWalletExternalAccountInfo.yaml
- title: Polygon Wallet
$ref: ./PolygonWalletExternalAccountInfo.yaml
- title: Base Wallet
$ref: ./BaseWalletExternalAccountInfo.yaml
- title: US Account
$ref: ./UsAccountExternalAccountInfo.yaml
- title: CLABE Account
$ref: ./ClabeAccountExternalAccountInfo.yaml
- title: PIX Account
$ref: ./PixAccountExternalAccountInfo.yaml
- title: IBAN Account
$ref: ./IbanAccountExternalAccountInfo.yaml
- title: UPI Account
$ref: ./UpiAccountExternalAccountInfo.yaml
- title: NGN Account
$ref: ./NgnAccountExternalAccountInfo.yaml
- title: CAD Account
$ref: ./CadAccountExternalAccountInfo.yaml
- title: GBP Account
$ref: ./GbpAccountExternalAccountInfo.yaml
- title: PHP Account
$ref: ./PhpAccountExternalAccountInfo.yaml
- title: SGD Account
$ref: ./SgdAccountExternalAccountInfo.yaml
- title: Spark Wallet
$ref: ./SparkWalletExternalAccountInfo.yaml
- title: Lightning
$ref: ./LightningExternalAccountInfo.yaml
- title: Solana Wallet
$ref: ./SolanaWalletExternalAccountInfo.yaml
- title: Tron Wallet
$ref: ./TronWalletExternalAccountInfo.yaml
- title: Polygon Wallet
$ref: ./PolygonWalletExternalAccountInfo.yaml
- title: Base Wallet
$ref: ./BaseWalletExternalAccountInfo.yaml
- title: Brl Account
$ref: ./BrlExternalAccountInfo.yaml
- title: Cad Account
$ref: ./CadExternalAccountInfo.yaml
- title: Clabe Account
$ref: ./ClabeExternalAccountInfo.yaml
- title: Dkk Account
$ref: ./DkkExternalAccountInfo.yaml
- title: Gbp Account
$ref: ./GbpExternalAccountInfo.yaml
- title: Hkd Account
$ref: ./HkdExternalAccountInfo.yaml
- title: Iban Account
$ref: ./IbanExternalAccountInfo.yaml
- title: Idr Account
$ref: ./IdrExternalAccountInfo.yaml
- title: Inr Account
$ref: ./InrExternalAccountInfo.yaml
- title: Mxn Account
$ref: ./MxnExternalAccountInfo.yaml
- title: Myr Account
$ref: ./MyrExternalAccountInfo.yaml
- title: Ngn Account
$ref: ./NgnExternalAccountInfo.yaml
- title: Php Account
$ref: ./PhpExternalAccountInfo.yaml
- title: Pix Account
$ref: ./PixExternalAccountInfo.yaml
- title: Sgd Account
$ref: ./SgdExternalAccountInfo.yaml
- title: Thb Account
$ref: ./ThbExternalAccountInfo.yaml
- title: Upi Account
$ref: ./UpiExternalAccountInfo.yaml
- title: Us Account
$ref: ./UsExternalAccountInfo.yaml
- title: Usd Account
$ref: ./UsdExternalAccountInfo.yaml
- title: Vnd Account
Copy link
Contributor

Choose a reason for hiding this comment

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

Duplicate entries in oneOf array for multiple currencies. The sync added new entries (e.g., "Cad Account", "Gbp Account", "Pix Account") that duplicate existing ones (e.g., "CAD Account", "GBP Account", "PIX Account") with only capitalization differences. This creates 10 duplicate account types:

  • CAD Account (line 7) & Cad Account (line 19)
  • CLABE Account (line 3) & Clabe Account (line 21)
  • GBP Account (line 9) & Gbp Account (line 23)
  • IBAN Account (line 5) & Iban Account (line 25)
  • NGN Account (line 11) & Ngn Account (line 33)
  • PHP Account (line 13) & Php Account (line 35)
  • PIX Account (line 1) & Pix Account (line 37)
  • SGD Account (line 15) & Sgd Account (line 39)
  • UPI Account (line 7) & Upi Account (line 43)
  • US Account (line ~) & Us Account (line 45)

The new entries reference different schema files (e.g., CadExternalAccountInfo.yaml vs CadAccountExternalAccountInfo.yaml). Both sets of files exist but have different structures - the old files use BeneficiaryOneOf.yaml while new files use currency-specific beneficiary schemas with inline discriminators.

Remove either the old entries (lines 1-16) or the new entries (lines 18-48) to eliminate duplicates.

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml
Line: 1:72

Comment:
Duplicate entries in `oneOf` array for multiple currencies. The sync added new entries (e.g., "Cad Account", "Gbp Account", "Pix Account") that duplicate existing ones (e.g., "CAD Account", "GBP Account", "PIX Account") with only capitalization differences. This creates 10 duplicate account types:

- CAD Account (line 7) & Cad Account (line 19)
- CLABE Account (line 3) & Clabe Account (line 21)
- GBP Account (line 9) & Gbp Account (line 23)
- IBAN Account (line 5) & Iban Account (line 25)
- NGN Account (line 11) & Ngn Account (line 33)
- PHP Account (line 13) & Php Account (line 35)
- PIX Account (line 1) & Pix Account (line 37)
- SGD Account (line 15) & Sgd Account (line 39)
- UPI Account (line 7) & Upi Account (line 43)
- US Account (line ~) & Us Account (line 45)

The new entries reference different schema files (e.g., `CadExternalAccountInfo.yaml` vs `CadAccountExternalAccountInfo.yaml`). Both sets of files exist but have different structures - the old files use `BeneficiaryOneOf.yaml` while new files use currency-specific beneficiary schemas with inline discriminators.

Remove either the old entries (lines 1-16) or the new entries (lines 18-48) to eliminate duplicates.

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

Comment on lines 1 to 11
type: object
required:
- sortCode
- accountNumber
- accountType
- sortCode
- accountNumber
properties:
accountType:
type: string
enum:
- GBP_ACCOUNT
sortCode:
type: string
description: UK bank sort code (6 digits, may include hyphens)
example: '20-00-00'
pattern: '^[0-9]{2}-?[0-9]{2}-?[0-9]{2}$'
description: The sort code of the bank
accountNumber:
type: string
description: UK bank account number (8 digits)
example: '12345678'
minLength: 8
maxLength: 8
pattern: ^[0-9]{8}$
description: The account number of the bank
Copy link
Contributor

Choose a reason for hiding this comment

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

Removed valuable validation and documentation. The previous version included:

  • Pattern validation for sort code: ^[0-9]{2}-?[0-9]{2}-?[0-9]{2}$
  • Pattern validation for account number: ^[0-9]{8}$
  • Length constraints (8 digits for account number)
  • Descriptive text: "UK bank sort code (6 digits, may include hyphens)"
  • Examples: '20-00-00', '12345678'

New version has only generic descriptions like "The sort code of the bank". If this is intentional for flexibility, consider documenting why validation was removed.

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/common/GbpAccountInfo.yaml
Line: 1:11

Comment:
Removed valuable validation and documentation. The previous version included:
- Pattern validation for sort code: `^[0-9]{2}-?[0-9]{2}-?[0-9]{2}$`
- Pattern validation for account number: `^[0-9]{8}$`
- Length constraints (8 digits for account number)
- Descriptive text: "UK bank sort code (6 digits, may include hyphens)"
- Examples: `'20-00-00'`, `'12345678'`

New version has only generic descriptions like "The sort code of the bank". If this is intentional for flexibility, consider documenting why validation was removed.

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

Comment on lines 1 to 11
type: object
required:
- bankName
- swiftCode
- accountNumber
- accountType
- bankName
- accountNumber
properties:
accountType:
type: string
enum:
- SGD_ACCOUNT
bankName:
type: string
description: Name of the beneficiary's bank
example: DBS Bank Ltd
swiftCode:
type: string
description: SWIFT/BIC code (8 or 11 characters)
example: DBSSSGSG
minLength: 8
maxLength: 11
pattern: ^[A-Z]{4}[A-Z]{2}[A-Z0-9]{2}([A-Z0-9]{3})?$
description: The bank name of the bank
accountNumber:
type: string
description: Bank account number
example: '0123456789'
description: The account number of the bank
Copy link
Contributor

Choose a reason for hiding this comment

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

Removed swiftCode field entirely, along with all validation patterns and examples. Previous version had SWIFT code validation (^[A-Z]{4}[A-Z]{2}[A-Z0-9]{2}([A-Z0-9]{3})?$) and was a required field. Verify this field removal is intentional for SGD accounts.

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/common/SgdAccountInfo.yaml
Line: 1:11

Comment:
Removed `swiftCode` field entirely, along with all validation patterns and examples. Previous version had SWIFT code validation (`^[A-Z]{4}[A-Z]{2}[A-Z0-9]{2}([A-Z0-9]{3})?$`) and was a required field. Verify this field removal is intentional for SGD accounts.

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

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

55 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines 1 to 13
@@ -16,5 +9,15 @@ enum:
- TRON_WALLET
- POLYGON_WALLET
- BASE_WALLET
- BRL_ACCOUNT
- DKK_ACCOUNT
Copy link
Contributor

Choose a reason for hiding this comment

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

Removed support for several account types without replacements: US_ACCOUNT (replaced by USD_ACCOUNT), CAD_ACCOUNT, CLABE, PIX, IBAN, UPI, and NGN_ACCOUNT. This is a breaking API change. The corresponding common schemas (CadAccountInfo.yaml, ClabeAccountInfo.yaml, etc.) still exist but are no longer referenced by external account schemas. Verify this removal is intentional for the schema sync.

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/external_accounts/ExternalAccountType.yaml
Line: 1:13

Comment:
Removed support for several account types without replacements: `US_ACCOUNT` (replaced by `USD_ACCOUNT`), `CAD_ACCOUNT`, `CLABE`, `PIX`, `IBAN`, `UPI`, and `NGN_ACCOUNT`. This is a breaking API change. The corresponding common schemas (`CadAccountInfo.yaml`, `ClabeAccountInfo.yaml`, etc.) still exist but are no longer referenced by external account schemas. Verify this removal is intentional for the schema sync.

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

@AaryamanBhute AaryamanBhute changed the title chore: Sync account schemas External Accounts updates Feb 12, 2026
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

55 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

external_account_create: '#/components/schemas/ExternalAccountCreateRequest'
lightning_external_account_info: "#/components/schemas/LightningExternalAccountInfo"
ngn_account_external_account_info: "#/components/schemas/NgnAccountExternalAccountInfo"
ngn_external_account_info: "#/components/schemas/NgnExternalAccountInfo"
Copy link
Contributor

Choose a reason for hiding this comment

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

Reference to NgnExternalAccountInfo schema doesn't exist. NGN_ACCOUNT was removed from ExternalAccountType enum and NgnAccountExternalAccountInfo.yaml was deleted. This reference needs to be removed or the schema needs to be added back.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .stainless/stainless.yml
Line: 112:112

Comment:
Reference to `NgnExternalAccountInfo` schema doesn't exist. `NGN_ACCOUNT` was removed from `ExternalAccountType` enum and `NgnAccountExternalAccountInfo.yaml` was deleted. This reference needs to be removed or the schema needs to be added back.

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

@AaryamanBhute AaryamanBhute merged commit 2c20496 into main Feb 13, 2026
7 of 8 checks passed
@AaryamanBhute AaryamanBhute deleted the auto/sync-grid-schemas-20260212-212337 branch February 13, 2026 19:45
@greptile-apps greptile-apps bot mentioned this pull request Feb 13, 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.

2 participants