# Payonetime Developers API Base URL: https://api.developers.payonetime.ng/v1 Sell airtime, data, electricity and TV. **Authentication:** `Authorization: Bearer sk_test_…`. Secret keys belong on your server only. Public keys can read the catalogue. **Money** is always a whole number of kobo. **Sale state:** `successful`, `failed`, `pending` or `reversed`. The outer `status` says the request was accepted; `state` says what happened to the money. **Pending is not failed:** do not send the sale again with a new reference. Wait for the webhook or call GET /transactions/{reference}. **HTTP codes for purchases:** 200 when final, 202 while pending. **Webhooks:** events `transaction.successful`, `transaction.failed`, `transaction.reversed`. Verify `X-Payonetime-Signature` = HMAC-SHA256(`X-Payonetime-Timestamp` + "." + raw body, your signing secret). Reject old timestamps; handle each `X-Payonetime-Event-Id` once. Failed deliveries are retried for about 24 hours. **Test mode:** the last four digits of the phone, meter or smartcard choose the result: 0001 fails, 0002 pending then succeeds, 0003 pending then fails, 0004 times out then succeeds, 0005 stays pending, 0009 meter or smartcard not found. Anything else succeeds. **Errors:** `INVALID_KEY` (401), `KEY_NOT_ALLOWED` (403), `IP_NOT_ALLOWED` (403), `ACCOUNT_NOT_ACTIVE` (403), `VALIDATION_FAILED` (422), `INVALID_PHONE` (422), `PLAN_UNAVAILABLE` (422), `METER_NOT_FOUND` (422), `SMARTCARD_NOT_FOUND` (422), `AMOUNT_OUT_OF_RANGE` (422), `INSUFFICIENT_BALANCE` (402), `REFERENCE_REUSED` (409), `DUPLICATE_PURCHASE` (409), `LIMIT_EXCEEDED` (403), `NUMBER_BLOCKED` (403), `SERVICE_UNAVAILABLE` (503), `NOT_FOUND` (404), `METHOD_NOT_ALLOWED` (405), `RATE_LIMITED` (429), `PROCESSING_ERROR` (500). ## Endpoints ### GET /ping — Ping Check your key. ```sh curl -X GET "https://api.developers.payonetime.ng/v1/ping" \ -H "Authorization: Bearer $PAYONETIME_SECRET" ``` ### GET /services — Services Services and whether each is available. ```sh curl -X GET "https://api.developers.payonetime.ng/v1/services" \ -H "Authorization: Bearer $PAYONETIME_SECRET" ``` ### GET /data/plans — Data plans Data plans and prices. With a secret key, your commission too. - network (string, query): mtn, airtel, glo or 9mobile - type (string, query): standard or saver ```sh curl -X GET "https://api.developers.payonetime.ng/v1/data/plans" \ -H "Authorization: Bearer $PAYONETIME_SECRET" ``` ### GET /tv/packages — TV packages TV packages and prices. - provider (string, query): dstv, gotv or startimes ```sh curl -X GET "https://api.developers.payonetime.ng/v1/tv/packages" \ -H "Authorization: Bearer $PAYONETIME_SECRET" ``` ### GET /electricity/companies — Electricity companies Electricity companies and limits. ```sh curl -X GET "https://api.developers.payonetime.ng/v1/electricity/companies" \ -H "Authorization: Bearer $PAYONETIME_SECRET" ``` ### POST /verify/meter — Verify meter Name on an electricity meter. - company (string, body, required): Company ID. - meter_type (string, body, required): Meter type. - meter (string, body, required): Meter number. In test mode the last four digits choose the outcome. ```sh curl -X POST "https://api.developers.payonetime.ng/v1/verify/meter" \ -H "Authorization: Bearer $PAYONETIME_SECRET" \ -H "Content-Type: application/json" \ -d '{"company":"ikeja","meter_type":"prepaid","meter":"45012345678"}' ``` ### POST /verify/smartcard — Verify smartcard Name on a TV smartcard. - provider (string, body, required): TV provider. - smartcard (string, body, required): Smartcard number. In test mode the last four digits choose the outcome. ```sh curl -X POST "https://api.developers.payonetime.ng/v1/verify/smartcard" \ -H "Authorization: Bearer $PAYONETIME_SECRET" \ -H "Content-Type: application/json" \ -d '{"provider":"dstv","smartcard":"7027000111"}' ``` ### POST /airtime — Airtime Buy airtime. - reference (string, body, required): Your own unique ID for this sale (4 to 64 letters, numbers, . _ -). Sending it again returns the first result and never charges twice. - network (string, body, required): Network. - phone (string, body, required): Nigerian mobile number. - amount (integer, body, required): Amount in kobo as a whole number (100000 is ₦1,000). - allow_duplicate (boolean, body): Optional. Send true to buy the same number and amount again within the duplicate guard window (live only). ```sh curl -X POST "https://api.developers.payonetime.ng/v1/airtime" \ -H "Authorization: Bearer $PAYONETIME_SECRET" \ -H "Content-Type: application/json" \ -d '{"reference":"order-10001","network":"mtn","phone":"08031234567","amount":100000}' ``` ### POST /data — Data Buy a data plan. The plan decides whether it is Standard or Saver. - reference (string, body, required): Your own unique ID for this sale (4 to 64 letters, numbers, . _ -). Sending it again returns the first result and never charges twice. - phone (string, body, required): Nigerian mobile number. - plan_id (string, body, required): From GET /data/plans. - allow_duplicate (boolean, body): Optional. Send true to buy the same number and amount again within the duplicate guard window (live only). ```sh curl -X POST "https://api.developers.payonetime.ng/v1/data" \ -H "Authorization: Bearer $PAYONETIME_SECRET" \ -H "Content-Type: application/json" \ -d '{"reference":"order-10001","phone":"08031234567","plan_id":"dp_mtn_sv_1gb"}' ``` ### POST /electricity — Electricity Pay electricity. Prepaid returns a token. - reference (string, body, required): Your own unique ID for this sale (4 to 64 letters, numbers, . _ -). Sending it again returns the first result and never charges twice. - company (string, body, required): Company ID. - meter_type (string, body, required): Meter type. - meter (string, body, required): Meter number. In test mode the last four digits choose the outcome. - amount (integer, body, required): Amount in kobo as a whole number (100000 is ₦1,000). - phone (string, body, required): Nigerian mobile number. - allow_duplicate (boolean, body): Optional. Send true to buy the same number and amount again within the duplicate guard window (live only). ```sh curl -X POST "https://api.developers.payonetime.ng/v1/electricity" \ -H "Authorization: Bearer $PAYONETIME_SECRET" \ -H "Content-Type: application/json" \ -d '{"reference":"order-10001","company":"ikeja","meter_type":"prepaid","meter":"45012345678","amount":500000,"phone":"08031234567"}' ``` ### POST /tv — TV Renew a TV subscription. - reference (string, body, required): Your own unique ID for this sale (4 to 64 letters, numbers, . _ -). Sending it again returns the first result and never charges twice. - package_id (string, body, required): From GET /tv/packages. - smartcard (string, body, required): Smartcard number. In test mode the last four digits choose the outcome. - phone (string, body, required): Nigerian mobile number. - allow_duplicate (boolean, body): Optional. Send true to buy the same number and amount again within the duplicate guard window (live only). ```sh curl -X POST "https://api.developers.payonetime.ng/v1/tv" \ -H "Authorization: Bearer $PAYONETIME_SECRET" \ -H "Content-Type: application/json" \ -d '{"reference":"order-10001","package_id":"tv_dstv_compact","smartcard":"7027000111","phone":"08031234567"}' ``` ### GET /balance — Balance Main, commission and on-hold balances in kobo. ```sh curl -X GET "https://api.developers.payonetime.ng/v1/balance" \ -H "Authorization: Bearer $PAYONETIME_SECRET" ``` ### GET /transactions — Transactions Your sales, newest first. - state (string, query): pending, successful, failed or reversed - service (string, query): airtime, data, electricity or tv - limit (string, query): 1 to 100, default 20 - cursor (string, query): next_cursor from the previous page - from (string, query): Start date, e.g. 2026-11-01 - to (string, query): End date ```sh curl -X GET "https://api.developers.payonetime.ng/v1/transactions" \ -H "Authorization: Bearer $PAYONETIME_SECRET" ``` ### GET /transactions/{reference} — Transaction The source of truth for one sale. - reference (string, path, required): ```sh curl -X GET "https://api.developers.payonetime.ng/v1/transactions/order-10001" \ -H "Authorization: Bearer $PAYONETIME_SECRET" ``` ### GET /commissions — Commissions Commission you have earned. - limit (string, query): 1 to 100, default 20 - cursor (string, query): next_cursor from the previous page - from (string, query): Start date, e.g. 2026-11-01 - to (string, query): End date ```sh curl -X GET "https://api.developers.payonetime.ng/v1/commissions" \ -H "Authorization: Bearer $PAYONETIME_SECRET" ``` Full specification: https://developers.payonetime.ng/openapi/v1.json