Skip to main content
POST
Buy a data plan

Authorizations

Authorization
string
header
required

See Authentication for the full explanation of session tokens vs. API keys and when each is used.

Headers

Idempotency-Key
string
required

Required on purchase endpoints. Use a new key for each intended purchase, and reuse that same key when retrying the same request after a timeout. A completed key replays the original response. The same key with a different body is rejected. Keys expire after 24 hours. A missing key returns 400 with no error_code.

Maximum string length: 255

Body

application/json
phone
string
required
Pattern: ^0\d{10}$
amount
number
required

Must match the selected plan.

Required range: 50 <= x <= 500000
network
string
required

mtn, glo, airtel, or 9mobile.

Maximum string length: 15
tariffTypeId
string
required

Plan identifier from Get data plans.

force_provider
string | null

Force a specific provider key.

email
string<email> | null
customer_reference
string | null
Maximum string length: 100

Response

Purchased. data is a bills transaction with bill_type: data.

status
enum<string>
Available options:
success
message
string
data
object

A bills-payment debit against the partner Master account. id and every *_id are strings. Money fields are decimal strings.