Skip to content

Commit fb3a40d

Browse files
authored
Remove external account details quote destination (#308)
1 parent 591ec85 commit fb3a40d

22 files changed

Lines changed: 308 additions & 490 deletions

File tree

.claude/skills/grid-api/references/endpoints.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ Internal accounts are auto-created when customers are created based on platform
8787

8888
- `ACCOUNT`: External or internal account. Fields: `accountId`, `currency`
8989
- `UMA_ADDRESS`: UMA address. Fields: `umaAddress`, `currency`
90-
- `EXTERNAL_ACCOUNT_DETAILS`: Inline account creation (creates external account + quote in one step). Fields: `externalAccountDetails` (same shape as external account create request)
9190

9291
### Quote Request Fields
9392

components/grid-visualizer/CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ Stablecoins: `SOLANA_WALLET` (USDC), `TRON_WALLET` (USDT), `POLYGON_WALLET` (USD
214214
```json
215215
{
216216
"source": { "sourceType": "ACCOUNT" | "REALTIME_FUNDING", ... },
217-
"destination": { "destinationType": "ACCOUNT" | "EXTERNAL_ACCOUNT_DETAILS" | "UMA_ADDRESS", ... },
217+
"destination": { "destinationType": "ACCOUNT" | "UMA_ADDRESS", ... },
218218
"lockedCurrencySide": "SENDING" | "RECEIVING",
219219
"lockedCurrencyAmount": 10000
220220
}

mintlify/openapi.yaml

Lines changed: 2 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mintlify/payouts-and-b2b/platform-tools/sandbox-testing.mdx

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,26 @@ The transfer will instantly simulate the bank transfer process and complete with
110110

111111
### Creating Quotes with Test Accounts
112112

113-
When creating quotes with the `externalAccountDetails` destination type, you can provide test account patterns inline:
113+
When creating quotes with test external accounts, first create an external account with a test account pattern, then reference it in the quote:
114114

115115
```bash
116+
# Step 1: Create the external account with a test pattern
117+
POST /customers/external-accounts
118+
119+
{
120+
"customerId": "Customer:123",
121+
"currency": "EUR",
122+
"accountInfo": {
123+
"accountType": "IBAN_ACCOUNT",
124+
"iban": "DE89370400440532013003",
125+
"beneficiary": {
126+
"beneficiaryType": "INDIVIDUAL",
127+
"fullName": "Test User"
128+
}
129+
}
130+
}
131+
132+
# Step 2: Create the quote using the external account ID
116133
POST /quotes
117134

118135
{
@@ -121,25 +138,17 @@ POST /quotes
121138
"accountId": "InternalAccount:abc123"
122139
},
123140
"destination": {
124-
"destinationType": "EXTERNAL_ACCOUNT_DETAILS",
125-
"externalAccountDetails": {
126-
"customerId": "Customer:123",
127-
"currency": "EUR",
128-
"accountInfo": {
129-
"accountType": "IBAN_ACCOUNT",
130-
"iban": "DE89370400440532013003", // Ends in 003 = slow payment
131-
"beneficiary": {
132-
"beneficiaryType": "INDIVIDUAL",
133-
"fullName": "Test User"
134-
}
135-
}
136-
}
141+
"destinationType": "ACCOUNT",
142+
"accountId": "ExternalAccount:...",
143+
"currency": "EUR"
137144
},
138145
"lockedCurrencySide": "SENDING",
139146
"lockedCurrencyAmount": 100000
140147
}
141148
```
142149

150+
The IBAN ending in `003` triggers the slow payment test pattern.
151+
143152
### Executing Quotes in Sandbox
144153

145154
For quotes from an external account source, execute as in production via `/quotes/{quoteId}/execute`. The sandbox will:

mintlify/platform-overview/core-concepts/quote-system.mdx

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -306,38 +306,6 @@ curl -X POST https://api.lightspark.com/grid/2025-10-13/quotes \
306306
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.
307307
</Warning>
308308

309-
## Creating External Accounts in Quotes
310-
311-
You can create an external account inline when creating a quote:
312-
313-
```json
314-
{
315-
"source": {
316-
"sourceType": "ACCOUNT",
317-
"accountId": "InternalAccount:abc123"
318-
},
319-
"destination": {
320-
"destinationType": "EXTERNAL_ACCOUNT_DETAILS",
321-
"externalAccountDetails": {
322-
"customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001",
323-
"currency": "EUR",
324-
"accountInfo": {
325-
"accountType": "IBAN_ACCOUNT",
326-
"iban": "DE89370400440532013000",
327-
"beneficiary": {
328-
"beneficiaryType": "INDIVIDUAL",
329-
"fullName": "Alice Smith"
330-
}
331-
}
332-
}
333-
},
334-
"lockedCurrencySide": "SENDING",
335-
"lockedCurrencyAmount": 100000
336-
}
337-
```
338-
339-
This is useful for one-time recipients or when you don't want to manage external accounts separately.
340-
341309
## Fees
342310

343311
All fees are transparently displayed in the quote response:

mintlify/ramps/accounts/external-accounts.mdx

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -152,40 +152,6 @@ curl -X POST 'https://api.lightspark.com/grid/2025-10-13/customers/external-acco
152152
}'
153153
```
154154

155-
## Creating accounts inline with quotes
156-
157-
For one-time conversions, create external accounts inline using `externalAccountDetails`:
158-
159-
```bash
160-
curl -X POST 'https://api.lightspark.com/grid/2025-10-13/quotes' \
161-
-H 'Authorization: Basic $GRID_CLIENT_ID:$GRID_CLIENT_SECRET' \
162-
-H 'Content-Type: application/json' \
163-
-d '{
164-
"source": {
165-
"customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001",
166-
"currency": "USD"
167-
},
168-
"destination": {
169-
"externalAccountDetails": {
170-
"customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001",
171-
"currency": "BTC",
172-
"accountInfo": {
173-
"accountType": "SPARK_WALLET",
174-
"address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu"
175-
}
176-
}
177-
},
178-
"lockedCurrencySide": "SENDING",
179-
"lockedCurrencyAmount": 10000
180-
}'
181-
```
182-
183-
<Tip>
184-
Use `externalAccountDetails` for one-time destinations. The external account
185-
will be automatically created and can be reused for future quotes using its
186-
returned ID.
187-
</Tip>
188-
189155
## Listing external accounts
190156

191157
### List customer external accounts

mintlify/ramps/conversion-flows/fiat-crypto-conversion.mdx

Lines changed: 35 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,24 @@ Grid enables seamless conversion between fiat currencies and cryptocurrencies vi
2525

2626
### Create a quote
2727

28-
<CodeGroup>
28+
First, create an external account for the crypto destination:
29+
30+
```bash cURL
31+
curl -X POST 'https://api.lightspark.com/grid/2025-10-13/customers/external-accounts' \
32+
-H 'Authorization: Basic $GRID_CLIENT_ID:$GRID_CLIENT_SECRET' \
33+
-H 'Content-Type: application/json' \
34+
-d '{
35+
"customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001",
36+
"currency": "BTC",
37+
"accountInfo": {
38+
"accountType": "SPARK_WALLET",
39+
"address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu"
40+
}
41+
}'
42+
```
43+
44+
Then create a quote using the external account ID:
45+
2946
```bash cURL
3047
curl -X POST 'https://api.lightspark.com/grid/2025-10-13/quotes' \
3148
-H 'Authorization: Basic $GRID_CLIENT_ID:$GRID_CLIENT_SECRET' \
@@ -36,63 +53,15 @@ curl -X POST 'https://api.lightspark.com/grid/2025-10-13/quotes' \
3653
"currency": "USD"
3754
},
3855
"destination": {
39-
"externalAccountDetails": {
40-
"customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001",
41-
"currency": "BTC",
42-
"beneficiary": {
43-
"counterPartyType": "INDIVIDUAL",
44-
"fullName": "John Doe",
45-
"email": "john@example.com"
46-
},
47-
"accountInfo": {
48-
"accountType": "SPARK_WALLET",
49-
"address": "spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu"
50-
}
51-
}
56+
"destinationType": "ACCOUNT",
57+
"accountId": "ExternalAccount:b23dcbd6-dced-4ec4-b756-3c3a9ea3d456"
5258
},
5359
"lockedCurrencySide": "RECEIVING",
5460
"lockedCurrencyAmount": 100000,
5561
"description": "Buy 0.001 BTC"
5662
}'
5763
```
5864

59-
```javascript Node.js
60-
const quote = await fetch("https://api.lightspark.com/grid/2025-10-13/quotes", {
61-
method: "POST",
62-
headers: {
63-
Authorization: `Basic ${credentials}`,
64-
"Content-Type": "application/json",
65-
},
66-
body: JSON.stringify({
67-
source: {
68-
customerId: "Customer:019542f5-b3e7-1d02-0000-000000000001",
69-
currency: "USD",
70-
},
71-
destination: {
72-
externalAccountDetails: {
73-
customerId: "Customer:019542f5-b3e7-1d02-0000-000000000001",
74-
currency: "BTC",
75-
beneficiary: {
76-
counterPartyType: "INDIVIDUAL",
77-
fullName: "John Doe",
78-
email: "john@example.com",
79-
},
80-
accountInfo: {
81-
accountType: "SPARK_WALLET",
82-
address:
83-
"spark1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu",
84-
},
85-
},
86-
},
87-
lockedCurrencySide: "RECEIVING",
88-
lockedCurrencyAmount: 100000, // 0.001 BTC in satoshis
89-
description: "Buy 0.001 BTC",
90-
}),
91-
}).then((r) => r.json());
92-
```
93-
94-
</CodeGroup>
95-
9665
**Response includes payment instructions:**
9766

9867
```json
@@ -212,30 +181,23 @@ app.post("/webhooks/grid", async (req, res) => {
212181

213182
For instant on-ramps (e.g., reward payouts), use `immediatelyExecute: true` with an internal account source:
214183

215-
```javascript
216-
const quote = await fetch("https://api.lightspark.com/grid/2025-10-13/quotes", {
217-
method: "POST",
218-
body: JSON.stringify({
219-
source: {
220-
sourceType: "ACCOUNT",
221-
accountId: "InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123",
184+
```bash cURL
185+
curl -X POST 'https://api.lightspark.com/grid/2025-10-13/quotes' \
186+
-H 'Authorization: Basic $GRID_CLIENT_ID:$GRID_CLIENT_SECRET' \
187+
-H 'Content-Type: application/json' \
188+
-d '{
189+
"source": {
190+
"sourceType": "ACCOUNT",
191+
"accountId": "InternalAccount:a12dcbd6-dced-4ec4-b756-3c3a9ea3d123"
222192
},
223-
destination: {
224-
destinationType: "EXTERNAL_ACCOUNT_DETAILS",
225-
externalAccountDetails: {
226-
customerId: "Customer:...",
227-
currency: "BTC",
228-
accountInfo: {
229-
accountType: "SPARK_WALLET",
230-
address: "spark1...",
231-
},
232-
},
193+
"destination": {
194+
"destinationType": "ACCOUNT",
195+
"accountId": "ExternalAccount:b23dcbd6-dced-4ec4-b756-3c3a9ea3d456"
233196
},
234-
lockedCurrencySide: "RECEIVING",
235-
lockedCurrencyAmount: 100000,
236-
immediatelyExecute: true,
237-
}),
238-
}).then((r) => r.json());
197+
"lockedCurrencySide": "RECEIVING",
198+
"lockedCurrencyAmount": 100000,
199+
"immediatelyExecute": true
200+
}'
239201
```
240202

241203
<Info>

0 commit comments

Comments
 (0)