Sandbox Environment
The UMAaaS sandbox environment allows you to test your integration without making real payments. When you set up your account, you'll receive both production and sandbox API tokens. The sandbox token is specifically for testing and development purposes. It corresponds to a separate platform instance in "sandbox" mode, which can only transact with the sandbox UMA addresses for testing.
Overview
The sandbox environment provides:
- A dedicated sandbox platform for testing
- Test UMA addresses for simulating payments
- Endpoints to simulate sending and receiving payments
- All the same webhooks and flows as production, but with simulated funds
Sandbox API Token
When your account is created, you'll receive two API tokens:
- A production token for real transactions
- A sandbox token for testing
The sandbox token follows the same authentication format as production:
curl -u "sandbox_token_id:sandbox_token_secret" https://api.lightspark.com/umaaas/v1/...
All requests using the sandbox token will be automatically routed to the sandbox environment.
Test UMA Addresses
The sandbox provides several test UMA addresses you can use to simulate different scenarios:
UMA Address | Description |
---|---|
$success.usd@sandbox.umaaas.uma.money | Always succeeds, sends USD |
$success.eur@sandbox.umaaas.uma.money | Always succeeds, sends EUR |
$success.mxn@sandbox.umaaas.uma.money | Always succeeds, sends MXN |
$success.inr@sandbox.umaaas.uma.money | Always succeeds, sends INR |
$pending.long.usd@sandbox.umaaas.uma.money | Simulates a long-pending payment |
$fail.compliance.usd@sandbox.umaaas.uma.money | Simulates compliance check failure |
Testing Outgoing Payments
To test sending payments from your platform, follow these steps:
- Look up a sandbox UMA address:
GET /receiver/$success.usd@sandbox.umaaas.uma.money
- Create a quote as normal:
POST /quotes
{
"lookupId": "Lookup:019542f5-b3e7-1d02-0000-000000000009",
"sendingCurrencyCode": "MXN",
"receivingCurrencyCode": "USD",
"lockedCurrencySide": "SENDING",
"lockedCurrencyAmount": 10000
}
- Instead of making a real bank transfer, use the sandbox send endpoint:
POST /sandbox/send
{
"reference": "UMA-Q12345-REF", // Reference from quote
"currencyCode": "USD",
"currencyAmount": 10000
}
The sandbox will simulate the payment and send appropriate webhooks just like in production.
Testing Incoming Payments
To test receiving payments to your platform's users, use the sandbox receive endpoint:
POST /sandbox/receive
{
"senderUmaAddress": "$success.usd@sandbox.umaaas.uma.money",
"receiverUmaAddress": "$your.user@your.domain",
"receivingCurrencyCode": "USD",
"receivingCurrencyAmount": 5000
}
This will trigger the same webhook flow as a real incoming payment:
- You'll receive an
INCOMING_PAYMENT
webhook withstatus: "PENDING"
- Your platform should approve/reject the payment
- On approval, you'll receive another webhook with
status: "COMPLETED"
Example Testing Flow
Here's a complete example of testing both directions of payments:
- First, register a test user:
POST /users
{
"umaAddress": "$test.user@your.domain",
"platformUserId": "test_123",
"userType": "INDIVIDUAL",
"fullName": "Test User",
"birthDate": "1990-01-01",
"address": {
"line1": "123 Test St",
"city": "Testville",
"state": "TS",
"postalCode": "12345",
"country": "US"
},
"bankAccountInfo": {
"accountType": "US_ACCOUNT",
"accountNumber": "123456789",
"routingNumber": "987654321",
"accountCategory": "CHECKING",
"bankName": "Test Bank"
}
}
- Test receiving a payment:
POST /sandbox/receive
{
"senderUmaAddress": "$success.usd@sandbox.umaaas.uma.money",
"receiverUmaAddress": "$test.user@your.domain",
"receivingCurrencyCode": "USD",
"receivingCurrencyAmount": 5000
}
- Test sending a payment:
# 1. Look up recipient
GET /receiver/$success.usd@sandbox.umaaas.uma.money
# 2. Create quote
POST /quotes
{
"lookupId": "Lookup:019542f5-b3e7-1d02-0000-000000000009",
"sendingCurrencyCode": "MXN",
"receivingCurrencyCode": "USD",
"lockedCurrencySide": "SENDING",
"lockedCurrencyAmount": 10000
}
# 3. Simulate sending payment
POST /sandbox/send
{
"reference": "UMA-Q12345-REF",
"currencyCode": "USD",
"currencyAmount": 10000
}
Testing Error Scenarios
You can test various error scenarios using the special sandbox UMA addresses:
- Test compliance failures:
GET /receiver/$fail.compliance.usd@sandbox.umaaas.uma.money
# ... create quote and attempt payment
- Test long-pending payments:
GET /receiver/$pending.long.usd@sandbox.umaaas.uma.money
# ... create quote and attempt payment
- Non-existent UMA address:
GET /receiver/$non.existent.usd@sandbox.umaaas.uma.money
# ... should return 404 Not Found
Each of these will trigger appropriate error webhooks and status updates to help you test your error handling.
Production vs Sandbox
Here are the key differences between production and sandbox environments:
- API Tokens: Sandbox tokens only work in the sandbox environment and vice versa
- Bank Transfers: In sandbox, you use
/sandbox/send
instead of real bank transfers - Test UMA Addresses: Special sandbox addresses for testing different scenarios
- Money: No real money is moved in sandbox
Always test thoroughly in sandbox before moving to production!