Baton Developer API
Sell bills from your prepaid Baton wallet over a simple REST API. All amounts are in kobo (1 NGN = 100 kobo). Airtime is live today; electricity is coming next.
1. How it works
- Create a business account and wait for Baton to approve it.
- Fund your wallet by transferring to your dedicated account number.
- Create an API key in your dashboard.
- Call the transactions endpoint. Each sale debits your wallet instantly.
- Receive a webhook when the sale settles, or poll the transaction.
2. Funding your wallet
Your dashboard shows an account number that belongs only to your business. Any transfer into it credits your wallet automatically, usually within seconds, and appears in your wallet history. A sale is declined with 402 when the balance is short.
3. Authentication
Pass your key id and secret as a bearer token, separated by a colon.
Authorization: Bearer pk_xxx:sk_yyyRequests are rate limited per key (120 per minute by default). On overflow you get 429 with Retry-After and X-RateLimit-* headers.
4. Base URL
https://batonbills.com/api/public/partners/v15. List products
curl https://batonbills.com/api/public/partners/v1/products \
-H "Authorization: Bearer pk_xxx:sk_yyy"{
"products": [
{ "slug": "mtn-airtime", "name": "MTN Airtime", "pricing_mode": "variable", "category": "airtime", "price_kobo": null }
]
}Only categories enabled for API sales are returned. Today that is airtime.
6. Check your wallet
curl https://batonbills.com/api/public/partners/v1/balance \
-H "Authorization: Bearer pk_xxx:sk_yyy"7. Sell airtime
Send an Idempotency-Key unique to your order. Replaying the same key with the same body returns the original sale; a different body returns 409.
curl -X POST https://batonbills.com/api/public/partners/v1/transactions \
-H "Authorization: Bearer pk_xxx:sk_yyy" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-12345" \
-d '{
"product_slug": "mtn-airtime",
"recipient": "08012345678",
"amount_kobo": 50000,
"reference": "order-12345"
}'{
"transaction": {
"reference": "BTN-...",
"partner_reference": "order-12345",
"status": "success",
"recipient": "08012345678",
"amount_kobo": 50000
}
}8. Fetch one transaction
curl https://batonbills.com/api/public/partners/v1/transactions/BTN-XXXX \
-H "Authorization: Bearer pk_xxx:sk_yyy"9. Webhooks
Register an https endpoint in your dashboard. Each delivery is signed with your webhook secret; verify the signature header before trusting the payload. Failed deliveries can be replayed from the dashboard.
10. Errors
400validation problem or unknown product401missing or invalid key402not enough wallet balance403key missing a scope, business not approved, or category not enabled409idempotency key reused with a different body429rate limited
Ready to start?
Create your business account, fund the wallet and generate a key.
Create a business account