Statum Company Logo

Recharge Mobile Users in Kenya with Statum Airtime API

With Statum's Airtime API, you can easily recharge mobile numbers across Kenya in real-time. Whether you're building apps that reward users with airtime or creating innovative payment solutions, our API provides a fast, reliable, and seamless integration experience. Plus, with SMS confirmations and robust reporting, you’ll always stay informed about your transactions.

Integration is straightforward with no complex setup required. Simply create an account, load your float, and start topping up numbers within minutes!

This API is versatile, ideal for various payment solutions, such as providing airtime allowances or using it as incentives in surveys to attract participants. You can even incorporate a Pay with Airtime API feature in your applications.

Resell Airtime & Earn Revenues

Statum has integrated with all telco billing platforms in the six countries we operate in and has built partnerships with global airtime resellers. Explore our Airtime API and earn a commission each time your users purchase airtime through our service.

Benefits of Statum’s Airtime API for Developers

Use Cases for Statum’s Airtime API

HTTP POST Resource URL

https://api.statum.co.ke/api/v2/airtime

Idempotency

Our APIs prevent duplicate transactions by rejecting similar airtime requests made within 5 minutes of each other. This safeguard helps address issues caused by network interruptions or application errors.

Airtime API Request

To top up airtime, make an HTTP POST request to the endpoint above. Include the following fields in the request body:

Parameter Type Description Example
phone_number String The phone number to be topped up, formatted in international format. 254722199199
amount String The amount of airtime to top up, in Kenyan Shillings. 50

Sample PHP Airtime API request:

<?php
// Credentials from your developer account
$consumerKey = "568473daf6614cb196caeb5f8805985f";
$consumerSecret = "5a07f41de16e40e4b08b4001142a5a10";
$auth = base64_encode($consumerKey . ":" . $consumerSecret);

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.statum.co.ke/api/v2/airtime',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
         "phone_number": "254721553678",
         "amount": "50"
        }',
  CURLOPT_HTTPHEADER => array(
        "Authorization: Basic $auth",
        "Content-Type: application/json"
      ),
));

$response = curl_exec($curl);
curl_close($curl);
echo $response;

API Response

The response will be a JSON object containing the following fields:

Parameter Type Description Example
status_code Number The status code of the transaction. 200
description String Description of the transaction status. Operation successful
request_id String Unique reference number assigned by the Statum API. 35235f08c981474abd388755ed43a427

Sample API response payload:

{
    "status_code": 200,
    "description": "Operation successful.",
    "request_id": "35235f08c981474abd388755ed43a427"
}

Airtime API Notifications

The Airtime API provides notifications for specific events, such as successful airtime delivery. To receive these notifications, you must set up a callback URL in your developer account.

Notification POST parameters will include:

Parameter Type Description Example
request_id String Unique reference number assigned by the Statum API. 35235f08c981474abd388755ed43a427
result_code String Result code of the transaction. 200
result_desc String Description of the delivery status. You have topped up 254721553678 with Ksh. 50.

Sample notification payload:

{
  "result_code": "200",
  "result_desc": "You have topped up 254721553678 with Ksh. 50.",
  "request_id": "35235f08c981474abd388755ed43a427"
}
Statum. All rights reserved. © 2017 - 2024