Reteller API
Generate your API keys, retrieve a plan from the catalogue, then submit a purchase. Use the topics menu for endpoint parameters and examples. Example plan IDs, operator tokens, references, prices and recipients are illustrative: retrieve current values for your account before ordering. Run credential-bearing examples on your server, never in a public browser app.
https://reteller.net/api/v1Keep secret keys on your server. Purchases wait up to 10 seconds for the final delivery result. They return 201 when successful, 200 for a final failed/refunded outcome, or 202 Accepted if still pending after the wait; reuse the same order key after a timeout and check the transaction status or webhook for the outcome.
Authentication
Every endpoint except public GET /ping requires your public and secret keys. Choose one of two schemes — both are equivalent.
Keys are created and revoked in Settings → API keys. Keep the secret key server-side; never expose it in client code. All endpoints use the base URL in Overview.
Response format
Responses share one envelope. On success, status is true and the result is in data. On failure, status is false with a human-readable message, and data is usually null. Some errors include structured details, such as the current and required wallet balance. The outer boolean reports API request handling; always check data.status for the transaction delivery result.
Endpoint directory
All v1 endpoints at a glance.
| Method | Endpoint | Description |
|---|---|---|
| GET | /ping | Connectivity check |
| GET | /balance | Wallet balance |
| GET | /services | Available services and plans |
| GET | /products/{category} | Products in a category |
| POST | /verify | Verify recipient or account |
| POST | /purchase | Buy airtime, data, cable, power… |
| GET | /transactions/{reference} | Retrieve a transaction |
| GET | /airtime/operators | International airtime operators |
| POST | /airtime/purchase | Send airtime abroad |
| GET | /data/operators | International data operators |
| POST | /data/purchase | Send data abroad |
| GET | /giftcards | Gift-card products |
| POST | /giftcards/purchase | Buy a gift card |
| GET | /esim/packages | eSIM plans for a destination |
| POST | /esim/purchase | Buy an eSIM |
| GET | /esim/status/{reference} | Retrieve an eSIM profile |
Connectivity check
Public connectivity check returning a server timestamp. It does not authenticate keys. Use GET /balance to test credentials and API IP access without a purchase.
Wallet balance
Returns your current wallet balance.
Available Services & Plans
Returns categories, products and plans. Each plan has a permanent numeric id starting from 1. Send this number as plan_id when creating a purchase. Provider plan IDs remain in your gateway mappings.
Category products
Returns the products in a single category.
Path parameters
| Parameter | Type | Description | |
|---|---|---|---|
category |
string | required | Category code, e.g. airtime, data-gifting, cable, electricity, betting. |
Verify recipient
Checks the selected plan and recipient without purchasing or debiting. Send JSON with plan_id (numeric public ID), recipient, and for electricity meter_type (prepaid or postpaid). Do not use the gateway's provider plan ID.
HTTP 200 and outer status: true do not prove that an account is verified: inspect data.ok, data.verified, data.requires and data.message. Verification availability depends on the configured gateway. Mobile network detection uses the number prefix and is not proof of delivery or current ported network.
For cable renewal, a successful account lookup can include bouquet, renewalAmount, quote_id and expiry. Use its quote_id for the same account and plan within 120 seconds. A quote is not a wallet debit or order.
Example body (replace plan_id with a current plan from your account): {"plan_id":1,"recipient":"08012345678"}. Send Content-Type: application/json and the normal authentication headers.
Create a purchase
Your order reference: send request_ref or its alias reference. If both are supplied, they must match. The value must be text of 1-190 bytes without control characters or surrounding spaces. Purchase responses, status responses and signed webhooks return it unchanged as data.reference and data.request_ref. The generated Reteller ID is returned as data.reteller_reference. Without a customer reference, data.reference remains the Reteller ID and data.request_ref is null.
Example request: {"reference":"your-order-1001","plan_id":1,"recipient":"08012345678"}. Example response fields: {"reference":"your-order-1001","request_ref":"your-order-1001","reteller_reference":"RT-example","status":"pending"}. Nigerian airtime/data recipients must use eleven digits starting with 0.
A customer reference identifies one order within your account even with a separate Idempotency-Key header. Reuse the same reference and identical details for retries. Changed details or another reference on the same key return HTTP 409.
Accepts an order, reserves its wallet payment once and queues delivery. Delivery starts immediately and the purchase request waits up to 10 seconds for a final result. Success returns HTTP 201; a final failed/refunded result returns HTTP 200 with the actual data.status (refunded orders are reversed). If no final result is available by the deadline, HTTP 202 returns pending and the existing worker continues. Signed settlement webhooks remain enabled for all outcomes. Set your HTTP client timeout above 10 seconds to allow for connection and acceptance overhead. The wait never submits a second provider order or debits again.
Send a unique Idempotency-Key header or request_ref for every new order. Keys must be 1–190 characters without control characters. The header takes precedence over a body idempotency_key, which takes precedence over request_ref. Reuse that key with identical details when retrying a timeout. Reteller returns the original order without another debit. Reusing a key for different details returns 409.
Manual-amount services (airtime, electricity and betting) also require amount. Check the transaction reference or receive a signed webhook for the final delivery outcome.
For a cable renewal, first call POST /api/v1/verify with the plan ID, recipient and subscription_type: renew. Use the returned quote_id when purchasing within 120 seconds. Verification does not debit the wallet.
If a worker is unavailable or the queue is full, Reteller returns 503 with Retry-After. Retry using the same order key; a committed order is recovered instead of charged again.
Body parameters
| Parameter | Type | Description | |
|---|---|---|---|
request_ref |
string | optional | Your unique business order ID. Required unless the Idempotency-Key header is supplied. |
quote_id |
string | optional | The current verification quote for a cable renewal. |
plan_id |
integer | required | The numeric plan ID returned by /services. |
option_id |
integer | optional | An optional add-on ID belonging to the selected plan. |
recipient |
string | required | Phone, smartcard, meter or customer ID for the service. |
amount |
number | optional | Required for manual-amount services (airtime, electricity, betting). |
meter_type |
string | optional | Electricity only — prepaid or postpaid. |
subscription_type |
string | optional | Cable only — change or renew. |
Transaction status
Use your customer reference or generated reteller_reference in the transactions URL, URL-encoded. Lookups are restricted to your account. Earlier request_ref values can be recovered for lookup when they were also the saved idempotency key. Historical references that were never saved cannot be reconstructed for old webhooks.
Retrieves a transaction by reference. Use it to resolve orders that returned pending.
Path parameters
| Parameter | Type | Description | |
|---|---|---|---|
reference |
string | required | The reference returned when the transaction was created. |
International airtime
Top up supported international mobile numbers. Airtime is priced live per country, so list operators first, then buy. Each operator is either FIXED (choose an options[] entry and send its sender value) or RANGE (send any amount between range.min and range.max). The ngn field is what your wallet is charged.
Opaque tokens: the id and code values here (and for data, gift cards and eSIMs) are opaque — send them back exactly as received; do not parse or construct them.
Query parameters
| Parameter | Type | Description | |
|---|---|---|---|
country |
string | required | ISO-3166 alpha-2 country code, e.g. US, GB, GH. |
Body parameters
| Parameter | Type | Description | |
|---|---|---|---|
request_ref |
string | optional | A unique order reference. Required unless the Idempotency-Key header is sent. Reuse it for retries. |
operator_id |
string | required | Operator id from /airtime/operators. |
amount |
number | required | A FIXED option's sender value, or any value within the RANGE. |
phone |
string | required | Recipient number in international format, e.g. +14155550123. |
country |
string | required | ISO alpha-2 country code. |
A pending status settles shortly — poll /transactions/{reference} to confirm.
International data
Data bundles for numbers abroad, using the same live list-then-buy model as airtime. Operators return real bundle sizes in their options[] labels.
Query parameters
| Parameter | Type | Description | |
|---|---|---|---|
country |
string | required | ISO alpha-2 country code. |
Body parameters
| Parameter | Type | Description | |
|---|---|---|---|
request_ref |
string | optional | A unique order reference. Required unless the Idempotency-Key header is sent. Reuse it for retries. |
operator_id |
string | required | Operator id from /data/operators. |
amount |
number | required | The chosen option's sender value. |
phone |
string | required | Recipient number in international format. |
country |
string | required | ISO alpha-2 country code. |
Gift cards
Sell branded gift cards priced live per country. The card is delivered by email to the recipient.
Query parameters
| Parameter | Type | Description | |
|---|---|---|---|
country |
string | required | ISO alpha-2 country code. |
Body parameters
| Parameter | Type | Description | |
|---|---|---|---|
request_ref |
string | optional | A unique order reference. Required unless the Idempotency-Key header is sent. Reuse it for retries. |
product_id |
string | required | Product id from /giftcards. |
amount |
number | required | A FIXED sender value, or a value within the RANGE. |
recipient_email |
string | required | Where the gift-card code is sent. |
Travel eSIMs
Global travel-data eSIMs, priced live in NGN. The flow is three steps: list plans for a destination, buy one, then fetch its QR / activation profile. Ordering is asynchronous — if the profile isn't ready, the eSIM returns PROCESSING; poll the status endpoint for it.
Query parameters
| Parameter | Type | Description | |
|---|---|---|---|
region |
string | required | ISO alpha-2 country code (US, GB), !GL for a global plan, or a region code. |
Body parameters
| Parameter | Type | Description | |
|---|---|---|---|
request_ref |
string | optional | A unique order reference. Required unless the Idempotency-Key header is sent. Reuse it for retries. |
package_code |
string | required | The code from /esim/packages. |
email |
string | required | Email associated with the order. The QR is available on its receipt. |
To install: scan qr_image, or enter activation_code manually (Settings → Add eSIM).
Read /transactions/{reference} for delivery status. This endpoint returns the QR after allocation. Refresh /esim/packages before ordering if its five-minute verified price expires.
Webhook events
For newly accepted orders, data.reference and data.request_ref contain your customer reference; data.reteller_reference contains the Reteller ID. Match callbacks using your reference, verify the raw-body signature and deduplicate by event_id. Provider details are excluded from all outgoing webhooks, including retries of previously queued events.
Orders that come back pending settle later. Rather than polling
/transactions/{reference}, set a webhook URL in
Settings → Webhook and we will POST the update to you
as soon as it happens.
When we call you
| Event | Sent when |
|---|---|
transaction.successful | The order was delivered. Any commission has been credited to your wallet. |
transaction.reversed | The order failed or was refunded. The amount is back in your wallet. |
Only real state changes are sent — a pending order that is
still pending produces nothing, and a repeated refund is not re-sent. You will never receive a
pending event, because that status is already in the response to your
/purchase call.
Request we send
Payload fields
| Parameter | Type | Description | |
|---|---|---|---|
event_id |
string | required | Stable event ID. Deduplicate repeated deliveries by this value. |
event |
string | required | One of the events above. |
sent_at |
string | required | ISO-8601 UTC payload creation time, retained across retries. |
data.reference |
string | required | Your order reference — match this against your own records. |
data.status |
string | required | successful or reversed. Always the settled value. |
data.amount |
number | required | Amount charged, in NGN. |
data.commission |
number | required | Commission earned. Reversed if the order is later refunded. |
data.message |
string | optional | Human-readable outcome. |
Responding
Reply 2xx to acknowledge. Anything else is recorded as a failed delivery.
We wait up to 5 seconds for your response, do not follow redirects, and
only call http or https URLs.
event_id. Use GET /transactions/{reference} to recover the latest order status.Signature verification
Every call carries X-Reteller-Signature — an
HMAC-SHA512 of the raw request body, keyed with your signing secret from
Settings → Webhook. Compute the same digest and compare. Two rules matter:
- Hash the raw body bytes, not a re-encoded copy of the parsed JSON — re-encoding changes key order and spacing, and the digest will not match.
- Compare with a timing-safe function (
hash_equals,crypto.timingSafeEqual), never==.
Deliveries may be retried even for the same event, and another event can arrive if an order is settled
and later refunded, so deduplicate using event_id and apply each status transition once.
The signature authenticates the exact raw body, not a timestamp-prefixed string. Persist each event_id uniquely and apply the event atomically before acknowledging it; the sample fulfil function is an application placeholder, not a complete replay-safe handler. Disabling or re-saving the webhook URL preserves the current secret; it is not a secret-rotation action.
Statuses & errors
The status field on a transaction is one of:
| Status | Meaning |
|---|---|
| successful | Delivered to the recipient. |
| pending | Accepted and settling — re-check with /transactions/{reference}, or let a webhook tell you. |
| failed | Unsuccessful. Consult the recorded transaction and wallet result; do not assume a refund from the status alone. |
| reversed | Failed and automatically refunded to your wallet. |
HTTP status codes
| Code | Meaning |
|---|---|
200 / 201 | Request handled. Inspect data.status for the delivery outcome. |
202 | Order accepted and pending; delivery is not yet confirmed. |
400 | Missing or invalid order idempotency key. |
403 | Inactive API account or source IP not allowed. |
409 | Idempotency key reused with different order details. |
503 | Service, queue, or access-policy check unavailable. If Retry-After is present, wait; preserve the same order key for retries. |
401 | Missing or invalid API keys. |
402 | Insufficient wallet balance. |
404 | Resource not found. |
422 | Validation error — see message. |
429 | Too many requests — retry after a short delay. |
500 | Unexpected server error. Retain the same order key and check its recorded reference before retrying. |
502 | Upstream provider unavailable. Check transaction status before retrying a purchase. |