localsDocs Get sandbox keys
Guides/Test in sandbox

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

KeyWhat 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()
Response · 202
{ "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:

Deposits of the route
curl "https://api.locals.money/v1/transfers?kind=route&routeId=route_3f9a" \
  -H "Authorization: Bearer $LOCALS_SANDBOX_KEY"

Scenarios

scenarioWhat it producesUse it to test
create_onlyA new deposit that stays in progress (processing).Showing an incoming payment as "on its way", and code that waits for a final status.
completedA deposit that settles: the transfer moves to complete with the USDC amount.Crediting your customer, your success path and your reconciliation.
failedA 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

Before you go live