Skip to main content

Overview

The Grid sandbox environment allows you to test your payouts integration without moving real money. All API endpoints work the same way in sandbox as they do in production, but money movements are simulated and you can control test scenarios using special test values.

Getting Started with Sandbox

Sandbox Credentials

To use the sandbox environment:
  1. Go to app.lightspark.com, create an account, and generate your sandbox API keys from the dashboard.
  2. Add your sandbox API token and secret to your environment variables.
  3. Use the normal production base URL: https://api.lightspark.com/grid/2025-10-13
  4. Authenticate using your sandbox token with HTTP Basic Auth

Simulating Money Movements

Funding Internal Accounts

In production, internal accounts are funded by following the payment instructions (bank transfer, wire, etc.). In sandbox, you can instantly add funds to any internal account using the following endpoint:
Example:
This endpoint returns the updated InternalAccount object with the new balance. Alternatively, you can also fund internal accounts using the /quotes or /transfer-in endpoints as described below.

Testing Transfer Scenarios

Adding Test External Accounts

The flows for creating external accounts in sandbox are the same as in production. The last 3 digits of an external account’s primary identifier (account number, IBAN, CLABE, Spark wallet address, etc.) determine the test scenario when that account is used in transfers or quotes. For identifiers with a domain part (e.g. PIX email keys), append the test digits to the username portion — for example, testuser.002@pix.com.br.

Beneficiary name verification

For account types that support beneficiary name verification, you can simulate different verification outcomes in sandbox. Use account identifiers with a 1xx suffix to trigger verification scenarios (this range is reserved for verification and does not conflict with transfer or quote test patterns):

Testing Transfer-In (Pull from External Account)

When you call /transfer-in with an external account created using test patterns, the transfer will complete instantly in sandbox with the behavior determined by the account number:

Testing Transfer-Out (Push to External Account)

Transfer-out works the same way - the destination external account’s test pattern determines the outcome:
The transfer will instantly simulate the bank transfer process and complete with the appropriate status based on the external account’s test pattern.

Testing Cross-Currency Quotes

When creating a quote with an external account destination, the account number suffix determines the payment outcome after quote execution:

Creating Quotes with Test Accounts

When creating quotes with test external accounts, first create an external account with a test account pattern, then reference it in the quote:
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:
  1. Instantly process the currency conversion
  2. Apply the test behavior based on any external accounts involved
  3. Update transaction statuses immediately (no waiting for bank processing)
  4. Trigger webhooks for state changes
For quotes with payment instructions (no source account), use the existing /sandbox/send endpoint to simulate payment:

Testing Webhooks

All webhook events fire normally in sandbox. To test your webhook endpoint:
  1. Configure your webhook URL in the dashboard
  2. Perform actions that trigger webhooks (transfers, quote execution, etc.)
  3. Receive webhook events at your endpoint
  4. Verify signature using the sandbox public key
You can also manually trigger a test webhook:

Common Testing Workflows

Complete Payout Flow Test

Here’s a complete test workflow for a USD → EUR payout:
  1. Create customer and internal accounts (via regular API)
  2. Fund customer’s USD internal account:
  3. Create a test external EUR account:
  4. Create and execute a quote:
  5. Verify transaction status and webhooks

Testing Error Scenarios

Test each failure mode systematically:

Sandbox Limitations

While sandbox closely mimics production, there are some differences:
  • Instant settlement: All transfers complete immediately (success cases) or fail immediately (error cases), except timeout scenarios (005)
  • No real bank validation: Account numbers aren’t validated against real banking networks
  • Simplified KYC: KYC processes are simulated and complete instantly. You must add customers via the /customers endpoint, rather than using the KYC link flow.
  • Fixed exchange rates: Currency conversion rates may not reflect real-time market rates.
Do not try sending money to any sandbox addresses or accounts. These are not real addresses and will not receive money.

Moving to Production

When you’re ready to move to production:
  1. Generate production API tokens in the dashboard
  2. Swap those credentials for the sandbox credentials in your environment variables
  3. Remove any sandbox-specific test patterns from your code
  4. Configure production webhook endpoints
  5. Test with small amounts first

Next Steps