Billam DevelopersAPI Documentation
BILLAM DEVELOPER PLATFORM

Build with Billam

One API platform for Nigerian digital services and Android-powered automation. Integrate Airtime, Data, Pay TV, Electricity, Recharge PIN, SMS and USSD with predictable authentication and wallet billing.

ProductionAPI v1Updated September 2026
PRODUCTION APIbillam.com.ng/api
AUTHENTICATIONBearer token
REQUEST FORMATJSON
RETRIESIdempotent

Quick start

Your first authenticated request takes three steps.

1Create an API keyGenerate a key from your developer dashboard and choose the scopes your integration needs.
2Keep it server-sideStore the Bearer token in an environment variable. Never expose it in browser or mobile code.
3Call an endpointUse plans:read for catalogues and purchase:write for reseller transactions.
YOUR FIRST REQUESTCheck available Airtime rates

Replace the token with a key that has plans:read.

REQUEST
curl https://billam.com.ng/api/reseller-airtime-networks.php   -H "Authorization: Bearer $TELECLASP_API_KEY"
RESELLER API FLOW

One pattern across every reseller service

Airtime, Data, Pay TV, Electricity and Recharge PIN follow the same integration lifecycle.

1AuthenticateVerify your key
→
2Check walletConfirm funds
→
3Load cataloguePlans / providers
→
4ValidateWhen required
→
5PurchaseSave order_uid
→
6Check statusOne status API

Account, Wallet & Orders

These endpoints are shared across the Reseller API. Use them to verify your integration, check funds and follow transactions without building a different status flow for every service.

1. Verify your API key

GET/reseller-me.phpplans:read
REQUEST
curl https://billam.com.ng/api/reseller-me.php   -H "Authorization: Bearer $TELECLASP_API_KEY"
JSON
{
  "success": true,
  "developer": {
    "id": 12
  },
  "api_key": {
    "id": 34,
    "rate_limit_per_min": 60
  },
  "environment": "live",
  "message": "API key is valid"
}

2. Check your wallet

GET/reseller-wallet.phpplans:read
REQUEST
curl https://billam.com.ng/api/reseller-wallet.php   -H "Authorization: Bearer $TELECLASP_API_KEY"
JSON
{
  "success": true,
  "wallet": {
    "currency": "NGN",
    "available": "12500.00",
    "available_kobo": 1250000,
    "held": "0.00",
    "held_kobo": 0,
    "status": "active"
  }
}
Use available_kobo for integer money arithmetic. held represents funds reserved by transactions that have not reached a final outcome.

3. Check any reseller order

GET/reseller-order-status.php?order_uid=...purchase:write

One status endpoint works across all reseller transaction services.

AirtimeDataPay TVElectricityRecharge PIN
REQUEST
curl "https://billam.com.ng/api/reseller-order-status.php?order_uid=RSA_..."   -H "Authorization: Bearer $TELECLASP_API_KEY"

The top-level shape is consistent. Fields inside order vary only where the service needs additional information such as a meter, decoder, network or recharge denomination.

JSON
{
  "success": true,
  "service": "airtime",
  "order": {
    "order_uid": "RSA_...",
    "status": "completed",
    "amount": "975.00",
    "reference": "...",
    "created_at": "2026-09-20 10:20:00",
    "completed_at": "2026-09-20 10:20:04"
  }
}
Store every returned order_uid. If a purchase is pending or your HTTP connection drops, check that order before attempting another purchase.

HTTP, Errors & Transaction States

All API responses are JSON. Check both the HTTP status code and the response body before deciding whether to retry.

HTTPMeaningRecommended action
200 / 201SuccessProcess and persist the returned identifiers
202Outcome pendingSave order_uid/job_uid and check status
400Malformed requestFix the request body or JSON
401Authentication failedCheck the Bearer token
402Insufficient balanceFund the developer wallet
403Invalid scopeUse a key with the required scope
404Not foundCheck the resource or order identifier
409ConflictInspect the existing transaction before retrying
422Validation errorCorrect the supplied fields
429Rate limitedBack off before retrying
500Internal errorRetry cautiously using the same idempotency key
502Provider failureInspect error/refund status before retrying
503Temporarily unavailableBack off and retry safely

Standard error

JSON
{
  "success": false,
  "error": "invalid_scope"
}

Common reseller transaction fields

FieldMeaning
order_uidBillam identifier for the reseller transaction
statusCurrent order state
amountAmount debited from your developer wallet
face_valueFull delivered value when different from wallet charge
discount_percentApplied discount where supported
discount_amountNaira amount saved
referenceProvider or fulfillment reference where available
failure_codeMachine-readable reason for a failed/unresolved order

Reseller states

completedpending / processingfailed / released
Never create a replacement transaction simply because you received HTTP 202 or lost the HTTP response. Query the original order_uidfirst.

Gateway API — SMS & USSD

Send text messages and dial USSD codes through an Android phone paired to your account.

Gateway uses jobs, not reseller orders. Reseller services return an order_uid. Gateway automation returns a job_uid because execution happens asynchronously on your paired Android device.
This isn't a cloud SMS service. Messages route through your own paired Android phone, not Billam's infrastructure. If that phone is off or offline, nothing sends — check /devices.php before sending anything time-sensitive.

Base URL: https://billam.com.ng/payplug/api/v1/gateway

1. Pair a device

Install the Billam Gateway app on the Android phone you want sending messages, then log in and pair it to your account. You'll confirm it's online in step 3.

2. Create an API key

From your developer dashboard, open the Gateway API tab and generate a key with the scopes you need:

ScopeGrants
gateway:readView devices, job status, and webhook history
sms:sendCreate SEND_SMS automation jobs
ussd:executeCreate EXECUTE_USSD automation jobs

The key is shown once, as tc_live_... — copy it immediately. Store it as an environment variable on your server. Never put it in frontend JavaScript, a mobile app bundle, or a public repo.

Automation jobs only accept live keys (tc_live_...). A tc_test_... key returns automation_requires_live_key.

3. Confirm you're ready

Two checks before sending anything live.

Is the key working?

REQUEST
curl https://billam.com.ng/payplug/api/v1/gateway/me.php   -H "Authorization: Bearer $TELECLASP_API_KEY"

Is your device online?

REQUEST
curl https://billam.com.ng/payplug/api/v1/gateway/devices.php   -H "Authorization: Bearer $TELECLASP_API_KEY"

Look for "online": true and copy the device_uid — every message you send needs it. A device not seen in the last 60 seconds is treated as offline and the request is rejected with gateway_offline before anything is billed.

4. Pricing — pay-as-you-go

Every automation job is billed individually at time of send. There are no plans or subscriptions — you're charged only for what you actually use, held from your wallet the moment the job is created and captured once it completes.

Service classJob typesRate
DATASEND_SMS₦5.00 per message
AIRTIMEEXECUTE_USSD₦0.50 per USSD dial

AIRTIME jobs must use EXECUTE_USSD — airtime_requires_ussd is returned otherwise. DATA jobs may use either SEND_SMS or EXECUTE_USSD, depending on what your paired SIM supports.

5. Send an SMS

REQUEST
curl -X POST https://billam.com.ng/payplug/api/v1/gateway/automation/create.php   -H "Authorization: Bearer $TELECLASP_API_KEY"   -H "Idempotency-Key: order-1042-confirmation"   -H "Content-Type: application/json"   -d '{
    "device_uid": "dev_...",
    "service_class": "DATA",
    "type": "SEND_SMS",
    "payload": {
      "to": "08012345678",
      "body": "Your order has shipped!",
      "sim_slot": 1
    }
  }'

Idempotency-Key is a unique string per message — an order ID works well. Retrying the same request with the same key returns the original job instead of creating and billing a new one.

Successful response (201):

JSON
{
  "success": true,
  "duplicate": false,
  "request_uid": "AUT-...",
  "job_uid": "JOB-...",
  "job_id": 39,
  "service_class": "DATA",
  "type": "SEND_SMS",
  "billing": {
    "mode": "payg",
    "rate_kobo": 500,
    "amount_kobo": 500,
    "status": "reserved"
  }
}
A 201 here means the job was accepted and billed as a hold, not delivered. See step 7 to confirm what actually happened — the hold is only captured once the job completes.

6. Dial a USSD code

Same endpoint, different service_class/type/payload:

REQUEST
curl -X POST https://billam.com.ng/payplug/api/v1/gateway/automation/create.php   -H "Authorization: Bearer $TELECLASP_API_KEY"   -H "Idempotency-Key: balance-check-0042"   -H "Content-Type: application/json"   -d '{
    "device_uid": "dev_...",
    "service_class": "AIRTIME",
    "type": "EXECUTE_USSD",
    "payload": {
      "code": "*323*4#",
      "sim_slot": 1
    }
  }'

The network's USSD reply (e.g. an airtime balance) appears in the job result once it completes.

7. Find out what actually happened

Option A — Poll for status (simplest to start with):

REQUEST
curl "https://billam.com.ng/payplug/api/v1/gateway/jobs/status.php?job_uid=JOB-..."   -H "Authorization: Bearer $TELECLASP_API_KEY"

Check every few seconds until status becomes success or failed.

Option B — Register a webhook (better for production): Billam calls a URL on your server the moment a job finishes (gateway.job.succeeded, gateway.job.failed), so you don't need to poll at all. Always verify the signature before trusting the payload:

CODE
$signature = hash_hmac('sha256', $timestamp . '.' . file_get_contents('php://input'), $yourWebhookSecret);
if (!hash_equals($signature, $providedSignature)) {
    http_response_code(401);
    exit;
}

Job & billing status values

StatusMeaning
pendingWaiting for the Android Gateway to pick it up
sentFetched by the device, awaiting a definitive result
successCompleted successfully — wallet hold captured
failedGateway reported a definitive failure — wallet hold released
expiredTimed out without completing — wallet hold released

Common mistakes

  • Treating 201 as delivered. It only means the job was accepted and billed as a hold — confirm via status check or webhook before assuming it sent.
  • Not checking online first. A device not seen in the last 60 seconds is rejected with gateway_offline before any wallet hold is placed.
  • Reusing an idempotency key for a different message. Each key should map to exactly one send.
  • Assuming SIM 2 exists. Single-SIM devices will reject sim_slot: 2 — check the device's sim info if unsure.
  • Sending AIRTIME as SEND_SMS. AIRTIME only supports EXECUTE_USSD — use DATA for SMS.

Error codes

CodeStatusMeaning
authentication_required401No/malformed Authorization header
invalid_api_key401Key doesn't exist, wrong prefix, or was revoked
api_key_revoked401Key was explicitly revoked
api_key_expired401Key has expired
automation_requires_live_key409A tc_test_... key was used — automation billing needs tc_live_...
insufficient_scope403Key lacks the scope this endpoint requires
invalid_idempotency_key400Missing, too short/long, or invalid characters
invalid_device_uid400Missing or malformed device_uid
invalid_service_class400service_class must be AIRTIME or DATA
invalid_job_type400type must be SEND_SMS or EXECUTE_USSD
airtime_requires_ussd400AIRTIME jobs must use EXECUTE_USSD
invalid_sim_slot400sim_slot must be 1 or 2
invalid_sms_payload400SEND_SMS payload missing/invalid to or body
invalid_ussd_payload400EXECUTE_USSD payload missing/invalid code
automation_target_not_found404device_uid/sim_slot doesn't match a paired, owned device
gateway_offline409Device not seen in the last 60 seconds
sim_verification_required409SIM hasn't completed slot verification
sim_not_ready409SIM is inactive or not ready
airtime_automation_disabled409AIRTIME automation not enabled for this line
data_automation_disabled409DATA automation not enabled, or SIM lacks the needed capability
automation_idempotency_conflict409Idempotency key reused with different request details
insufficient_wallet_balance402Account & Wallet too low to reserve this job's rate
rate_limit_exceeded429Too many requests for this key

Quick reference

ActionEndpointScope needed
Confirm your key worksGET /me.phpgateway:read
Check device statusGET /devices.phpgateway:read
Send an SMSPOST /automation/create.php (service_class: DATA, type: SEND_SMS)sms:send
Dial USSDPOST /automation/create.php (service_class: AIRTIME, type: EXECUTE_USSD)ussd:execute
Check a job's outcomeGET /jobs/status.phpgateway:read
See missed webhook deliveriesGET /webhooks/events.phpgateway:read

Reseller API — Airtime

Send airtime programmatically using your Billam developer wallet. Current network discounts are applied automatically.

Base URL: https://billam.com.ng/api/

EndpointScope
GET /reseller-airtime-networks.phpplans:read
POST /reseller-airtime-purchase.phppurchase:write

List networks and rates

REQUEST
curl https://billam.com.ng/api/reseller-airtime-networks.php   -H "Authorization: Bearer $TELECLASP_API_KEY"
JSON
{
  "success": true,
  "networks": [
    {
      "network": "MTN",
      "name": "MTN",
      "min_amount": "50.00",
      "max_amount": "50000.00",
      "discount_percent": "2.50"
    }
  ]
}

Purchase airtime

REQUEST
curl -X POST https://billam.com.ng/api/reseller-airtime-purchase.php   -H "Authorization: Bearer $TELECLASP_API_KEY"   -H "Content-Type: application/json"   -d '{
    "network": "MTN",
    "phone": "08031234567",
    "amount": 1000,
    "idempotency_key": "airtime-order-1042"
  }'

amount in the request is the full airtime value delivered. Your wallet is charged the discounted amount.

JSON
{
  "success": true,
  "order_uid": "RSA_...",
  "network": "MTN",
  "phone": "08031234567",
  "face_value": "1000.00",
  "amount": "975.00",
  "discount_percent": "2.50",
  "discount_amount": "25.00",
  "status": "completed"
}
Always send a unique idempotency_key for each intended purchase. Retrying the same request with the same key is safe.

Reseller API — Pay TV

List subscription packages, validate decoder/account numbers and purchase Pay TV subscriptions using your developer wallet.

Providers: DStv, GOtv, StarTimes, IrokoTV, AATV Radio and ACTV.

EndpointScope
GET /reseller-cable-plans.phpplans:read
POST /reseller-cable-validate.phppurchase:write
POST /reseller-cable-purchase.phppurchase:write

List providers

REQUEST
curl https://billam.com.ng/api/reseller-cable-plans.php   -H "Authorization: Bearer $TELECLASP_API_KEY"

Get provider packages

REQUEST
curl "https://billam.com.ng/api/reseller-cable-plans.php?provider=DSTV"   -H "Authorization: Bearer $TELECLASP_API_KEY"

Use the returned service_code when purchasing. The package response includes the regular price, your discount and your effective reseller price.

Validate decoder

REQUEST
curl -X POST https://billam.com.ng/api/reseller-cable-validate.php   -H "Authorization: Bearer $TELECLASP_API_KEY"   -H "Content-Type: application/json"   -d '{
    "provider": "DSTV",
    "decoder": "1234567890"
  }'
Some providers may return can_verify: false. Confirm the customer's account number yourself before purchasing for providers without online verification.

Purchase subscription

REQUEST
curl -X POST https://billam.com.ng/api/reseller-cable-purchase.php   -H "Authorization: Bearer $TELECLASP_API_KEY"   -H "Content-Type: application/json"   -d '{
    "provider": "DSTV",
    "decoder": "1234567890",
    "service_code": "<service-code-from-plans>",
    "phone": "08031234567",
    "idempotency_key": "paytv-order-1042"
  }'
JSON
{
  "success": true,
  "order_uid": "RST_...",
  "provider": "DSTV",
  "provider_name": "DStv",
  "decoder": "1234567890",
  "package_name": "...",
  "face_value": "5000.00",
  "amount": "4900.00",
  "discount_percent": "2.00",
  "discount_amount": "100.00",
  "status": "completed"
}

The full package value is sent to the provider while your developer wallet is debited at the current discounted rate.


Reseller API — Data

Buy mobile data programmatically at your own reseller wallet rate — no PIN, no customer session.

Base URL: https://billam.com.ng/api/

Get started by activating developer access and generating a key from your developer dashboard.

Authentication

Every request needs a Bearer token in the Authorization header:

REQUEST
Authorization: Bearer <public_key>.<secret>

You get this token once, when you generate a key from your dashboard. It is shown only once — copy it immediately. If lost, revoke the key and generate a new one.

Each key has scopes (plans:read, purchase:write) and its own rate limit. Calling an endpoint your key isn't scoped for returns invalid_scope.

GET /reseller-plans.php

Returns available data plans at your reseller rate.

Query parameters (optional): network — one of MTN, AIRTEL, GLO, 9MOBILE. Omit to get all networks.

REQUEST
curl https://billam.com.ng/api/reseller-plans.php?network=MTN \
  -H "Authorization: Bearer <token>"

Response:

JSON
{
  "success": true,
  "plans": [
    {
      "plan_id": 13,
      "network": "MTN",
      "plan_type": "GIFTING",
      "name": "MTN CG 200MB Monthly",
      "size": "200MB",
      "validity": "Monthly",
      "price": "80.00"
    }
  ]
}

price is your wallet rate in naira (already discounted from the customer-facing price) — this is what gets debited on purchase.

POST /reseller-purchase.php

Buys a data plan for a phone number, debiting your wallet.

Request body:

JSON
{
  "plan_id": 13,
  "phone": "08031234567",
  "idempotency_key": "your-unique-key-per-attempt"
}
  • plan_id — from /reseller-plans.php
  • phone — 11-digit local (0803...) or 13-digit international (234803...) format
  • idempotency_key — required. Reusing the same key for the same request returns the original result instead of charging again — safe to retry on network errors without double-purchasing.

Success response (200):

JSON
{
  "success": true,
  "order_uid": "RSL_20260904_ABCD123456",
  "network": "MTN",
  "phone": "08031234567",
  "plan_name": "MTN CG 200MB Monthly",
  "data_size": "200MB",
  "amount": "80.00",
  "reference": "RSL_20260904_ABCD123456",
  "status": "completed",
  "timestamp": "2026-09-04T21:30:00+01:00"
}

Failure — insufficient balance (402):

JSON
{ "success": false, "error": "insufficient_balance" }

Failure — all providers unavailable (502). No charge occurs — the hold is released automatically:

JSON
{ "success": false, "error": "all_providers_unavailable", "refunded": true }

Idempotent replay (same idempotency_key reused):

JSON
{ "success": true, "order_uid": "RSL_...", "status": "completed", "note": "idempotent_replay" }

Error codes

CodeStatusMeaning
authentication_required401No/malformed Authorization header
invalid_token401Key doesn't exist or secret is wrong
key_revoked401Key was revoked
invalid_scope403Key lacks the required scope
rate_limit_exceeded429Too many requests for this key
invalid_plan / plan_not_found422 / 404Bad or inactive plan_id
invalid_phone422Phone number format not recognized
idempotency_key_required422Missing idempotency_key
insufficient_balance402Account & Wallet too low
all_providers_unavailable502Every provider failed; refunded automatically
wallet_error500Internal error during wallet debit

Webhooks

Register a URL from your developer dashboard to receive real-time notifications instead of polling.

Events sent: purchase.completed, purchase.failed, wallet.low_balance

Delivery: POST to your URL with a JSON body matching the event. Headers include X-Webhook-Event and X-Webhook-Signature (HMAC-SHA256 of the payload, using your webhook secret). Verify it before trusting the payload. Retries with backoff (1min, 5min, 30min, 2hr), then stops.

Example verification (PHP):

CODE
$signature = hash_hmac('sha256', file_get_contents('php://input'), $yourSecret);
if (!hash_equals($signature, $_SERVER['HTTP_X_WEBHOOK_SIGNATURE'])) {
    http_response_code(401);
    exit;
}

Rate limits

Each key has its own per-minute limit (default 60/min), set when the key is created. Exceeding it returns rate_limit_exceeded (429).


Questions or issues? Reach out through your developer dashboard.


Reseller API — Recharge PIN

Purchase printable Nigerian recharge PINs programmatically using your Billam developer wallet. Successful responses contain the recharge PIN and serial number for each card.

Recharge PINs are monetary-value secrets. Never expose your Billam API key or purchased PIN responses in frontend JavaScript, browser storage, public logs, or a source repository. Call this API from your server.

Base URL: https://billam.com.ng/api/

Authentication

Recharge PIN uses the same developer key and Bearer-token authentication as the Data Reseller API:

REQUEST
Authorization: Bearer <public_key>.<secret>
EndpointRequired scope
GET /reseller-recharge-pin-plans.phpplans:read
POST /reseller-recharge-pin-purchase.phppurchase:write
GET /reseller-recharge-pin-order.phppurchase:write

Supported networks and denominations

NetworkDenominations
MTN₦100, ₦200, ₦500, ₦1,000
AIRTEL₦100, ₦200, ₦500, ₦1,000
GLO₦100, ₦200, ₦500, ₦1,000
9MOBILE₦100, ₦200, ₦500, ₦1,000

A single request may purchase between 1 and 60 cards of one network and denomination.

GET /reseller-recharge-pin-plans.php

Returns Recharge PIN denominations and your current server-authoritative reseller price. Optionally filter using network.

REQUEST
curl "https://billam.com.ng/api/reseller-recharge-pin-plans.php?network=MTN" \
  -H "Authorization: Bearer $TELECLASP_API_KEY"

Example response:

JSON
{
  "success": true,
  "plans": [
    {
      "network": "MTN",
      "denomination": "100.00",
      "denomination_kobo": 10000,
      "discount_percent": "2.50",
      "unit_price": "97.50",
      "min_quantity": 1,
      "max_quantity": 60
    }
  ]
}

unit_price is the amount charged from your developer wallet for one card at the current rate. Always use the latest plans response rather than hardcoding pricing.

POST /reseller-recharge-pin-purchase.php

Purchases one or more cards of the same network and denomination.

REQUEST
curl https://billam.com.ng/api/reseller-recharge-pin-purchase.php \
  -X POST \
  -H "Authorization: Bearer $TELECLASP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "network": "MTN",
    "denomination": 100,
    "quantity": 5,
    "business_name": "Taiwo Communications",
    "idempotency_key": "rp-order-20260910-0001"
  }'

Request fields:

FieldRequiredDescription
networkYesMTN, AIRTEL, GLO, or 9MOBILE
denominationYes100, 200, 500, or 1000
quantityYesNumber of cards, from 1 to 60
business_nameNoName to associate with printable cards
idempotency_keyYesYour unique identifier for this purchase attempt
Generate a new idempotency_key for every new purchase. If a network request is interrupted, retry the same request with the same key. Do not create a new key until the previous order outcome is known.

Successful response:

JSON
{
  "success": true,
  "order_uid": "RPR_20260910163000_ABCD123456",
  "network": "MTN",
  "denomination": "100.00",
  "quantity": 2,
  "business_name": "Taiwo Communications",
  "face_value": "200.00",
  "amount": "195.00",
  "discount_percent": "2.50",
  "discount_amount": "5.00",
  "pins": [
    {
      "pin": "1234567890123456",
      "serial": "20842836688272089595",
      "serial_number": "20842836688272089595"
    },
    {
      "pin": "9876543210987654",
      "serial": "20842836688272089596",
      "serial_number": "20842836688272089596"
    }
  ],
  "reference": "RPR_...",
  "status": "completed",
  "timestamp": "2026-09-10T16:30:00+01:00"
}

Pending provider confirmation

Telecom/provider requests are not always immediately conclusive. If Billam cannot safely determine whether a provider supplied the PIN, the order is kept pending instead of purchasing the same card again from another provider.

CODE
HTTP 202

{
  "success": false,
  "error": "purchase_processing",
  "order_uid": "RPR_...",
  "status": "pending"
}

When you receive this response, do not create a second purchase. Store the order_uid and query the order endpoint.

GET /reseller-recharge-pin-order.php

Retrieves a specific Recharge PIN order owned by the authenticated developer. Completed orders return their original PINs and serial numbers, which makes server-side recovery possible after an interrupted client response.

REQUEST
curl "https://billam.com.ng/api/reseller-recharge-pin-order.php?order_uid=RPR_..." \
  -H "Authorization: Bearer $TELECLASP_API_KEY"

A pending order returns HTTP 202. A completed order returns HTTP 200 with its original PIN array.

Idempotency

Recharge PIN purchasing is idempotent per developer. Reusing an idempotency key with the same purchase details returns the existing order instead of charging for another batch. Reusing it with different details returns idempotency_conflict.

Provider failover

Billam manages fulfillment internally. Your integration does not select a provider.

CODE
Local Billam inventory
        ↓
ClubKonnect
        ↓ (definite non-fulfillment only)
Strowallet

Explicit stock failures may safely fall through to the next source. Timeouts or ambiguous provider responses do not — the order becomes pending to prevent duplicate PIN purchases.

Error codes

CodeStatusMeaning
authentication_required401Bearer token missing
invalid_token401API token is invalid
key_revoked401API key has been revoked
invalid_scope403API key lacks the required scope
rate_limit_exceeded429API key rate limit exceeded
invalid_network422Unsupported network
invalid_plan422Unsupported network or denomination
invalid_quantity422Quantity must be between 1 and 60
invalid_business_name422Business name is invalid
idempotency_key_required422A unique idempotency key is required
idempotency_conflict409Key was previously used for different purchase details
insufficient_balance402Developer wallet cannot cover the purchase
purchase_processing202Provider outcome requires confirmation; do not create another purchase
all_providers_unavailable502No source could supply the cards; held wallet amount was released
order_not_found404Order does not belong to the authenticated developer or does not exist
fulfillment_unavailable409Completed fulfillment could not safely be returned

Production checklist

  • Call the API only from your backend/server.
  • Keep your Bearer token outside source control.
  • Generate and persist an idempotency key before every purchase.
  • Store the returned order_uid.
  • Treat HTTP 202 as pending — never immediately repurchase.
  • Protect returned PIN and serial values as monetary-value secrets.
  • Fetch current pricing from the plans endpoint.

Reseller API — Electricity

Validate a meter and purchase prepaid or postpaid electricity programmatically using your Billam developer wallet. Prepaid purchases return a vending token; postpaid purchases settle the customer's outstanding balance.

Never expose your Billam API key, customer meter details, or vending tokens in frontend JavaScript, browser storage, public logs, or a source repository. Call this API from your server.

Base URL: https://billam.com.ng/api/

Authentication

Electricity uses the same developer key and Bearer-token authentication as the Data and Recharge PIN Reseller APIs:

REQUEST
Authorization: Bearer <public_key>.<secret>
EndpointRequired scope
GET /reseller-electricity-providers.phpplans:read
POST /reseller-electricity-validate.phppurchase:write
POST /reseller-electricity-purchase.phppurchase:write
GET /reseller-electricity-order.phppurchase:write

Supported distribution companies

CodeNameMeter types
IKEJAIkeja Electric (IKEDC)Prepaid, Postpaid
EKOEko Electric (EKEDP)Prepaid, Postpaid
ABUJAAbuja (AEDC)Prepaid, Postpaid
IBADANIbadan (IBEDC)Prepaid, Postpaid
ENUGUEnugu (EEDC)Prepaid, Postpaid
BENINBenin (BEDC)Prepaid, Postpaid
JOSJos (JED)Prepaid, Postpaid
KADUNAKaduna Electric (KAEDCO)Prepaid, Postpaid
KANOKano (KEDCO)Prepaid, Postpaid
PHPort Harcourt (PHED)Prepaid, Postpaid
YOLAYola (YEDC)Prepaid, Postpaid
ABAAba ElectricPrepaid, Postpaid

Purchase amount must be between ₦100 and ₦50,000 per transaction.

GET /reseller-electricity-providers.php

Returns every supported distribution company along with the supported meter types and purchase limits.

REQUEST
curl "https://billam.com.ng/api/reseller-electricity-providers.php"   -H "Authorization: Bearer $TELECLASP_API_KEY"

Example response:

JSON
{
  "success": true,
  "providers": [
    {
      "code": "IKEJA",
      "name": "Ikeja Electric (IKEDC)",
      "meter_types": ["PREPAID", "POSTPAID"],
      "min_amount": "100.00",
      "max_amount": "50000.00"
    }
  ]
}

POST /reseller-electricity-validate.php

Verifies a meter number before you charge the customer. Always validate before purchasing — the purchase endpoint also validates internally, but confirming details with your customer first avoids paying into a wrong meter.

REQUEST
curl https://billam.com.ng/api/reseller-electricity-validate.php   -X POST   -H "Authorization: Bearer $TELECLASP_API_KEY"   -H "Content-Type: application/json"   -d '{
    "disco": "IKEJA",
    "meter_type": "PREPAID",
    "meter_number": "04123456789"
  }'

Successful response:

JSON
{
  "success": true,
  "disco": "IKEJA",
  "disco_name": "Ikeja Electric (IKEDC)",
  "meter_type": "PREPAID",
  "meter_number": "04123456789",
  "customer_name": "John Doe",
  "customer_address": "10 Example Street, Lagos",
  "meter_serial": "04123456789",
  "account_number": "04123456789"
}

POST /reseller-electricity-purchase.php

Validates the meter, then charges your developer wallet and fulfills the purchase. Prepaid responses include a vending token and units; postpaid responses confirm the bill was paid.

REQUEST
curl https://billam.com.ng/api/reseller-electricity-purchase.php   -X POST   -H "Authorization: Bearer $TELECLASP_API_KEY"   -H "Content-Type: application/json"   -d '{
    "disco": "IKEJA",
    "meter_type": "PREPAID",
    "meter_number": "04123456789",
    "amount": 1000,
    "idempotency_key": "elec-order-20260912-0001"
  }'

Request fields:

FieldRequiredDescription
discoYesDistribution company code, e.g. IKEJA
meter_typeYesPREPAID or POSTPAID
meter_numberYes6–20 digit meter number
amountYesNaira amount, ₦100 to ₦50,000
idempotency_keyYesYour unique identifier for this purchase attempt
Generate a new idempotency_key for every new purchase. If a network request is interrupted, retry the same request with the same key. Do not create a new key until the previous order outcome is known.

Successful response (prepaid):

JSON
{
  "success": true,
  "order_uid": "RSE_20260912163000_ABCD123456",
  "disco": "IKEJA",
  "disco_name": "Ikeja Electric (IKEDC)",
  "meter_type": "PREPAID",
  "meter_number": "04123456789",
  "customer_name": "John Doe",
  "customer_address": "10 Example Street, Lagos",
  "amount": "1000.00",
  "token": "4024540897615148172",
  "units": "10.42",
  "reference": "RSEP_...",
  "status": "completed",
  "timestamp": "2026-09-12T16:30:00+01:00"
}

For postpaid purchases, token and units are returned as empty strings.

Pending provider confirmation

Provider requests are not always immediately conclusive. If Billam cannot safely determine whether the provider fulfilled the purchase, the order is held pending instead of risking a duplicate vend.

CODE
HTTP 202

{
  "success": false,
  "error": "purchase_processing",
  "order_uid": "RSE_...",
  "status": "pending"
}

When you receive this response, do not create a second purchase. Store the order_uid and query the order endpoint.

GET /reseller-electricity-order.php

Retrieves a specific electricity order owned by the authenticated developer. Completed orders return the original token and units, which makes server-side recovery possible after an interrupted client response.

REQUEST
curl "https://billam.com.ng/api/reseller-electricity-order.php?order_uid=RSE_..."   -H "Authorization: Bearer $TELECLASP_API_KEY"

A pending order returns HTTP 202. A completed order returns HTTP 200 with its original token and units.

Idempotency

Electricity purchasing is idempotent per developer. Reusing an idempotency key with the same purchase details returns the existing order instead of charging again. Reusing it with different details returns idempotency_conflict.

Error codes

CodeStatusMeaning
authentication_required401Bearer token missing
invalid_token401API token is invalid
key_revoked401API key has been revoked
invalid_scope403API key lacks the required scope
rate_limit_exceeded429API key rate limit exceeded
invalid_disco422Unsupported distribution company
invalid_meter_type422Must be PREPAID or POSTPAID
invalid_meter_number422Meter number must be 6–20 digits
invalid_amount422Amount must be ₦100 to ₦50,000
idempotency_key_required422A unique idempotency key is required
idempotency_conflict409Key was previously used for different purchase details
meter_validation_failed422Provider rejected the meter details
validation_temporarily_unavailable503Meter validation could not be confirmed; retry shortly
insufficient_balance402Developer wallet cannot cover the purchase
purchase_processing202Provider outcome requires confirmation; do not create another purchase
electricity_purchase_failed502Provider rejected the purchase; held wallet amount was released
order_not_found404Order does not belong to the authenticated developer or does not exist
purchase_not_completed409Order exists but has not completed

Production checklist

  • Call the API only from your backend/server.
  • Keep your Bearer token outside source control.
  • Validate the meter and confirm details with your customer before purchasing.
  • Generate and persist an idempotency key before every purchase.
  • Store the returned order_uid.
  • Treat HTTP 202 as pending — never immediately repurchase.
  • Protect returned vending tokens as monetary-value secrets.
↑