Environments and keys
Two environments with the same API, each with its own keys and data. A key only works on its own environment.
Base URL
https://api.locals.money/v1That is the live environment, and every path in these docs is relative to it. The version is part of the path: breaking changes ship as a new version, additions land in v1 and are listed in the Changelog.
Sandbox runs on its own deployment, with its own base URL and its own data. Ask us for it with your sandbox keys, and use it in place of https://api.locals.money in the examples.
Sandbox and live
| Sandbox | Live | |
|---|---|---|
| Keys | lk_test_… | lk_live_… |
| Money | Simulated. Nothing moves. | Real bank transfers and onchain settlement. |
| Deposits | POST/v1/test/routes/{id}/simulate | Your customers' real transfers |
| Verification | Test documents, faster review for individuals | Real KYC and KYB |
| Allowed IPs | Optional: a key without any works from anywhere | Required: a key without any does not work |
| Test endpoints | Enabled | Return 404 |
Build and test everything in sandbox, then switch the base URL and the key. Endpoints and payloads are the same. Objects never cross environments: a customer created in sandbox does not exist in live.
Authentication
Send your secret key as a Bearer token on every request:
curl https://api.locals.money/v1/routes \
-H "Authorization: Bearer $LOCALS_KEY"- A key of the other environment, a malformed, unknown or revoked key, or no key at all is
401 unauthorized. The message says which. - Your admins create and revoke keys in the Locals backoffice (
app.locals.money). - You can have up to 5 active keys. To rotate one: create the new key, deploy it, then revoke the old one. Revocation is immediate.
Secret keys can move money. Keep them on your servers. Never put them in a browser, a mobile app or a repository.
Allowed IPs
Each key works only from the addresses you allow for it: IPs or CIDR ranges, IPv4 or IPv6, up to 100 per key. You set them in the backoffice when you create the key, and change them there later.
- A live key without allowed IPs does not work. Add your servers' outbound addresses before you go live. That includes a live key created before allowed IPs existed: it does not work until you add some.
- A sandbox key without any works from anywhere.
- A range has a prefix of 1 to 32 for IPv4, or 1 to 128 for IPv6.
/0is refused. - The address is checked after the account (a suspended account is
403 forbiddenfirst) and before the rate limit: a refused request does not count towards it. - A request from any other address is
403 ip_not_allowed, with the address Locals saw:
{
"statusCode": 403,
"code": "ip_not_allowed",
"message": "Requests from 203.0.113.7 are not allowed for this key",
"requestId": "req_5d02aa"
}If your servers sit behind a NAT or a hosting provider, allow the address your traffic leaves from, which the message shows.
Rate limits
Each key has its own limit of requests per minute, 120 by default; past it, 429 rate_limited with Retry-After. See Rate limits.
Data you see
Each partner sees only its own customers, routes, transfers and events: lists are filtered by the key that calls them, and ids that belong to someone else return 404, the same as an id that does not exist.
A suspended account gets 403 forbidden on every request, and its backoffice is read only.
Network
All traffic is HTTPS. Locals settles to the address you put on each route; check it before you create the route, because deposits are sent there automatically.