Testing & Sandbox
Every fleet gets two API keys — a live one and a test one — so you can build and test against the exact same endpoints without ever touching real money or real chargers.
Getting a test key
Open the Partner Dashboard's API Access tab. You'll see two cards, clearly labeled LIVE and TEST. Click "Regenerate test key" on the TEST card — this creates your sandbox fleet the first time you do it, seeded with a ₦0 wallet balance. The key looks like lg_test_<fleetId>.<secret> — same shape as your live key, just a different prefix.
What's different in test mode
| Live key | Test key | |
|---|---|---|
| Data | Your real fleet, drivers, and transaction history | A completely separate sandbox fleet — structurally isolated, never mixed with live data |
| Chargers | Real hardware | Simulated — every quote/start call gets a fabricated vehicle and state of charge, and completes on its own with no real charger involved |
| Wallet balance | Only changes via a real credit or a real distribution | Can be set to any value directly, instantly — see below |
| Money | Real | Never real, regardless of amounts used |
Setting sandbox balances directly
Testing "insufficient balance" shouldn't require simulating a realistic top-up first. Two endpoints, test-key only, set a balance directly:
Set fleet balance
POST/v1/sandbox/fleet-balance
curl https://api.lotgrids.com/v1/sandbox/fleet-balance \
-X POST \
-H "Authorization: ApiKey lg_test_f_8f21a9.9c2e1b7a..." \
-H "Content-Type: application/json" \
-d '{ "amount": 100000 }'
200 OK
{ "walletBalance": 100000 }
Set driver balance
POST/v1/sandbox/driver-balance
curl https://api.lotgrids.com/v1/sandbox/driver-balance \
-X POST \
-H "Authorization: ApiKey lg_test_f_8f21a9.9c2e1b7a..." \
-H "Content-Type: application/json" \
-d '{ "driverEmail": "test.driver@fleetco.com", "amount": 500 }'
200 OK
{ "subWalletBalance": 500 }
Set a driver's balance low (like the ₦500 above) and then call Start Charge Session for more than that to exercise the insufficient_balance error path on demand.
Calling either sandbox endpoint with a live key returns 403 sandbox_only — these only ever touch sandbox data.
Everything else works exactly the same
Mint Driver Token, Quote Charge Session, Start Charge Session, Add Driver, Update Driver, Distribute to Driver, Zero Driver Balance, and Set Fleet Auto-Zero all behave identically with a test key — same request/response shapes, same error codes — just routed to your sandbox fleet instead of your live one. A driver token minted with a test key only ever works against sandbox data too, so there's no way to accidentally cross the two once you've started testing.