Build on Stabex
REST and JSON APIs for cards, fills, statements and the Stabex app. Connect station POS, your ERP or a fleet system, and test everything in the sandbox first.
Plugs into what Stabex already runs
The APIs sit between the forecourt, payments and the systems your business already uses. Nothing has to be replaced.
Stabex APIsAccounts · Cards · Authorisation · Transactions · Statements · WebhooksSix groups, one key
Final scope is agreed with Stabex IT. Every group below already answers in the sandbox on this page.
First call in five minutes
Sandbox keys work only against sandbox data. Nothing is charged and no card is real.
Get a sandbox key
Stabex IT issues keys per system. This page uses a sample key:
Make a call
Send the key as a bearer token.
curl https://sandbox.api.stabex.co.ke/v1/cards \
-H "Authorization: Bearer $STABEX_KEY"Listen for events
Register an HTTPS URL and get every fill, decline and top-up as it happens.
WebhooksTry every endpoint
Pick an endpoint, edit the request and send it. The sandbox runs in this page, so you can break things freely.
/v1/cards// Press "Send request"
The Stabex app, wired to the sandbox
A working sample of the motorist app from the design deck: sign up, prepay at the pump, pump code, cashback, wallet top-ups, LPG shop and station finder, plus the fleet driver's card view. Use it on the left, or install it on an Android phone.
To install, allow your browser to install unknown apps when Android asks. Debug build for testing only, sandbox data, nothing is charged.
- Tap around the app. Every request it makes shows here.
Events as they happen
Stabex POSTs a JSON event to your URL. Verify the Stabex-Signature header with your endpoint secret, then reply 2xx within 10 seconds. Failed deliveries retry for 24 hours.
| Event | Sent when |
|---|---|
fill.approved | A card fill passed the card's rules at the pump |
fill.declined | A fill broke a rule: product, station, hours or limit |
card.frozen · card.unfrozen | A card was frozen or unfrozen |
card.issued · card.updated | A card was issued or its rules changed |
payment.completed | An app user paid at the pump |
wallet.topped_up | An M-Pesa top-up landed in a wallet |
account.created | A business account was opened |
{
"id": "evt_x8k2m1qa",
"type": "fill.approved",
"created_at": "2026-11-23T05:10:00Z",
"data": {
"id": "fill_A1",
"card_id": "card_F1trk",
"station": "Stabex Mombasa Rd",
"product": "diesel",
"litres": 63.0,
"amount": 12028,
"status": "approved"
}
}Plain errors you can show users
Every error has an HTTP status, a stable code and a message written for people. The sandbox allows 100 requests a minute per key.
| Status | Code | Meaning |
|---|---|---|
| 401 | unauthorized | Missing or wrong API key |
| 402 | insufficient_funds | Wallet or account balance too low |
| 402 | card_frozen | The card is frozen |
| 404 | card_not_found | No card with that id |
| 422 | invalid_amount | Amount outside the allowed range |
| 429 | rate_limited | Too many requests; retry after the given seconds |
How integration rolls out
Decision needed: nominate an IT lead and 2–3 pilot fleet customers.
Map POS, fuel-card and ERP systems with IT
Stabex IT tests the APIs; cards designed
POS authorisation and ERP feed
2–3 fleet customers live on cards and dashboard
Ready to build?
Ask Stabex IT for sandbox keys, or talk to Fleet Sales about a pilot.
