Test in sandbox
Build and test your whole integration without moving real money, then switch keys.
Sandbox runs the same API as live, with the same objects, statuses and events, on its own deployment with its own base URL and data. Nothing in sandbox moves real money. The examples below use https://api.locals.money: put the sandbox base URL in its place.
Sandbox and live keys
| Key | What it does |
|---|---|
Sandbox key, lk_test_… | Works only on the sandbox deployment. Creates test customers, routes, quotes and transfers, and can call the simulator. Never moves money. Works from any address unless you set allowed IPs. |
Live key, lk_live_… | Works only on live, with real customers and real money, and only from its allowed IPs. The simulator returns 404. |
A key on the other environment is 401 unauthorized. Objects never cross environments: a customer or route created in sandbox does not exist in live, and the other way round.
Keep each key in your server's secret store and send it as Authorization: Bearer <key>. Never put a key in a browser, a mobile app or a repository. See Environments and keys.
Simulate a deposit
There is no real bank in sandbox, so you push deposits into a route yourself. The simulator produces the same transfer, with the same statuses, as a real bank transfer into the route.
POST/v1/test/routes/{id}/simulate takes the amount, in the route's currency, and a scenario:
curl -X POST https://api.locals.money/v1/test/routes/route_3f9a/simulate \
-H "Authorization: Bearer $LOCALS_SANDBOX_KEY" \
-H "Content-Type: application/json" \
-d '{ "amount": "250.00", "scenario": "completed" }'const res = await fetch('https://api.locals.money/v1/test/routes/route_3f9a/simulate', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LOCALS_SANDBOX_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ amount: '250.00', scenario: 'completed' }),
});
const result = await res.json();import os
import requests
res = requests.post(
"https://api.locals.money/v1/test/routes/route_3f9a/simulate",
headers={"Authorization": f"Bearer {os.environ['LOCALS_SANDBOX_KEY']}"},
json={"amount": "250.00", "scenario": "completed"},
)
result = res.json(){ "routeId": "route_3f9a", "amount": "250.00", "scenario": "completed", "accepted": true }The simulator accepts the request and the deposit follows on its own, with the same events as a real one: route.deposit.received, then transfer.completed or transfer.failed. Find it as a new kind: route transfer on the route:
curl "https://api.locals.money/v1/transfers?kind=route&routeId=route_3f9a" \
-H "Authorization: Bearer $LOCALS_SANDBOX_KEY"Scenarios
scenario | What it produces | Use it to test |
|---|---|---|
create_only | A new deposit that stays in progress (processing). | Showing an incoming payment as "on its way", and code that waits for a final status. |
completed | A deposit that settles: the transfer moves to complete with the USDC amount. | Crediting your customer, your success path and your reconciliation. |
failed | A deposit that fails: the transfer moves to failed. | Your failure path: no credit, an alert, a support flow. |
Use amounts of at least 100, the live minimum for AUD, so your tests look like real traffic. Run each scenario at least once before you go live.
Test your events
Sandbox sends real, signed events. Register an endpoint with POST/v1/webhook-endpoints, check it with POST/v1/webhook-endpoints/{id}/test, and run each scenario to see the events your handler gets. Try a secret rotation and a redelivery too, so your duplicate check is tested.
What sandbox does not do
- No real money. No bank transfer is received and no stablecoin is sent on any chain. Sandbox does not support testnets either.
- Payouts are not funded. You can create quotes and quoted transfers to test your requests, but the simulator only covers deposits into routes. There is no way to fund a quoted transfer in sandbox.
- Verification is not real. Business verification goes to manual review in sandbox, as it can in live, so a sandbox business can stay
pendingfor a while. Individual verification approves with the KYC provider's test documents.
Before you go live
- Run Collect AUD end to end in sandbox, with each simulator scenario.
- Handle every transfer status, including
review,refundingandrefunded, even if you have not seen them yet. See Statuses and lifecycle. - Show deposit instructions only for
activeroutes, with the allowed sending account and the A$100 minimum next to them. - Credit customers only on
complete, and storetxHashwith the credit. - Send an
Idempotency-Keyon everyPOST, generated once per operation and reused on retries with the same body. - Register your live webhook endpoint, verify signatures accepting any
v1, and keep a slow poll as a safety net. - Add your servers' outbound addresses to the live key: a live key without allowed IPs does not work.
- Handle
403 customer_blocked,422 limit_exceeded, a route withblocked: trueand a payout withactionRequired. - Run GET/v1/routes/{id}/reconciliation on a schedule and alert on any
differences. - Treat an unknown status or field as "needs a person", not as an error that stops your process.
- Store the live key in your secret store, separate from the sandbox key, and switch by configuration, not by code.
- For payouts, ask Locals to enable early access and confirm the currencies you need in Coverage and limits.