Skip to content

Remove external account details quote destination#308

Merged
shreyav merged 1 commit intomainfrom
03-31-remove_external_account_details_quote_destination
Apr 1, 2026
Merged

Remove external account details quote destination#308
shreyav merged 1 commit intomainfrom
03-31-remove_external_account_details_quote_destination

Conversation

@shreyav
Copy link
Copy Markdown
Contributor

@shreyav shreyav commented Mar 31, 2026

No description provided.

@mintlify
Copy link
Copy Markdown

mintlify bot commented Mar 31, 2026

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

Project Status Preview Updated (UTC)
Grid 🟢 Ready View Preview Mar 31, 2026, 5:19 PM

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 31, 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 1, 2026 0:36am

Request Review

Copy link
Copy Markdown
Contributor Author

shreyav commented Mar 31, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 31, 2026

✱ Stainless preview builds

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

kotlin

feat(api): remove external account details destination from quotes and transactions

openapi

feat(types): remove EXTERNAL_ACCOUNT_DETAILS from quote/transaction destinations

python

feat(api): remove external account details destination from quotes/transactions

typescript

fix(types): remove EXTERNAL_ACCOUNT_DETAILS destination from quote/transaction types
grid-openapi studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅

⚠️ grid-python studio · code

Your SDK build had a failure in the lint CI job, which is a regression from the base state.
generate ✅build ✅lint ❗test ✅

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

Your SDK build had a failure in the lint CI job, which is a regression from the base state.
generate ✅build ✅lint ❗test ✅

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

Your SDK build had at least one "note" diagnostic.
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-04-01 15:52:06 UTC

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 31, 2026

Greptile Summary

This PR removes the EXTERNAL_ACCOUNT_DETAILS destination type from the quote API, replacing inline external account creation at quote time with an explicit two-step flow: first register the destination via POST /customers/external-accounts, then reference the returned ID as an ACCOUNT destination in the quote request.

Key changes:

  • Deletes ExternalAccountDetailsDestination.yaml and ExternalAccountDetailsTransactionDestination.yaml source schemas and removes the EXTERNAL_ACCOUNT_DETAILS variant from DestinationType, TransactionDestinationType, QuoteDestinationOneOf, and TransactionDestinationOneOf.
  • Regenerates both bundled openapi.yaml and mintlify/openapi.yaml to reflect the schema removal.
  • Updates all documentation guides (ramps quickstart, rewards quickstart, sandbox testing, fiat-crypto-conversion, self-custody-wallets, external-accounts, distributing-rewards, and the quote-system core-concept page) to demonstrate the new two-step flow with consistent example IDs.
  • Removes the externalAccountDetails tip from mintlify/snippets/sandbox-quote-patterns.mdx.
  • Updates internal AI context files (.claude/skills/grid-api/references/endpoints.md, components/grid-visualizer/CLAUDE.md).

One issue found: .stainless/stainless.yml was not updated and still contains active remove transform commands targeting the now-deleted schemas, which could break Stainless SDK generation. Additionally, the payouts sandbox testing guide's new AccountDestination example includes a currency field that is not part of the schema.

Confidence Score: 4/5

  • Safe to merge after fixing the stale stainless.yml references to deleted schemas, which could break SDK generation.
  • The OpenAPI schema changes and documentation updates are thorough and consistent — no externalAccountDetails or EXTERNAL_ACCOUNT_DETAILS references remain anywhere in the openapi/ or mintlify/ directories. However, .stainless/stainless.yml (not in the PR changeset) still has two active transform rules targeting the now-deleted schemas, which is a P1 risk to the SDK generation pipeline. The payouts sandbox guide also has a minor stray currency field (P2). All prior review concerns have been addressed.
  • .stainless/stainless.yml — lines 624 and 648 reference deleted schemas and need cleanup. mintlify/payouts-and-b2b/platform-tools/sandbox-testing.mdx — stray currency field in AccountDestination example.

Important Files Changed

Filename Overview
openapi/components/schemas/quotes/QuoteDestinationOneOf.yaml Removes ExternalAccountDetailsDestination from the oneOf list and discriminator mapping, leaving only ACCOUNT and UMA_ADDRESS as valid destination types.
openapi/paths/quotes/quotes.yaml Updates realTimeFundingToSparkWallet example from EXTERNAL_ACCOUNT_DETAILS inline to ACCOUNT with a pre-registered ExternalAccount ID.
.stainless/stainless.yml Not updated in this PR — still contains two active remove transform targets referencing the now-deleted ExternalAccountDetailsDestination and ExternalAccountDetailsTransactionDestination schemas, which could break Stainless SDK generation.
mintlify/ramps/quickstart.mdx Adds a new "Step 2: Create an External Account" with full request/response example before the quote creation step; all step numbers correctly incremented.
mintlify/rewards/quickstart.mdx Adds Step 4 to register the destination Spark wallet as an external account (with customerId now correctly included); quote step updated to use AccountDestination by ID.
mintlify/payouts-and-b2b/platform-tools/sandbox-testing.mdx Updated sandbox quote testing to use two-step flow; the new AccountDestination example incorrectly retains "currency": "EUR" which is not a defined field in the schema.

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant API as Grid API

    Note over Dev,API: Old flow (EXTERNAL_ACCOUNT_DETAILS — removed)
    Dev->>API: POST /quotes { destination: { destinationType: EXTERNAL_ACCOUNT_DETAILS, externalAccountDetails: {...} } }
    API-->>Dev: Quote created (external account auto-created internally)

    Note over Dev,API: New flow (two-step, ACCOUNT reference)
    Dev->>API: POST /customers/external-accounts { customerId, currency, accountInfo }
    API-->>Dev: { id: "ExternalAccount:...", status: "ACTIVE", ... }
    Dev->>API: POST /quotes { destination: { destinationType: ACCOUNT, accountId: "ExternalAccount:..." } }
    API-->>Dev: Quote created (references pre-registered external account)
Loading

Comments Outside Diff (1)

  1. .stainless/stainless.yml, line 621-648 (link)

    P1 Stale references to deleted schemas

    ExternalAccountDetailsDestination and ExternalAccountDetailsTransactionDestination have been removed from the OpenAPI spec in this PR, but stainless.yml still references both schemas in its transform pipeline (lines 624 and 648). When Stainless processes the spec, it will attempt to apply remove commands to schema paths that no longer exist, which may cause SDK generation to fail.

    These two entries should be removed from their respective target lists:

        # ── Remove $ref to BaseDestination from destination variants ──
        - command: remove
          reason: >-
            Remove allOf $ref to BaseDestination from destination variants
            because the base schema becomes an empty object after stripping destinationType
          args:
            target:
              - "$.components.schemas.AccountDestination.allOf[0]"
              - "$.components.schemas.UmaAddressDestination.allOf[0]"
              # Remove the ExternalAccountDetailsDestination line
    
        # ── Remove $ref to BaseTransactionDestination from transaction destination variants ──
        - command: remove
          reason: >-
            Remove allOf $ref to BaseTransactionDestination from transaction destination
            variants because the base schema becomes an empty object after stripping destinationType
          args:
            target:
              - "$.components.schemas.AccountTransactionDestination.allOf[0]"
              - "$.components.schemas.UmaAddressTransactionDestination.allOf[0]"
              # Remove the ExternalAccountDetailsTransactionDestination line

    Note: the commented-out reference at line 471 (# "$.components.schemas.ExternalAccountDetailsDestination.allOf[1].properties") is already inactive but can also be removed for cleanliness.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: .stainless/stainless.yml
    Line: 621-648
    
    Comment:
    **Stale references to deleted schemas**
    
    `ExternalAccountDetailsDestination` and `ExternalAccountDetailsTransactionDestination` have been removed from the OpenAPI spec in this PR, but `stainless.yml` still references both schemas in its transform pipeline (lines 624 and 648). When Stainless processes the spec, it will attempt to apply `remove` commands to schema paths that no longer exist, which may cause SDK generation to fail.
    
    These two entries should be removed from their respective `target` lists:
    
    ```yaml
        # ── Remove $ref to BaseDestination from destination variants ──
        - command: remove
          reason: >-
            Remove allOf $ref to BaseDestination from destination variants
            because the base schema becomes an empty object after stripping destinationType
          args:
            target:
              - "$.components.schemas.AccountDestination.allOf[0]"
              - "$.components.schemas.UmaAddressDestination.allOf[0]"
              # Remove the ExternalAccountDetailsDestination line
    
        # ── Remove $ref to BaseTransactionDestination from transaction destination variants ──
        - command: remove
          reason: >-
            Remove allOf $ref to BaseTransactionDestination from transaction destination
            variants because the base schema becomes an empty object after stripping destinationType
          args:
            target:
              - "$.components.schemas.AccountTransactionDestination.allOf[0]"
              - "$.components.schemas.UmaAddressTransactionDestination.allOf[0]"
              # Remove the ExternalAccountDetailsTransactionDestination line
    ```
    
    Note: the commented-out reference at line 471 (`# "$.components.schemas.ExternalAccountDetailsDestination.allOf[1].properties"`) is already inactive but can also be removed for cleanliness.
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: .stainless/stainless.yml
Line: 621-648

Comment:
**Stale references to deleted schemas**

`ExternalAccountDetailsDestination` and `ExternalAccountDetailsTransactionDestination` have been removed from the OpenAPI spec in this PR, but `stainless.yml` still references both schemas in its transform pipeline (lines 624 and 648). When Stainless processes the spec, it will attempt to apply `remove` commands to schema paths that no longer exist, which may cause SDK generation to fail.

These two entries should be removed from their respective `target` lists:

```yaml
    # ── Remove $ref to BaseDestination from destination variants ──
    - command: remove
      reason: >-
        Remove allOf $ref to BaseDestination from destination variants
        because the base schema becomes an empty object after stripping destinationType
      args:
        target:
          - "$.components.schemas.AccountDestination.allOf[0]"
          - "$.components.schemas.UmaAddressDestination.allOf[0]"
          # Remove the ExternalAccountDetailsDestination line

    # ── Remove $ref to BaseTransactionDestination from transaction destination variants ──
    - command: remove
      reason: >-
        Remove allOf $ref to BaseTransactionDestination from transaction destination
        variants because the base schema becomes an empty object after stripping destinationType
      args:
        target:
          - "$.components.schemas.AccountTransactionDestination.allOf[0]"
          - "$.components.schemas.UmaAddressTransactionDestination.allOf[0]"
          # Remove the ExternalAccountDetailsTransactionDestination line
```

Note: the commented-out reference at line 471 (`# "$.components.schemas.ExternalAccountDetailsDestination.allOf[1].properties"`) is already inactive but can also be removed for cleanliness.

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

---

This is a comment left during a code review.
Path: mintlify/payouts-and-b2b/platform-tools/sandbox-testing.mdx
Line: 140-144

Comment:
**Stray `currency` field in `AccountDestination` example**

The `"currency": "EUR"` field appears to have been carried over from the old `externalAccountDetails` structure, where currency was a required field for the inline account creation payload. However, the `AccountDestination` schema (`openapi/components/schemas/quotes/AccountDestination.yaml`) does not define a `currency` property — the destination's currency is already captured on the external account itself at creation time.

All other `AccountDestination` examples in this PR (ramps quickstart, rewards quickstart, fiat-crypto-conversion, etc.) correctly omit `currency`. Consider removing it here for consistency and to avoid misleading developers:

```suggestion
  "destination": {
    "destinationType": "ACCOUNT",
    "accountId": "ExternalAccount:..."
  },
```

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

Reviews (2): Last reviewed commit: "Remove external account details quote de..." | Re-trigger Greptile

Comment on lines +183 to +193
```bash
curl -X POST "https://api.lightspark.com/grid/2025-10-13/customers/external-accounts" \
-H "Authorization: Basic $GRID_CLIENT_ID:$GRID_CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{
"currency": "BTC",
"accountInfo": {
"accountType": "SPARK_WALLET",
"address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu"
}
}'
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 customerId in external account creation

The customerId field is absent from the external account creation request here. Per the ExternalAccountCreateRequest schema, when customerId is omitted the account is created on behalf of the platform rather than the customer. This contradicts the section heading ("Register the customer's Spark wallet") and is inconsistent with every other external account creation example added in this PR — the rewards sandbox guide, the distributing-rewards developer guide, and the ramps quickstart all pass customerId.

Consider adding "customerId": "Customer:..." to the request body so that the external account is correctly associated with the customer, matching the intent of the rewards quickstart and keeping all examples consistent.

Prompt To Fix With AI
This is a comment left during a code review.
Path: mintlify/rewards/quickstart.mdx
Line: 183-193

Comment:
**Missing `customerId` in external account creation**

The `customerId` field is absent from the external account creation request here. Per the `ExternalAccountCreateRequest` schema, when `customerId` is omitted the account is created on behalf of the platform rather than the customer. This contradicts the section heading ("Register the customer's Spark wallet") and is inconsistent with every other external account creation example added in this PR — the rewards sandbox guide, the distributing-rewards developer guide, and the ramps quickstart all pass `customerId`.

Consider adding `"customerId": "Customer:..."` to the request body so that the external account is correctly associated with the customer, matching the intent of the rewards quickstart and keeping all examples consistent.

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

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.

this is right

@shreyav shreyav force-pushed the 03-31-remove_external_account_details_quote_destination branch from 4e28c05 to 40844c0 Compare April 1, 2026 00:36
@shreyav shreyav merged commit fb3a40d into main Apr 1, 2026
11 checks passed
@shreyav shreyav deleted the 03-31-remove_external_account_details_quote_destination branch April 1, 2026 15:45
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