From 40844c05c7949a85ef6d41a70f41bae23b86864f Mon Sep 17 00:00:00 2001 From: shreyav Date: Tue, 31 Mar 2026 10:09:57 -0700 Subject: [PATCH] Remove external account details quote destination --- .../skills/grid-api/references/endpoints.md | 1 - components/grid-visualizer/CLAUDE.md | 2 +- mintlify/openapi.yaml | 47 +------ .../platform-tools/sandbox-testing.mdx | 37 +++-- .../core-concepts/quote-system.mdx | 32 ----- mintlify/ramps/accounts/external-accounts.mdx | 34 ----- .../fiat-crypto-conversion.mdx | 108 +++++---------- .../conversion-flows/self-custody-wallets.mdx | 62 ++++----- .../ramps/platform-tools/sandbox-testing.mdx | 48 ++++--- mintlify/ramps/quickstart.mdx | 79 +++++++---- .../developer-guides/distributing-rewards.mdx | 53 +++---- .../platform-tools/sandbox-testing.mdx | 130 +++++++++--------- mintlify/rewards/quickstart.mdx | 65 ++++++--- mintlify/snippets/sandbox-quote-patterns.mdx | 2 - openapi.yaml | 47 +------ .../schemas/quotes/DestinationType.yaml | 1 - .../ExternalAccountDetailsDestination.yaml | 19 --- .../schemas/quotes/QuoteDestinationOneOf.yaml | 2 - ...lAccountDetailsTransactionDestination.yaml | 17 --- .../TransactionDestinationOneOf.yaml | 2 - .../TransactionDestinationType.yaml | 1 - openapi/paths/quotes/quotes.yaml | 9 +- 22 files changed, 308 insertions(+), 490 deletions(-) delete mode 100644 openapi/components/schemas/quotes/ExternalAccountDetailsDestination.yaml delete mode 100644 openapi/components/schemas/transactions/ExternalAccountDetailsTransactionDestination.yaml diff --git a/.claude/skills/grid-api/references/endpoints.md b/.claude/skills/grid-api/references/endpoints.md index 3dfa9e9f..da3ca698 100644 --- a/.claude/skills/grid-api/references/endpoints.md +++ b/.claude/skills/grid-api/references/endpoints.md @@ -87,7 +87,6 @@ Internal accounts are auto-created when customers are created based on platform - `ACCOUNT`: External or internal account. Fields: `accountId`, `currency` - `UMA_ADDRESS`: UMA address. Fields: `umaAddress`, `currency` -- `EXTERNAL_ACCOUNT_DETAILS`: Inline account creation (creates external account + quote in one step). Fields: `externalAccountDetails` (same shape as external account create request) ### Quote Request Fields diff --git a/components/grid-visualizer/CLAUDE.md b/components/grid-visualizer/CLAUDE.md index f4cfd5f2..1204c33e 100644 --- a/components/grid-visualizer/CLAUDE.md +++ b/components/grid-visualizer/CLAUDE.md @@ -214,7 +214,7 @@ Stablecoins: `SOLANA_WALLET` (USDC), `TRON_WALLET` (USDT), `POLYGON_WALLET` (USD ```json { "source": { "sourceType": "ACCOUNT" | "REALTIME_FUNDING", ... }, - "destination": { "destinationType": "ACCOUNT" | "EXTERNAL_ACCOUNT_DETAILS" | "UMA_ADDRESS", ... }, + "destination": { "destinationType": "ACCOUNT" | "UMA_ADDRESS", ... }, "lockedCurrencySide": "SENDING" | "RECEIVING", "lockedCurrencyAmount": 10000 } diff --git a/mintlify/openapi.yaml b/mintlify/openapi.yaml index 89bb2e85..d78dd6af 100644 --- a/mintlify/openapi.yaml +++ b/mintlify/openapi.yaml @@ -2273,13 +2273,8 @@ paths: customerId: Customer:019542f5-b3e7-1d02-0000-000000000009 currency: USD destination: - destinationType: EXTERNAL_ACCOUNT_DETAILS - externalAccountDetails: - customerId: Customer:019542f5-b3e7-1d02-0000-000000000001 - currency: BTC - accountInfo: - accountType: SPARK_WALLET - address: spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu + destinationType: ACCOUNT + accountId: ExternalAccount:b23dcbd6-dced-4ec4-b756-3c3a9ea3d456 lockedCurrencySide: RECEIVING lockedCurrencyAmount: 10000 immediatelyExecute: true @@ -10232,7 +10227,6 @@ components: enum: - ACCOUNT - UMA_ADDRESS - - EXTERNAL_ACCOUNT_DETAILS description: Type of transaction destination example: ACCOUNT BaseTransactionDestination: @@ -10282,33 +10276,15 @@ components: description: UMA address of the recipient example: $receiver@uma.domain.com description: UMA address destination details - ExternalAccountDetailsTransactionDestination: - title: External Account Details Destination - allOf: - - $ref: '#/components/schemas/BaseTransactionDestination' - - type: object - required: - - externalAccountDetails - - destinationType - properties: - destinationType: - type: string - enum: - - EXTERNAL_ACCOUNT_DETAILS - externalAccountDetails: - $ref: '#/components/schemas/ExternalAccountCreateRequest' - description: Transaction destination where external account details were provided inline at quote creation rather than using a pre-registered external account. TransactionDestinationOneOf: oneOf: - $ref: '#/components/schemas/AccountTransactionDestination' - $ref: '#/components/schemas/UmaAddressTransactionDestination' - - $ref: '#/components/schemas/ExternalAccountDetailsTransactionDestination' discriminator: propertyName: destinationType mapping: ACCOUNT: '#/components/schemas/AccountTransactionDestination' UMA_ADDRESS: '#/components/schemas/UmaAddressTransactionDestination' - EXTERNAL_ACCOUNT_DETAILS: '#/components/schemas/ExternalAccountDetailsTransactionDestination' CounterpartyInformation: type: object description: Additional information about the counterparty, if available and relevant to the transaction and platform. @@ -10924,7 +10900,6 @@ components: enum: - ACCOUNT - UMA_ADDRESS - - EXTERNAL_ACCOUNT_DETAILS description: Type of payment destination example: ACCOUNT BaseDestination: @@ -10978,33 +10953,15 @@ components: description: Currency code for the destination. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. example: EUR description: UMA address destination details - ExternalAccountDetailsDestination: - title: External Account Details - allOf: - - $ref: '#/components/schemas/BaseDestination' - - type: object - required: - - externalAccountDetails - - destinationType - properties: - destinationType: - type: string - enum: - - EXTERNAL_ACCOUNT_DETAILS - externalAccountDetails: - $ref: '#/components/schemas/ExternalAccountCreateRequest' - description: A convenient destination option which adds the external account and creates the quote in one step rather than first needing to call /external-accounts to add the account. Useful for one-off payments to some destination. See the Sandbox Testing guide in the API reference for test values. QuoteDestinationOneOf: oneOf: - $ref: '#/components/schemas/AccountDestination' - $ref: '#/components/schemas/UmaAddressDestination' - - $ref: '#/components/schemas/ExternalAccountDetailsDestination' discriminator: propertyName: destinationType mapping: ACCOUNT: '#/components/schemas/AccountDestination' UMA_ADDRESS: '#/components/schemas/UmaAddressDestination' - EXTERNAL_ACCOUNT_DETAILS: '#/components/schemas/ExternalAccountDetailsDestination' Quote: type: object required: diff --git a/mintlify/payouts-and-b2b/platform-tools/sandbox-testing.mdx b/mintlify/payouts-and-b2b/platform-tools/sandbox-testing.mdx index 2ac7da1e..7e92fb2c 100644 --- a/mintlify/payouts-and-b2b/platform-tools/sandbox-testing.mdx +++ b/mintlify/payouts-and-b2b/platform-tools/sandbox-testing.mdx @@ -110,9 +110,26 @@ The transfer will instantly simulate the bank transfer process and complete with ### Creating Quotes with Test Accounts -When creating quotes with the `externalAccountDetails` destination type, you can provide test account patterns inline: +When creating quotes with test external accounts, first create an external account with a test account pattern, then reference it in the quote: ```bash +# Step 1: Create the external account with a test pattern +POST /customers/external-accounts + +{ + "customerId": "Customer:123", + "currency": "EUR", + "accountInfo": { + "accountType": "IBAN_ACCOUNT", + "iban": "DE89370400440532013003", + "beneficiary": { + "beneficiaryType": "INDIVIDUAL", + "fullName": "Test User" + } + } +} + +# Step 2: Create the quote using the external account ID POST /quotes { @@ -121,25 +138,17 @@ POST /quotes "accountId": "InternalAccount:abc123" }, "destination": { - "destinationType": "EXTERNAL_ACCOUNT_DETAILS", - "externalAccountDetails": { - "customerId": "Customer:123", - "currency": "EUR", - "accountInfo": { - "accountType": "IBAN_ACCOUNT", - "iban": "DE89370400440532013003", // Ends in 003 = slow payment - "beneficiary": { - "beneficiaryType": "INDIVIDUAL", - "fullName": "Test User" - } - } - } + "destinationType": "ACCOUNT", + "accountId": "ExternalAccount:...", + "currency": "EUR" }, "lockedCurrencySide": "SENDING", "lockedCurrencyAmount": 100000 } ``` +The IBAN ending in `003` triggers the slow payment test pattern. + ### Executing Quotes in Sandbox For quotes from an external account source, execute as in production via `/quotes/{quoteId}/execute`. The sandbox will: diff --git a/mintlify/platform-overview/core-concepts/quote-system.mdx b/mintlify/platform-overview/core-concepts/quote-system.mdx index e341c5f7..00459f82 100644 --- a/mintlify/platform-overview/core-concepts/quote-system.mdx +++ b/mintlify/platform-overview/core-concepts/quote-system.mdx @@ -306,38 +306,6 @@ curl -X POST https://api.lightspark.com/grid/2025-10-13/quotes \ Customer doesn't see rate before execution. If you want to lock a quote and confirm fees and exchange rate details before executing the quote, set `immediatelyExecute` to `false` or omit the field. -## Creating External Accounts in Quotes - -You can create an external account inline when creating a quote: - -```json -{ - "source": { - "sourceType": "ACCOUNT", - "accountId": "InternalAccount:abc123" - }, - "destination": { - "destinationType": "EXTERNAL_ACCOUNT_DETAILS", - "externalAccountDetails": { - "customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001", - "currency": "EUR", - "accountInfo": { - "accountType": "IBAN_ACCOUNT", - "iban": "DE89370400440532013000", - "beneficiary": { - "beneficiaryType": "INDIVIDUAL", - "fullName": "Alice Smith" - } - } - } - }, - "lockedCurrencySide": "SENDING", - "lockedCurrencyAmount": 100000 -} -``` - -This is useful for one-time recipients or when you don't want to manage external accounts separately. - ## Fees All fees are transparently displayed in the quote response: diff --git a/mintlify/ramps/accounts/external-accounts.mdx b/mintlify/ramps/accounts/external-accounts.mdx index 688e4b43..575ed8cd 100644 --- a/mintlify/ramps/accounts/external-accounts.mdx +++ b/mintlify/ramps/accounts/external-accounts.mdx @@ -152,40 +152,6 @@ curl -X POST 'https://api.lightspark.com/grid/2025-10-13/customers/external-acco }' ``` -## Creating accounts inline with quotes - -For one-time conversions, create external accounts inline using `externalAccountDetails`: - -```bash -curl -X POST 'https://api.lightspark.com/grid/2025-10-13/quotes' \ - -H 'Authorization: Basic $GRID_CLIENT_ID:$GRID_CLIENT_SECRET' \ - -H 'Content-Type: application/json' \ - -d '{ - "source": { - "customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001", - "currency": "USD" - }, - "destination": { - "externalAccountDetails": { - "customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001", - "currency": "BTC", - "accountInfo": { - "accountType": "SPARK_WALLET", - "address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu" - } - } - }, - "lockedCurrencySide": "SENDING", - "lockedCurrencyAmount": 10000 - }' -``` - - - Use `externalAccountDetails` for one-time destinations. The external account - will be automatically created and can be reused for future quotes using its - returned ID. - - ## Listing external accounts ### List customer external accounts diff --git a/mintlify/ramps/conversion-flows/fiat-crypto-conversion.mdx b/mintlify/ramps/conversion-flows/fiat-crypto-conversion.mdx index 7f79c1ec..c311973a 100644 --- a/mintlify/ramps/conversion-flows/fiat-crypto-conversion.mdx +++ b/mintlify/ramps/conversion-flows/fiat-crypto-conversion.mdx @@ -25,7 +25,24 @@ Grid enables seamless conversion between fiat currencies and cryptocurrencies vi ### Create a quote - +First, create an external account for the crypto destination: + +```bash cURL +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 '{ + "customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001", + "currency": "BTC", + "accountInfo": { + "accountType": "SPARK_WALLET", + "address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu" + } + }' +``` + +Then create a quote using the external account ID: + ```bash cURL curl -X POST 'https://api.lightspark.com/grid/2025-10-13/quotes' \ -H 'Authorization: Basic $GRID_CLIENT_ID:$GRID_CLIENT_SECRET' \ @@ -36,19 +53,8 @@ curl -X POST 'https://api.lightspark.com/grid/2025-10-13/quotes' \ "currency": "USD" }, "destination": { - "externalAccountDetails": { - "customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001", - "currency": "BTC", - "beneficiary": { - "counterPartyType": "INDIVIDUAL", - "fullName": "John Doe", - "email": "john@example.com" - }, - "accountInfo": { - "accountType": "SPARK_WALLET", - "address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu" - } - } + "destinationType": "ACCOUNT", + "accountId": "ExternalAccount:b23dcbd6-dced-4ec4-b756-3c3a9ea3d456" }, "lockedCurrencySide": "RECEIVING", "lockedCurrencyAmount": 100000, @@ -56,43 +62,6 @@ curl -X POST 'https://api.lightspark.com/grid/2025-10-13/quotes' \ }' ``` -```javascript Node.js -const quote = await fetch("https://api.lightspark.com/grid/2025-10-13/quotes", { - method: "POST", - headers: { - Authorization: `Basic ${credentials}`, - "Content-Type": "application/json", - }, - body: JSON.stringify({ - source: { - customerId: "Customer:019542f5-b3e7-1d02-0000-000000000001", - currency: "USD", - }, - destination: { - externalAccountDetails: { - customerId: "Customer:019542f5-b3e7-1d02-0000-000000000001", - currency: "BTC", - beneficiary: { - counterPartyType: "INDIVIDUAL", - fullName: "John Doe", - email: "john@example.com", - }, - accountInfo: { - accountType: "SPARK_WALLET", - address: - "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu", - }, - }, - }, - lockedCurrencySide: "RECEIVING", - lockedCurrencyAmount: 100000, // 0.001 BTC in satoshis - description: "Buy 0.001 BTC", - }), -}).then((r) => r.json()); -``` - - - **Response includes payment instructions:** ```json @@ -212,30 +181,23 @@ app.post("/webhooks/grid", async (req, res) => { For instant on-ramps (e.g., reward payouts), use `immediatelyExecute: true` with an internal account source: -```javascript -const quote = await fetch("https://api.lightspark.com/grid/2025-10-13/quotes", { - method: "POST", - body: JSON.stringify({ - source: { - sourceType: "ACCOUNT", - accountId: "InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123", +```bash cURL +curl -X POST 'https://api.lightspark.com/grid/2025-10-13/quotes' \ + -H 'Authorization: Basic $GRID_CLIENT_ID:$GRID_CLIENT_SECRET' \ + -H 'Content-Type: application/json' \ + -d '{ + "source": { + "sourceType": "ACCOUNT", + "accountId": "InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123" }, - destination: { - destinationType: "EXTERNAL_ACCOUNT_DETAILS", - externalAccountDetails: { - customerId: "Customer:...", - currency: "BTC", - accountInfo: { - accountType: "SPARK_WALLET", - address: "spark1...", - }, - }, + "destination": { + "destinationType": "ACCOUNT", + "accountId": "ExternalAccount:b23dcbd6-dced-4ec4-b756-3c3a9ea3d456" }, - lockedCurrencySide: "RECEIVING", - lockedCurrencyAmount: 100000, - immediatelyExecute: true, - }), -}).then((r) => r.json()); + "lockedCurrencySide": "RECEIVING", + "lockedCurrencyAmount": 100000, + "immediatelyExecute": true + }' ``` diff --git a/mintlify/ramps/conversion-flows/self-custody-wallets.mdx b/mintlify/ramps/conversion-flows/self-custody-wallets.mdx index 7f61fa72..86dee6a3 100644 --- a/mintlify/ramps/conversion-flows/self-custody-wallets.mdx +++ b/mintlify/ramps/conversion-flows/self-custody-wallets.mdx @@ -366,40 +366,36 @@ async function handleTransferFailure(transaction) { Test self-custody wallet flows in sandbox mode: -```javascript -// Sandbox: Use test Spark addresses -const testSparkAddress = - "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu"; - -// Create test transfer -const testTransfer = await fetch( - "https://api.lightspark.com/grid/2025-10-13/quotes", - { - method: "POST", - body: JSON.stringify({ - source: { accountId: "InternalAccount:..." }, - destination: { - externalAccountDetails: { - customerId: "Customer:...", - currency: "BTC", - beneficiary: { - /* test data */ - }, - accountInfo: { - accountType: "SPARK_WALLET", - address: testSparkAddress, - }, - }, - }, - lockedCurrencySide: "SENDING", - lockedCurrencyAmount: 10000, - immediatelyExecute: true, - }), - } -).then((r) => r.json()); +```bash +# Step 1: Create the external account for the Spark wallet +curl -X POST 'https://api.lightspark.com/grid/2025-10-13/customers/external-accounts' \ + -u "$GRID_CLIENT_ID:$GRID_CLIENT_SECRET" \ + -H 'Content-Type: application/json' \ + -d '{ + "customerId": "Customer:...", + "currency": "BTC", + "accountInfo": { + "accountType": "SPARK_WALLET", + "address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu" + } + }' -// Simulate completion (sandbox auto-completes) -console.log("Test transfer status:", testTransfer.status); +# Step 2: Create and execute the quote +curl -X POST 'https://api.lightspark.com/grid/2025-10-13/quotes' \ + -u "$GRID_CLIENT_ID:$GRID_CLIENT_SECRET" \ + -H 'Content-Type: application/json' \ + -d '{ + "source": { + "accountId": "InternalAccount:..." + }, + "destination": { + "destinationType": "ACCOUNT", + "accountId": "ExternalAccount:..." + }, + "lockedCurrencySide": "SENDING", + "lockedCurrencyAmount": 10000, + "immediatelyExecute": true + }' ``` diff --git a/mintlify/ramps/platform-tools/sandbox-testing.mdx b/mintlify/ramps/platform-tools/sandbox-testing.mdx index d81220ef..16fff472 100644 --- a/mintlify/ramps/platform-tools/sandbox-testing.mdx +++ b/mintlify/ramps/platform-tools/sandbox-testing.mdx @@ -86,7 +86,23 @@ curl -X POST 'https://api.lightspark.com/grid/2025-10-13/customers' \ In sandbox, customers are automatically approved for testing. -### Step 2: Create an on-ramp quote (just-in-time funding) +### Step 2: Create an external account for the destination wallet + +```bash +curl -X POST 'https://api.lightspark.com/grid/2025-10-13/customers/external-accounts' \ + -u "$GRID_CLIENT_ID:$GRID_CLIENT_SECRET" \ + -H 'Content-Type: application/json' \ + -d '{ + "customerId": "Customer:sandbox001", + "currency": "BTC", + "accountInfo": { + "accountType": "SPARK_WALLET", + "address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu" + } + }' +``` + +### Step 3: Create an on-ramp quote (just-in-time funding) ```bash curl -X POST 'https://api.lightspark.com/grid/2025-10-13/quotes' \ @@ -98,14 +114,8 @@ curl -X POST 'https://api.lightspark.com/grid/2025-10-13/quotes' \ "currency": "USD" }, "destination": { - "externalAccountDetails": { - "customerId": "Customer:sandbox001", - "currency": "BTC", - "accountInfo": { - "accountType": "SPARK_WALLET", - "address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu" - } - } + "destinationType": "ACCOUNT", + "accountId": "ExternalAccount:b23dcbd6-dced-4ec4-b756-3c3a9ea3d456" }, "lockedCurrencySide": "SENDING", "lockedCurrencyAmount": 10000, @@ -115,7 +125,7 @@ curl -X POST 'https://api.lightspark.com/grid/2025-10-13/quotes' \ The quote response includes payment instructions with a reference code. -### Step 3: Simulate funding +### Step 4: Simulate funding Use the sandbox endpoint to simulate receiving the fiat payment: @@ -135,7 +145,7 @@ curl -X POST 'https://api.lightspark.com/grid/2025-10-13/sandbox/send' \ instructions. -### Step 4: Verify completion +### Step 5: Verify completion Within seconds, you'll receive a webhook notification confirming the on-ramp completed: @@ -347,19 +357,15 @@ curl -X POST 'https://api.lightspark.com/grid/2025-10-13/quotes' \ **4. Test invalid wallet address:** ```bash -# Attempt quote with invalid Spark address -curl -X POST 'https://api.lightspark.com/grid/2025-10-13/quotes' \ +# Attempt to create an external account with invalid Spark address +curl -X POST 'https://api.lightspark.com/grid/2025-10-13/customers/external-accounts' \ -u "$GRID_CLIENT_ID:$GRID_CLIENT_SECRET" \ -H 'Content-Type: application/json' \ -d '{ - "destination": { - "externalAccountDetails": { - "currency": "BTC", - "accountInfo": { - "accountType": "SPARK_WALLET", - "address": "invalid_address" - } - } + "currency": "BTC", + "accountInfo": { + "accountType": "SPARK_WALLET", + "address": "invalid_address" } }' # Response: 400 Bad Request with validation error diff --git a/mintlify/ramps/quickstart.mdx b/mintlify/ramps/quickstart.mdx index ba5c5e08..5423fd08 100644 --- a/mintlify/ramps/quickstart.mdx +++ b/mintlify/ramps/quickstart.mdx @@ -35,9 +35,10 @@ Before starting this guide, ensure you have: The on-ramp process consists of the following steps: 1. **Create a customer** via the API -2. **Create a quote** for the USD-to-BTC conversion with current exchange rate -3. **Fund the quote** using the provided payment instructions (JIT funding) -4. **Receive webhook notification** confirming Bitcoin delivery to the Spark wallet +2. **Create an external account** for the destination Spark wallet +3. **Create a quote** for the USD-to-BTC conversion with current exchange rate +4. **Fund the quote** using the provided payment instructions (JIT funding) +5. **Receive webhook notification** confirming Bitcoin delivery to the Spark wallet --- @@ -56,9 +57,48 @@ link flow to onboard your customers. -## Step 2: Create a Quote for Fiat-to-Crypto Conversion +## Step 2: Create an External Account for the Destination Wallet -Create a quote to convert USD to Bitcoin and deliver it to a Spark wallet. The quote will provide the current exchange rate and payment instructions for funding. +Register the customer's Spark wallet as an external account so it can be used as a quote destination. + +### Request + +```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 '{ + "customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001", + "currency": "BTC", + "accountInfo": { + "accountType": "SPARK_WALLET", + "address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu" + } + }' +``` + +### Response + +```json +{ + "id": "ExternalAccount:b23dcbd6-dced-4ec4-b756-3c3a9ea3d456", + "customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001", + "status": "ACTIVE", + "currency": "BTC", + "accountInfo": { + "accountType": "SPARK_WALLET", + "address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu" + } +} +``` + + + External accounts can be reused across multiple quotes. Register once, then reference by ID. + + +## Step 3: Create a Quote for Fiat-to-Crypto Conversion + +Create a quote to convert USD to Bitcoin and deliver it to the Spark wallet. The quote will provide the current exchange rate and payment instructions for funding. ### Request @@ -72,14 +112,8 @@ curl -X POST "https://api.lightspark.com/grid/2025-10-13/quotes" \ "currency": "USD" }, "destination": { - "externalAccountDetails": { - "customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001", - "currency": "BTC", - "accountInfo": { - "accountType": "SPARK_WALLET", - "address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu" - } - } + "destinationType": "ACCOUNT", + "accountId": "ExternalAccount:b23dcbd6-dced-4ec4-b756-3c3a9ea3d456" }, "lockedCurrencySide": "SENDING", "lockedCurrencyAmount": 10000, @@ -87,14 +121,6 @@ curl -X POST "https://api.lightspark.com/grid/2025-10-13/quotes" \ }' ``` - - **Combined External Account Creation**: The `externalAccountDetails` option - automatically creates the external account (Spark wallet) and uses it as the - destination for the Bitcoin transfer in a single API call. If you want to reuse - the same external accounts for many quotes, you can add them using the - `/external-accounts` endpoint, and then use the `accountId` in the quote creation request. - - ### Response ```json @@ -167,7 +193,7 @@ The quote shows: --- -## Step 3: Fund the Quote (Just-in-Time) +## Step 4: Fund the Quote (Just-in-Time) In production, you would initiate a real-time push payment (ACH, RTP, wire, etc.) to the bank account provided in `paymentInstructions`, making sure to include the exact reference code `RAMP-ABC123` in the transfer memo. @@ -211,7 +237,7 @@ In production, your customer or platform would initiate a bank transfer to the p --- -## Step 4: Receive Completion Webhook +## Step 5: Receive Completion Webhook Once Grid receives your payment and completes the USD-to-BTC conversion and delivery, you'll receive a webhook notification: @@ -275,9 +301,10 @@ Once Grid receives your payment and completes the USD-to-BTC conversion and deli You've successfully completed a fiat-to-crypto on-ramp! Here's what happened: 1. ✅ Created a customer via API -2. ✅ Created a quote with exchange rate and payment instructions -3. ✅ Funded the quote using JIT payment (simulated in sandbox) -4. ✅ Bitcoin automatically converted and delivered to Spark wallet +2. ✅ Registered the destination Spark wallet as an external account +3. ✅ Created a quote with exchange rate and payment instructions +4. ✅ Funded the quote using JIT payment (simulated in sandbox) +5. ✅ Bitcoin automatically converted and delivered to Spark wallet ## Next Steps diff --git a/mintlify/rewards/developer-guides/distributing-rewards.mdx b/mintlify/rewards/developer-guides/distributing-rewards.mdx index e880c80f..db272535 100644 --- a/mintlify/rewards/developer-guides/distributing-rewards.mdx +++ b/mintlify/rewards/developer-guides/distributing-rewards.mdx @@ -55,6 +55,24 @@ Response: The core request specifies your platform's internal account as the source and the customer's wallet as the destination. +First, create an external account for the destination wallet: + +```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 '{ + "customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001", + "currency": "BTC", + "accountInfo": { + "accountType": "SPARK_WALLET", + "address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu" + } + }' +``` + +Then create the quote using the external account ID: + ```bash curl -X POST "https://api.lightspark.com/grid/2025-10-13/quotes" \ -H "Authorization: Basic $GRID_CLIENT_ID:$GRID_CLIENT_SECRET" \ @@ -64,14 +82,8 @@ curl -X POST "https://api.lightspark.com/grid/2025-10-13/quotes" \ "accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965" }, "destination": { - "externalAccountDetails": { - "customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001", - "currency": "BTC", - "accountInfo": { - "accountType": "SPARK_WALLET", - "address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu" - } - } + "destinationType": "ACCOUNT", + "accountId": "ExternalAccount:b23dcbd6-dced-4ec4-b756-3c3a9ea3d456" }, "lockedCurrencySide": "SENDING", "lockedCurrencyAmount": 100, @@ -187,30 +199,9 @@ curl -X POST "https://api.lightspark.com/grid/2025-10-13/quotes/{quoteId}/execut ## Destination Options -### Inline External Account Creation - -Use `externalAccountDetails` to create the destination wallet on the fly. This is perfect for one-time or infrequent payouts. - -```json -{ - "destination": { - "externalAccountDetails": { - "customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001", - "currency": "BTC", - "accountInfo": { - "accountType": "SPARK_WALLET", - "address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu" - } - } - } -} -``` - -The external account is created automatically and returned in the quote response. - ### Pre-Registered External Account -If you've already registered the external account, reference it by ID. This is more efficient for recurring rewards to the same wallets. +Create the external account first, then reference it by ID in the quote. First, create the external account: @@ -293,7 +284,7 @@ curl -X GET "https://api.lightspark.com/grid/2025-10-13/transactions/{transactio ```json { "source": { "sourceType": "ACCOUNT", "accountId": "InternalAccount:..." }, - "destination": { "destinationType": "EXTERNAL_ACCOUNT_DETAILS", "externalAccountDetails": { ... } }, + "destination": { "destinationType": "ACCOUNT", "accountId": "ExternalAccount:..." }, "lockedCurrencySide": "SENDING", "lockedCurrencyAmount": 100, "immediatelyExecute": true diff --git a/mintlify/rewards/platform-tools/sandbox-testing.mdx b/mintlify/rewards/platform-tools/sandbox-testing.mdx index 0cb1ee0b..6f6e609e 100644 --- a/mintlify/rewards/platform-tools/sandbox-testing.mdx +++ b/mintlify/rewards/platform-tools/sandbox-testing.mdx @@ -55,9 +55,23 @@ This endpoint returns the updated `InternalAccount` object with the new balance. ### Testing Successful Bitcoin Rewards -The standard reward flow works seamlessly in sandbox. Create and execute a quote to instantly convert USD to BTC and send to a Spark wallet: +The standard reward flow works seamlessly in sandbox. First create the destination external account, then create and execute a quote to instantly convert USD to BTC: ```bash +# Step 1: Create the destination external account +curl -X POST "https://api.lightspark.com/grid/2025-10-13/customers/external-accounts" \ + -u "sandbox_token_id:sandbox_token_secret" \ + -H "Content-Type: application/json" \ + -d '{ + "customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001", + "currency": "BTC", + "accountInfo": { + "accountType": "SPARK_WALLET", + "address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu" + } + }' + +# Step 2: Create and execute the quote curl -X POST "https://api.lightspark.com/grid/2025-10-13/quotes" \ -u "sandbox_token_id:sandbox_token_secret" \ -H "Content-Type: application/json" \ @@ -66,14 +80,8 @@ curl -X POST "https://api.lightspark.com/grid/2025-10-13/quotes" \ "accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965" }, "destination": { - "externalAccountDetails": { - "customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001", - "currency": "BTC", - "accountInfo": { - "accountType": "SPARK_WALLET", - "address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu" - } - } + "destinationType": "ACCOUNT", + "accountId": "ExternalAccount:b23dcbd6-dced-4ec4-b756-3c3a9ea3d456" }, "lockedCurrencySide": "SENDING", "lockedCurrencyAmount": 100, @@ -105,6 +113,20 @@ Use special Spark wallet address patterns to test different failure scenarios. T **Example - Testing Wallet Unavailable:** ```bash +# Create an external account with a test address ending in 003 +curl -X POST "https://api.lightspark.com/grid/2025-10-13/customers/external-accounts" \ + -u "sandbox_token_id:sandbox_token_secret" \ + -H "Content-Type: application/json" \ + -d '{ + "customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001", + "currency": "BTC", + "accountInfo": { + "accountType": "SPARK_WALLET", + "address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6m003" + } + }' + +# Then use it in a quote curl -X POST "https://api.lightspark.com/grid/2025-10-13/quotes" \ -u "sandbox_token_id:sandbox_token_secret" \ -H "Content-Type: application/json" \ @@ -113,14 +135,8 @@ curl -X POST "https://api.lightspark.com/grid/2025-10-13/quotes" \ "accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965" }, "destination": { - "externalAccountDetails": { - "customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001", - "currency": "BTC", - "accountInfo": { - "accountType": "SPARK_WALLET", - "address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6m003" - } - } + "destinationType": "ACCOUNT", + "accountId": "ExternalAccount:..." }, "lockedCurrencySide": "SENDING", "lockedCurrencyAmount": 100, @@ -172,14 +188,8 @@ curl -X POST "https://api.lightspark.com/grid/2025-10-13/quotes" \ "accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965" }, "destination": { - "externalAccountDetails": { - "customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001", - "currency": "BTC", - "accountInfo": { - "accountType": "SPARK_WALLET", - "address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu" - } - } + "destinationType": "ACCOUNT", + "accountId": "ExternalAccount:b23dcbd6-dced-4ec4-b756-3c3a9ea3d456" }, "lockedCurrencySide": "SENDING", "lockedCurrencyAmount": 300000, @@ -242,72 +252,68 @@ Here's a complete test workflow for distributing a $1.00 Bitcoin reward: ### Testing Error Scenarios -Test each failure mode systematically: +Test each failure mode systematically. First create external accounts with test address patterns, then use them in quotes: ```bash -# 1. Test wallet unavailable (003) +# 1. Test wallet unavailable (address ending in 003) +# Create external account with test address +curl -X POST "https://api.lightspark.com/grid/2025-10-13/customers/external-accounts" \ + -u "sandbox_token_id:sandbox_token_secret" \ + -H "Content-Type: application/json" \ + -d '{ + "customerId": "Customer:test001", + "currency": "BTC", + "accountInfo": { + "accountType": "SPARK_WALLET", + "address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6m003" + } + }' +# Use the returned ExternalAccount ID in the quote curl -X POST "https://api.lightspark.com/grid/2025-10-13/quotes" \ -u "sandbox_token_id:sandbox_token_secret" \ -H "Content-Type: application/json" \ -d '{ "source": {"sourceType": "ACCOUNT", "accountId": "InternalAccount:platform-usd"}, - "destination": { - "destinationType": "EXTERNAL_ACCOUNT_DETAILS", - "externalAccountDetails": { - "customerId": "Customer:test001", - "currency": "BTC", - "accountInfo": { - "accountType": "SPARK_WALLET", - "address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6m003" # Wallet unavailable *003 - } - } - }, + "destination": {"destinationType": "ACCOUNT", "accountId": "ExternalAccount:..."}, "lockedCurrencySide": "SENDING", "lockedCurrencyAmount": 100, "immediatelyExecute": true }' # Response: Transaction fails with wallet unavailable error -# 2. Test insufficient balance +# 2. Test insufficient balance (use any valid external account) curl -X POST "https://api.lightspark.com/grid/2025-10-13/quotes" \ -u "sandbox_token_id:sandbox_token_secret" \ -H "Content-Type: application/json" \ -d '{ "source": {"sourceType": "ACCOUNT", "accountId": "InternalAccount:platform-usd"}, - "destination": { - "destinationType": "EXTERNAL_ACCOUNT_DETAILS", - "externalAccountDetails": { - "customerId": "Customer:test001", - "currency": "BTC", - "accountInfo": { - "accountType": "SPARK_WALLET", - "address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu" - } - } - }, + "destination": {"destinationType": "ACCOUNT", "accountId": "ExternalAccount:..."}, "lockedCurrencySide": "SENDING", "lockedCurrencyAmount": 10000000, "immediatelyExecute": true }' # Response: 400 Bad Request with insufficient balance error -# 3. Test timeout scenario (005) +# 3. Test timeout scenario (address ending in 005) +# Create external account with test address +curl -X POST "https://api.lightspark.com/grid/2025-10-13/customers/external-accounts" \ + -u "sandbox_token_id:sandbox_token_secret" \ + -H "Content-Type: application/json" \ + -d '{ + "customerId": "Customer:test001", + "currency": "BTC", + "accountInfo": { + "accountType": "SPARK_WALLET", + "address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6m005" + } + }' +# Use the returned ExternalAccount ID in the quote curl -X POST "https://api.lightspark.com/grid/2025-10-13/quotes" \ -u "sandbox_token_id:sandbox_token_secret" \ -H "Content-Type: application/json" \ -d '{ "source": {"sourceType": "ACCOUNT", "accountId": "InternalAccount:platform-usd"}, - "destination": { - "destinationType": "EXTERNAL_ACCOUNT_DETAILS", - "externalAccountDetails": { - "customerId": "Customer:test001", - "currency": "BTC", - "accountInfo": { - "accountType": "SPARK_WALLET", - "address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6m005" # Timeout/delayed failure *005 - } - } - }, + "destination": {"destinationType": "ACCOUNT", "accountId": "ExternalAccount:..."}, "lockedCurrencySide": "SENDING", "lockedCurrencyAmount": 100, "immediatelyExecute": true diff --git a/mintlify/rewards/quickstart.mdx b/mintlify/rewards/quickstart.mdx index 55060159..b874bfd6 100644 --- a/mintlify/rewards/quickstart.mdx +++ b/mintlify/rewards/quickstart.mdx @@ -50,7 +50,8 @@ The process consists of the following steps: 1. **List platform internal accounts** to find your platform's USD funding instructions 2. **Fund your internal account** via ACH push and receive a webhook notification 3. **Generate a spark wallet** for your customer, or let them connect their own -4. **Execute a quote** to complete the Bitcoin purchase and transfer a reward to the user's own Spark wallet. +4. **Register the destination wallet** as an external account +5. **Execute a quote** to complete the Bitcoin purchase and transfer a reward to the user's own Spark wallet. ## Step 1: List your platform's internal accounts @@ -173,10 +174,44 @@ For rewards, the only entity who needs to be KYB'd is the entity paying for the All you need in order to pay out a reward is the wallet address. No need to go through the full hosted KYC flow for this use case! To generate a spark wallet, you can use a tool like [Privy](https://privy.io) or the Spark SDK directly. -## Step 4: Create and Execute a Quote to the Customer's Spark Wallet +## Step 4: Register the Destination Spark Wallet -Create and execute a trade from USD to BTC, and initiate the final transfer in one step. This combines external account -creation and quote execution using the `externalAccountDetails` option. +Register the customer's Spark wallet as an external account. + +### Request + +```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 '{ + "customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001", + "currency": "BTC", + "accountInfo": { + "accountType": "SPARK_WALLET", + "address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu" + } + }' +``` + +### Response + +```json +{ + "id": "ExternalAccount:b23dcbd6-dced-4ec4-b756-3c3a9ea3d456", + "customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001", + "status": "ACTIVE", + "currency": "BTC", + "accountInfo": { + "accountType": "SPARK_WALLET", + "address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu" + } +} +``` + +## Step 5: Create and Execute a Quote to the Customer's Spark Wallet + +Create and execute a trade from USD to BTC using the external account as the destination. ### Request @@ -189,13 +224,8 @@ curl -X POST "https://api.lightspark.com/grid/2025-10-13/quotes" \ "accountId": "InternalAccount:e85dcbd6-dced-4ec4-b756-3c3a9ea3d965" }, "destination": { - "externalAccountDetails": { - "currency": "BTC", - "accountInfo": { - "accountType": "SPARK_WALLET", - "address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu" - } - } + "destinationType": "ACCOUNT", + "accountId": "ExternalAccount:b23dcbd6-dced-4ec4-b756-3c3a9ea3d456" }, "lockedCurrencySide": "SENDING", "lockedCurrencyAmount": 100, @@ -205,16 +235,10 @@ curl -X POST "https://api.lightspark.com/grid/2025-10-13/quotes" \ ``` - **Combined External Account Creation and Quote Execution**: The `externalAccountDetails` option allows you to - create the external account and execute the quote in a single API call, which is perfect for one-off payments - to new destinations. The external account will be automatically created and then used as the destination for - the Bitcoin transfer. Its ID in the response can be used directly in future quote creation requests. - **Immediate Quote Execution (Market Order)**: Note that `immediatelyExecute` is set to `true` in this example. Because we always just want to send $1.00 worth of BTC to users as a reward at the current market rate, we don't need to lock a quote and view the rate details before executing. If you want to lock a quote and confirm fees and exchange rate details before executing the quote, set `immediatelyExecute` to `false` or omit the field. - ### Response @@ -258,9 +282,7 @@ The quote shows: - **Sending**: \$1.00 USD (including $0.05 fee) - **Receiving**: 0.0000081 BTC (810 satoshis) - **Exchange rate**: 8.1 sats per USD cent (~$123,000 per BTC) -- **External account created**: The Spark wallet was automatically added as an external account during quote creation - -The quote status changes to `PROCESSING` and the Bitcoin transfer is initiated. The external account is created, USD is debited from the internal account, Bitcoin is purchased, and then sent to the Spark wallet address. +The quote status changes to `PROCESSING` and the Bitcoin transfer is initiated. USD is debited from the internal account, Bitcoin is purchased, and then sent to the Spark wallet address. You can track the status by: @@ -319,7 +341,8 @@ You've successfully completed a Bitcoin purchase and transfer to a self-custody 1. ✅ Listed internal accounts and obtained USD funding instructions 2. ✅ Funded the internal account with USD via ACH 3. ✅ Generated a Spark wallet for the customer -4. ✅ Created and executed a quote to purchase Bitcoin and send to the Spark wallet +4. ✅ Registered the destination Spark wallet as an external account +5. ✅ Created and executed a quote to purchase Bitcoin and send to the Spark wallet The customer now has 810 Satoshis in their self-custody Spark wallet! diff --git a/mintlify/snippets/sandbox-quote-patterns.mdx b/mintlify/snippets/sandbox-quote-patterns.mdx index a2975244..b999e70c 100644 --- a/mintlify/snippets/sandbox-quote-patterns.mdx +++ b/mintlify/snippets/sandbox-quote-patterns.mdx @@ -9,5 +9,3 @@ When creating a quote with an external account destination, the account number s | **006** | User cancellation | | **007** | Payout and refund failed | | **Any other** | Successful payment | - -These patterns apply whether you use a pre-created external account as the destination or provide `externalAccountDetails` inline in the quote request. diff --git a/openapi.yaml b/openapi.yaml index 89bb2e85..d78dd6af 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -2273,13 +2273,8 @@ paths: customerId: Customer:019542f5-b3e7-1d02-0000-000000000009 currency: USD destination: - destinationType: EXTERNAL_ACCOUNT_DETAILS - externalAccountDetails: - customerId: Customer:019542f5-b3e7-1d02-0000-000000000001 - currency: BTC - accountInfo: - accountType: SPARK_WALLET - address: spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu + destinationType: ACCOUNT + accountId: ExternalAccount:b23dcbd6-dced-4ec4-b756-3c3a9ea3d456 lockedCurrencySide: RECEIVING lockedCurrencyAmount: 10000 immediatelyExecute: true @@ -10232,7 +10227,6 @@ components: enum: - ACCOUNT - UMA_ADDRESS - - EXTERNAL_ACCOUNT_DETAILS description: Type of transaction destination example: ACCOUNT BaseTransactionDestination: @@ -10282,33 +10276,15 @@ components: description: UMA address of the recipient example: $receiver@uma.domain.com description: UMA address destination details - ExternalAccountDetailsTransactionDestination: - title: External Account Details Destination - allOf: - - $ref: '#/components/schemas/BaseTransactionDestination' - - type: object - required: - - externalAccountDetails - - destinationType - properties: - destinationType: - type: string - enum: - - EXTERNAL_ACCOUNT_DETAILS - externalAccountDetails: - $ref: '#/components/schemas/ExternalAccountCreateRequest' - description: Transaction destination where external account details were provided inline at quote creation rather than using a pre-registered external account. TransactionDestinationOneOf: oneOf: - $ref: '#/components/schemas/AccountTransactionDestination' - $ref: '#/components/schemas/UmaAddressTransactionDestination' - - $ref: '#/components/schemas/ExternalAccountDetailsTransactionDestination' discriminator: propertyName: destinationType mapping: ACCOUNT: '#/components/schemas/AccountTransactionDestination' UMA_ADDRESS: '#/components/schemas/UmaAddressTransactionDestination' - EXTERNAL_ACCOUNT_DETAILS: '#/components/schemas/ExternalAccountDetailsTransactionDestination' CounterpartyInformation: type: object description: Additional information about the counterparty, if available and relevant to the transaction and platform. @@ -10924,7 +10900,6 @@ components: enum: - ACCOUNT - UMA_ADDRESS - - EXTERNAL_ACCOUNT_DETAILS description: Type of payment destination example: ACCOUNT BaseDestination: @@ -10978,33 +10953,15 @@ components: description: Currency code for the destination. See [Supported Currencies](https://grid.lightspark.com/platform-overview/core-concepts/currencies-and-rails) for the full list of supported fiat and crypto currencies. example: EUR description: UMA address destination details - ExternalAccountDetailsDestination: - title: External Account Details - allOf: - - $ref: '#/components/schemas/BaseDestination' - - type: object - required: - - externalAccountDetails - - destinationType - properties: - destinationType: - type: string - enum: - - EXTERNAL_ACCOUNT_DETAILS - externalAccountDetails: - $ref: '#/components/schemas/ExternalAccountCreateRequest' - description: A convenient destination option which adds the external account and creates the quote in one step rather than first needing to call /external-accounts to add the account. Useful for one-off payments to some destination. See the Sandbox Testing guide in the API reference for test values. QuoteDestinationOneOf: oneOf: - $ref: '#/components/schemas/AccountDestination' - $ref: '#/components/schemas/UmaAddressDestination' - - $ref: '#/components/schemas/ExternalAccountDetailsDestination' discriminator: propertyName: destinationType mapping: ACCOUNT: '#/components/schemas/AccountDestination' UMA_ADDRESS: '#/components/schemas/UmaAddressDestination' - EXTERNAL_ACCOUNT_DETAILS: '#/components/schemas/ExternalAccountDetailsDestination' Quote: type: object required: diff --git a/openapi/components/schemas/quotes/DestinationType.yaml b/openapi/components/schemas/quotes/DestinationType.yaml index 9ebdbeba..4eb01e86 100644 --- a/openapi/components/schemas/quotes/DestinationType.yaml +++ b/openapi/components/schemas/quotes/DestinationType.yaml @@ -2,6 +2,5 @@ type: string enum: - ACCOUNT - UMA_ADDRESS - - EXTERNAL_ACCOUNT_DETAILS description: Type of payment destination example: ACCOUNT diff --git a/openapi/components/schemas/quotes/ExternalAccountDetailsDestination.yaml b/openapi/components/schemas/quotes/ExternalAccountDetailsDestination.yaml deleted file mode 100644 index a6ece0aa..00000000 --- a/openapi/components/schemas/quotes/ExternalAccountDetailsDestination.yaml +++ /dev/null @@ -1,19 +0,0 @@ -title: External Account Details -allOf: - - $ref: ./BaseDestination.yaml - - type: object - required: - - externalAccountDetails - - destinationType - properties: - destinationType: - type: string - enum: - - EXTERNAL_ACCOUNT_DETAILS - externalAccountDetails: - $ref: ../external_accounts/ExternalAccountCreateRequest.yaml - description: >- - A convenient destination option which adds the external account and creates - the quote in one step rather than first needing to call /external-accounts - to add the account. Useful for one-off payments to some destination. - See the Sandbox Testing guide in the API reference for test values. diff --git a/openapi/components/schemas/quotes/QuoteDestinationOneOf.yaml b/openapi/components/schemas/quotes/QuoteDestinationOneOf.yaml index d4020629..69c5090e 100644 --- a/openapi/components/schemas/quotes/QuoteDestinationOneOf.yaml +++ b/openapi/components/schemas/quotes/QuoteDestinationOneOf.yaml @@ -1,10 +1,8 @@ oneOf: - $ref: ./AccountDestination.yaml - $ref: ./UmaAddressDestination.yaml - - $ref: ./ExternalAccountDetailsDestination.yaml discriminator: propertyName: destinationType mapping: ACCOUNT: ./AccountDestination.yaml UMA_ADDRESS: ./UmaAddressDestination.yaml - EXTERNAL_ACCOUNT_DETAILS: ./ExternalAccountDetailsDestination.yaml diff --git a/openapi/components/schemas/transactions/ExternalAccountDetailsTransactionDestination.yaml b/openapi/components/schemas/transactions/ExternalAccountDetailsTransactionDestination.yaml deleted file mode 100644 index c323c197..00000000 --- a/openapi/components/schemas/transactions/ExternalAccountDetailsTransactionDestination.yaml +++ /dev/null @@ -1,17 +0,0 @@ -title: External Account Details Destination -allOf: - - $ref: ./BaseTransactionDestination.yaml - - type: object - required: - - externalAccountDetails - - destinationType - properties: - destinationType: - type: string - enum: - - EXTERNAL_ACCOUNT_DETAILS - externalAccountDetails: - $ref: ../external_accounts/ExternalAccountCreateRequest.yaml - description: >- - Transaction destination where external account details were provided - inline at quote creation rather than using a pre-registered external account. diff --git a/openapi/components/schemas/transactions/TransactionDestinationOneOf.yaml b/openapi/components/schemas/transactions/TransactionDestinationOneOf.yaml index 9f88947f..8167f58b 100644 --- a/openapi/components/schemas/transactions/TransactionDestinationOneOf.yaml +++ b/openapi/components/schemas/transactions/TransactionDestinationOneOf.yaml @@ -1,10 +1,8 @@ oneOf: - $ref: ./AccountTransactionDestination.yaml - $ref: ./UmaAddressTransactionDestination.yaml - - $ref: ./ExternalAccountDetailsTransactionDestination.yaml discriminator: propertyName: destinationType mapping: ACCOUNT: ./AccountTransactionDestination.yaml UMA_ADDRESS: ./UmaAddressTransactionDestination.yaml - EXTERNAL_ACCOUNT_DETAILS: ./ExternalAccountDetailsTransactionDestination.yaml diff --git a/openapi/components/schemas/transactions/TransactionDestinationType.yaml b/openapi/components/schemas/transactions/TransactionDestinationType.yaml index 87d5a17b..f2b90067 100644 --- a/openapi/components/schemas/transactions/TransactionDestinationType.yaml +++ b/openapi/components/schemas/transactions/TransactionDestinationType.yaml @@ -2,6 +2,5 @@ type: string enum: - ACCOUNT - UMA_ADDRESS - - EXTERNAL_ACCOUNT_DETAILS description: Type of transaction destination example: ACCOUNT diff --git a/openapi/paths/quotes/quotes.yaml b/openapi/paths/quotes/quotes.yaml index 11f4d8f0..8c9930b0 100644 --- a/openapi/paths/quotes/quotes.yaml +++ b/openapi/paths/quotes/quotes.yaml @@ -63,13 +63,8 @@ post: customerId: Customer:019542f5-b3e7-1d02-0000-000000000009 currency: USD destination: - destinationType: EXTERNAL_ACCOUNT_DETAILS - externalAccountDetails: - customerId: Customer:019542f5-b3e7-1d02-0000-000000000001 - currency: BTC - accountInfo: - accountType: SPARK_WALLET - address: spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu + destinationType: ACCOUNT + accountId: ExternalAccount:b23dcbd6-dced-4ec4-b756-3c3a9ea3d456 lockedCurrencySide: RECEIVING lockedCurrencyAmount: 10000 immediatelyExecute: true