Skip to content

Commit 02447bc

Browse files
authored
organize sandbox test case information (#268)
1 parent fa97cde commit 02447bc

18 files changed

Lines changed: 175 additions & 272 deletions

mintlify/api-reference/environments.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { topLevelProductName } from '/snippets/variables.mdx'
1111
`https://api.lightspark.com/grid/2025-10-13`
1212

1313
## Sandbox
14-
Sandbox enables you to test your integration without making real payments. In sandbox, we expose sandbox specific APIs to trigger specific test cases like incoming payments. Additionally you'll find test UMA addresses to simulate different sending scenarios. For more information, see [Sandbox Testing](../payouts-and-b2b/platform-tools/sandbox-testing).
14+
Sandbox enables you to test your integration without making real payments. In sandbox, we expose sandbox specific APIs to trigger specific test cases like incoming payments. Additionally you'll find test UMA addresses to simulate different sending scenarios. For more information, see [Sandbox Testing](sandbox-testing).
1515

1616
## Production
1717
Production moves real money. To get access to a production environment, please reach out to your Lightspark contact.
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
title: "Sandbox Testing"
3+
description: "Use Grid sandbox magic values to trigger specific API responses"
4+
icon: "/images/icons/hammer.svg"
5+
"og:image": "/images/og/og-api-reference.png"
6+
---
7+
8+
import SandboxExternalAccounts from '/snippets/sandbox-external-accounts.mdx';
9+
import SandboxBeneficiaryVerification from '/snippets/sandbox-beneficiary-verification.mdx';
10+
import SandboxTransferPatterns from '/snippets/sandbox-transfer-patterns.mdx';
11+
import SandboxQuotePatterns from '/snippets/sandbox-quote-patterns.mdx';
12+
import SandboxUmaAddresses from '/snippets/sandbox-uma-addresses.mdx';
13+
14+
The Grid sandbox environment simulates real payment flows without moving real money. You can control test outcomes using special account number patterns and test addresses.
15+
16+
## Adding external accounts
17+
18+
<SandboxExternalAccounts />
19+
20+
### Beneficiary name verification
21+
22+
<SandboxBeneficiaryVerification />
23+
24+
## Transfer in
25+
26+
In production, internal accounts are funded by sending a bank transfer to the account's payment instructions or by pulling from an external account. In sandbox, you have two options:
27+
28+
### Transfer in from an external account
29+
30+
Use the `/transfer-in` endpoint to pull funds from an external account into an internal account. The external account's number suffix determines the outcome:
31+
32+
<SandboxTransferPatterns />
33+
34+
### Sandbox fund endpoint
35+
36+
Instantly add funds to any internal account using `/sandbox/internal-accounts/{accountId}/fund`:
37+
38+
```bash
39+
curl -X POST https://api.lightspark.com/grid/2025-10-13/sandbox/internal-accounts/{accountId}/fund \
40+
-u "$SANDBOX_CLIENT_ID:$SANDBOX_API_SECRET" \
41+
-H "Content-Type: application/json" \
42+
-d '{ "amount": 100000 }'
43+
```
44+
45+
## Creating quotes (cross-currency transfers)
46+
47+
<SandboxQuotePatterns />
48+
49+
### Executing a quote
50+
51+
After creating a quote, you need to fund it to trigger execution. There are two ways to do this in sandbox:
52+
53+
**Prefunded internal account** — If your quote's source is an internal account, fund the account using one of the methods described in [transfer in](#transfer-in), then call the quote execute endpoint to trigger the transaction:
54+
55+
```bash
56+
curl -X POST https://api.lightspark.com/grid/2025-10-13/quotes/{quoteId}/execute \
57+
-u "$SANDBOX_CLIENT_ID:$SANDBOX_API_SECRET"
58+
```
59+
60+
**Real-time funding via sandbox send** — If your quote uses real-time funding, the quote response includes payment instructions for you to transfer funds to. Use `/sandbox/send` to simulate this payment:
61+
62+
```bash
63+
curl -X POST https://api.lightspark.com/grid/2025-10-13/sandbox/send \
64+
-u "$SANDBOX_CLIENT_ID:$SANDBOX_API_SECRET" \
65+
-H "Content-Type: application/json" \
66+
-d '{
67+
"quoteId": "Quote:019542f5-b3e7-1d02-0000-000000000006",
68+
"currencyCode": "USD"
69+
}'
70+
```
71+
72+
## Transferring out funds
73+
74+
Use the `/transfer-out` endpoint to push funds from an internal account to an external account in the same currency. The external account's number suffix controls the outcome using the same patterns as [transfer in](#transfer-in-from-an-external-account).
75+
76+
## Sending to a UMA address
77+
78+
<SandboxUmaAddresses />
79+
80+
### Simulating incoming UMA payments
81+
82+
Use the sandbox receive endpoint to simulate an incoming UMA payment to one of your platform's users:
83+
84+
```bash
85+
curl -X POST https://api.lightspark.com/grid/2025-10-13/sandbox/uma/receive \
86+
-u "$SANDBOX_CLIENT_ID:$SANDBOX_API_SECRET" \
87+
-H "Content-Type: application/json" \
88+
-d '{
89+
"senderUmaAddress": "$success.usd@sandbox.uma.money",
90+
"receiverUmaAddress": "$your.user@your.domain",
91+
"receivingCurrencyCode": "USD",
92+
"receivingCurrencyAmount": 5000
93+
}'
94+
```

mintlify/docs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,8 @@
265265
"api-reference/environments",
266266
"api-reference/terminology",
267267
"api-reference/authentication",
268-
"api-reference/webhooks"
268+
"api-reference/webhooks",
269+
"api-reference/sandbox-testing"
269270
]
270271
},
271272
{

mintlify/openapi.yaml

Lines changed: 3 additions & 28 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: 11 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ icon: "/images/icons/hammer.svg"
55
"og:image": "/images/og/og-payouts-b2b.png"
66
---
77

8-
import SandboxVpaValidation from '/snippets/sandbox-vpa-validation.mdx';
8+
import SandboxBeneficiaryVerification from '/snippets/sandbox-beneficiary-verification.mdx';
9+
import SandboxExternalAccounts from '/snippets/sandbox-external-accounts.mdx';
10+
import SandboxTransferPatterns from '/snippets/sandbox-transfer-patterns.mdx';
11+
import SandboxQuotePatterns from '/snippets/sandbox-quote-patterns.mdx';
912

1013
## Overview
1114

@@ -55,55 +58,11 @@ Alternatively, you can also fund internal accounts using the `/quotes` or `/tran
5558

5659
### Adding Test External Accounts
5760

58-
The flows for creating external accounts in sandbox are the same as in production.
59-
However, when creating external accounts in sandbox, you can use special account number patterns to simulate different
60-
transfer behaviors. The **last 3 digits** of the account number determine the test scenario:
61+
<SandboxExternalAccounts />
6162

62-
| Last Digits | Behavior | Use Case |
63-
|-------------|----------|----------|
64-
| **002** | Insufficient funds | Transfer-in fails immediately |
65-
| **003** | Account closed/invalid | All transfers fail immediately |
66-
| **004** | Transfer rejected | Bank rejects the transfer |
67-
| **005** | Timeout/delayed failure | Transaction stays pending ~30s, then fails |
68-
| **Any other** | Success | All transfers complete normally |
63+
### Beneficiary name verification
6964

70-
**Example - Creating a Test Account with Insufficient Funds:**
71-
72-
```bash
73-
POST /customers/external-accounts
74-
75-
{
76-
"customerId": "Customer:123",
77-
"currency": "USD",
78-
"accountInfo": {
79-
"accountType": "US_ACCOUNT",
80-
"accountNumber": "000000002", // Will trigger insufficient funds
81-
"routingNumber": "110000000",
82-
"accountCategory": "CHECKING",
83-
"beneficiary": {
84-
"beneficiaryType": "INDIVIDUAL",
85-
"fullName": "Test User",
86-
"address": {
87-
"line1": "123 Test St",
88-
"city": "San Francisco",
89-
"state": "CA",
90-
"postalCode": "94105",
91-
"country": "US"
92-
}
93-
}
94-
}
95-
}
96-
```
97-
98-
<Note>
99-
These patterns apply to the primary identifier for any account type: US account numbers, IBANs, CLABEs, Spark wallet addresses, etc. Just ensure the identifier ends with the appropriate test digits.
100-
For scenarios like PIX and UPI, where there's a domain part involved, append the test digits to the user name part. For example, if testing email addresses as a PIX key, the full identifier would be
101-
"testuser.002@pix.com.br" to trigger the insufficient funds scenario.
102-
</Note>
103-
104-
### INR UPI VPA validation simulation
105-
106-
<SandboxVpaValidation />
65+
<SandboxBeneficiaryVerification />
10766

10867
### Testing Transfer-In (Pull from External Account)
10968

@@ -123,13 +82,7 @@ POST /transfer-in
12382
}
12483
```
12584

126-
**Expected Behaviors:**
127-
128-
- **Success (default)**: Transaction completes immediately with status `COMPLETED`
129-
- **Insufficient funds (002)**: Transaction fails immediately with appropriate error
130-
- **Account closed (003)**: Transaction fails immediately with account validation error
131-
- **Transfer rejected (004)**: Transaction fails immediately with rejection error
132-
- **Timeout (009)**: Transaction shows `PENDING` status for ~30 seconds, then transitions to `FAILED`
85+
<SandboxTransferPatterns />
13386

13487
### Testing Transfer-Out (Push to External Account)
13588

@@ -153,6 +106,8 @@ The transfer will instantly simulate the bank transfer process and complete with
153106

154107
## Testing Cross-Currency Quotes
155108

109+
<SandboxQuotePatterns />
110+
156111
### Creating Quotes with Test Accounts
157112

158113
When creating quotes with the `externalAccountDetails` destination type, you can provide test account patterns inline:
@@ -172,7 +127,7 @@ POST /quotes
172127
"currency": "EUR",
173128
"accountInfo": {
174129
"accountType": "IBAN_ACCOUNT",
175-
"iban": "DE89370400440532013003", // Ends in 003 = account closed
130+
"iban": "DE89370400440532013003", // Ends in 003 = slow payment
176131
"beneficiary": {
177132
"beneficiaryType": "INDIVIDUAL",
178133
"fullName": "Test User"

mintlify/platform-overview/introduction/platform-capabilities.mdx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,7 @@ Full-featured sandbox environment for development:
192192

193193
### Special Test Patterns
194194

195-
Control sandbox behavior with magic account numbers:
196-
197-
- Account ending in `002`: Insufficient funds
198-
- Account ending in `003`: Account closed/invalid
199-
- Account ending in `004`: Transfer rejected
200-
- Account ending in `005`: Timeout (pending → failed after 30s)
195+
Control sandbox behavior with magic account numbers. See the [Sandbox Testing](/api-reference/sandbox-testing) guide for the full list of test patterns for cross-currency quotes, same-currency transfers, account validation, and UMA addresses.
201196

202197
### Developer Tools
203198

0 commit comments

Comments
 (0)