Live and test modes
Which one you are in is decided by your key, and nothing else.
There is no mode parameter, no header and no separate hostname. You send a
test key and you are in test mode; you send a live key and you are in live
mode, on the same base URL.
What differs
| Live | Test | |
|---|---|---|
| Money | your real partner balance | a play balance, granted at 500,000 |
| Meters and targets | any real one | six reserved numbers only |
| Providers | real vendors | nothing is contacted |
| Tokens | real, from the disco | made up, prefixed TEST- |
| KYB | must be approved | not checked |
| Address allowlist | enforced when set | not enforced |
| Webhooks | your live URL and secret | your test URL and secret |
| Orders you can read | live orders | sandbox orders |
| Default concurrency | 20 in flight | 5 in flight |
The two sets of orders never mix. A test key cannot read a live order and a live key cannot read a sandbox one, even by reference.
Telling which one you hold
curl https://stagingapi.getelectric.ng/api/v2/reseller/me \
-H 'Authorization: Bearer <your-api-key>'data.mode is live or test. In test mode the response also carries
sandbox_balance.
Tip
Read mode when your application starts and compare it with what that
deployment is supposed to be using. A staging deployment that finds itself
holding a live key should refuse to start, not discover the problem by
selling something.
Staging is not the sandbox
This confuses people, so plainly:
- Staging is one of our environments, at
https://stagingapi.getelectric.ng/api/v2. It runs with live provider credentials. - Test mode is what your key grants, on any environment.
A live key on staging spends real money against a real meter. If you want a safe place to build, that is a test key, not a particular hostname.
Moving over
Nothing about your code changes between modes except the key and the webhook endpoint you point at us. That is deliberate: the shape of every request and response is the same, so the only thing left to get wrong when you go live is the credential. Going live is the checklist.