POST
/
airtime
/
buy
curl --request POST \
  --url https://api.simpu.co/airtime/buy \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "network": "Airtel",
  "amount": 1500,
  "recipient": "2348023456789",
  "callback": "https://example.com/airtime/delivery_report",
  "external_ref": "674535b2b39158b9aae90188fcec23eb"
}'
{
  "id": "674535b2b39158b9aae90188fcec23eb",
  "recipient": "2348023456789",
  "external_ref": "674535b2b39158b9aae90188fcec23eb",
  "callback": "https://example.com/airtime/delivery_report",
  "status": "pending",
  "created_datetime": "2024-06-28T23:56:38.128604+00:00",
  "network": "Airtel",
  "meta": {
    "method": "POST",
    "resource": "/airtime/buy",
    "charge": {
      "amount": 1500,
      "available_balance": 2000,
      "balance_before": 500,
      "refunded": false
    }
  }
}

Authorizations

Authorization
string
header
required

An API key to authenticate requests

Body

application/json
Buy airtime object
network
enum<string>
required

The network carrier of the airtime

Available options:
Airtel,
MTN,
Glo,
9mobile,
NTEL
Example:

"Airtel"

amount
number
required

The airtime amount to be recharged

Example:

1500

recipient
string
required

The recipient of the airtime

Example:

"2348023456789"

callback
string

This is the URL to receive delivery reports for the message

Example:

"https://example.com/airtime/delivery_report"

external_ref
string

This is a reference to the message in your system

Example:

"674535b2b39158b9aae90188fcec23eb"

Response

200
application/json
Buy airtime response
id
string

Unique ID of the SMS message

Example:

"674535b2b39158b9aae90188fcec23eb"

recipient
string

The recipient of the airtime

Example:

"2348023456789"

external_ref
string

This is a reference to the airtime in your system

Example:

"674535b2b39158b9aae90188fcec23eb"

callback
string

This is the URL to receive delivery reports for the message

Example:

"https://example.com/airtime/delivery_report"

status
enum<string>

The status of the airtime

Available options:
pending,
sent,
failed,
error,
success,
duplicate
Example:

"pending"

created_datetime
string

Date and time the airtime was created

Example:

"2024-06-28T23:56:38.128604+00:00"

network
enum<string>

The network carrier of the airtime

Available options:
Airtel,
MTN,
Glo,
9mobile,
NTEL
Example:

"Airtel"

meta
object