Logo

Getting Started

IntroductionAuthentication

OTP

POSTRequest OTPPOSTVerify OTPDELETERevoke OTPGETGet TokenGETGet OTP by Recipient

Airtime

POSTBuy Airtime

Lists

GETGet contact listGETGet rowPOSTCreate rowPATCHUpdate rowDELETEDelete row
Logo
DocumentationAPI ReferenceChangelog

Airtime

Buy Airtime

Purchase airtime for a mobile number

Request

curl -X POST "https://api.simpu.co/airtime/buy" \
  -H "Content-Type: application/json" \
  -d '{
    "network": "Airtel",
    "amount": 1500,
    "recipient": "2348023456789",
    "callback": "https://example.com/airtime/delivery_report",
    "external_ref": "674535b2b39158b9aae90188fcec23eb"
  }'

Response

{
  "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
    }
  }
}
POST

/airtime/buy

This endpoint is deprecated and may be removed in a future version.

Request Body

application/json

Buy airtime object

network
stringrequired
The network carrier of the airtime
Allowed values: "Airtel" | "MTN" | "Glo" | "9mobile" | "NTEL"
Example: "Airtel"
amount
numberrequired
The airtime amount to be recharged
Example: 1500
recipient
stringrequired
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

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
string
The status of the airtime
Allowed values: "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
string
The network carrier of the airtime
Allowed values: "Airtel" | "MTN" | "Glo" | "9mobile" | "NTEL"
Example: "Airtel"
meta
object
No description provided
method
stringrequired
The HTTP method used to make the request
Example: "POST"
resource
stringrequired
The resource requested
Example: "/airtime/buy"
charge
object
No description provided
amount
numberrequired
Amount of the airtime to be recharged
Example: 1500
available_balance
numberrequired
Available balance of the recipient
Example: 2000
balance_before
numberrequired
Balance before recharge
Example: 500
refunded
booleanrequired
Airtime refund
Example: false

Built with Chakra UI

Request

curl -X POST "https://api.simpu.co/airtime/buy" \
  -H "Content-Type: application/json" \
  -d '{
    "network": "Airtel",
    "amount": 1500,
    "recipient": "2348023456789",
    "callback": "https://example.com/airtime/delivery_report",
    "external_ref": "674535b2b39158b9aae90188fcec23eb"
  }'

Response

{
  "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
    }
  }
}