← Developer Guides

Getting Started#

Welcome to the API! This guide will walk you through the basics of integrating with our platform.

Base URL#

All API requests are made to your tenant's domain:

https://{your-domain}/api/v1/

Authentication#

Every API request must include your secret key in the Authorization header:

cURL
curl -X GET https://{your-domain}/api/v1/me \
  -H "Authorization: Bearer sk_live_your_secret_key"

Note: Never expose your secret key in client-side code. Use it only on your server.

Your First Request#

Let's verify your API key works. GET /me returns your account and, importantly, tells you which environment the key belongs to:

cURL
curl -X GET https://{your-domain}/api/v1/me \
  -H "Authorization: Bearer sk_live_your_secret_key" \
  -H "Accept: application/json"
JavaScript
const response = await fetch("https://{your-domain}/api/v1/me", {
  headers: {
    Authorization: "Bearer sk_live_your_secret_key",
    Accept: "application/json",
  },
});
const data = await response.json();
console.log(data);
Python
import requests

response = requests.get(
    "https://{your-domain}/api/v1/me",
    headers={
        "Authorization": "Bearer sk_live_your_secret_key",
        "Accept": "application/json",
    },
)
print(response.json())
PHP
$response = Http::withToken('sk_live_your_secret_key')
    ->get('https://{your-domain}/api/v1/me');

$data = $response->json();

A successful response looks like:

JSON
{
  "id": "01HQ...",
  "name": "My Business",
  "status": "active",
  "environment": "live",
  "api_key_prefix": "sk_live_a1b2c3",
  "tier": { "name": "Standard", "slug": "standard" }
}

tier is always present; its name and slug are null if no tier is assigned.

environment reflects the key you just sent, not a setting on your account. If you meant to be testing and this says live, stop and swap the key — every subsequent call in this guide moves real money.

Key Concepts#

ConceptDescription
Secret KeyServer-side key for authenticated requests (sk_live_... or sk_test_...)
Test ModeUse your sk_test_ key to test without real charges
IdempotencySend an Idempotency-Key header (or an idempotency_key body field) with each purchase so a retry never buys twice — see Idempotency
AmountsIntegers in the smallest unit of the currency — see below

Amounts & Currency#

The platform is multi-currency. Every monetary value — request amounts, response amounts, and catalog prices — is an integer in the smallest unit of the transaction's currency. There are no decimal points on the wire, so there's no floating-point rounding to worry about.

What "smallest unit" means depends on the currency's minor unit (ISO 4217):

CurrencySmallest unitFactorExample valueMeans
NGNkobo100500000₦5,000.00
USDcent100500000$5,000.00
KEScent100500000KSh 5,000.00
JPYyen (no minor unit)15000¥5,000

Do the conversion at your edge:

  • Sending an amount: multiply the major amount by the currency's factor. ₦5,000 → 500000.
  • Displaying a returned amount: divide by the factor. 500000 → ₦5,000.00.

Every amount in a response is paired with a currency_code. Don't assume NGN or a factor of 100 — read the currency_code and use that currency's minor unit, so your integration works for any tenant's currency.

There are no exceptions: airtime, data, bills, SMS and VoIP all take and return the smallest unit. To buy ₦500 of airtime, send "amount": 50000.

Idempotency#

Every purchase endpoint takes an idempotency key, so a request you retry after a timeout or a dropped connection never buys — or charges — twice. Send it as the Idempotency-Key header or as the idempotency_key field in the JSON body; they are the same key.

cURL
curl -X POST https://{your-domain}/api/v1/airtime/networks/mtn/purchase \
  -H "Authorization: Bearer sk_live_your_secret_key" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Idempotency-Key: order-7f3a9c" \
  -d '{ "phone_number": "2348012345678", "amount": 50000 }'
  • Re-sending a key returns the original purchase with 200 instead of buying again. The key alone identifies the purchase, so use one per order (your own order ID works well) and reuse it on every retry of that order.
  • At most 64 characters.
  • Header and body together must carry the same key. Two different keys are refused with 422 (errors.idempotency_key) and nothing is charged.
  • A failed purchase stays failed: its key replays the failure (400, PURCHASE_FAILED). To try again, use a new key.
  • Test and live share one key space. A key already used with your sk_test_ key is refused with 409 (IDEMPOTENCY_KEY_REUSED) on your sk_live_ key, and the other way round.

Environments#

EnvironmentKey PrefixDescription
Livesk_live_Real transactions, real money
Testsk_test_Simulated transactions, no charges

A test purchase answers exactly what the same live purchase answers — the same fields and status codes — with "is_test": true (live answers carry false). Code you write against your test key works unchanged with your live key.

Error Handling#

The API uses standard HTTP status codes. Errors include a JSON body:

JSON
{
  "message": "Insufficient wallet balance",
  "errors": {
    "amount": ["The amount exceeds your available balance"]
  }
}
StatusMeaning
200Success
400Bad request — check your parameters
401Unauthorized — check your API key
422Validation error — see errors object
429Rate limited — slow down
500Server error — retry or contact support

Next Steps#