speedocom.online

Airtime API

The Airtime API allows you to disburse airtime to your customer base.

Authentication

To interact with the application, you will need to acquire an APP_KEY and APP_TOKEN.

Steps to Obtain API Credentials:

  1. Log in to your QuickSMS account.
  2. On the left-side menu, click on Utility Apps.
  3. Create a new app or select an existing one.
  4. Click on Settings.
  5. Generate an APP_TOKEN and store it safely (it will only be displayed once).
  6. Copy your APP_KEY and use it in your application.

Required Headers

Header Value
Content-Type application/json
App-Key [YOUR_APP_KEY]
App-Token [YOUR_APP_TOKEN]

POST Method

Endpoint:

https://{{url}}/api/v3/airtime/send

Request Body:

{
  "recipients": [
    {"recipient": "2547XXXXXX", "amount": 100},
    {"recipient": "2547XXXXXX", "amount": 100}
  ]
}

Sample Success Response:

{
  "code": 200,
  "message": "Total:1 Success:1 Failed:0",
  "results": [
    {"recipient": "2547XXXXXXXX", "amount": 100, "code": 201, "discount": 0.4, "message": "queued for disbursal", "request_id": 10990},
    {"recipient": "2547XXXXXXXX", "amount": 100, "code": 201, "discount": 0.4, "message": "queued for disbursal", "request_id": 10991}
  ]
}

Key Considerations

Code Examples (POST Request)

<?php
$payload = json_encode([
  "recipients" => [
    ["recipient"=>"2547XXXXXX","amount"=>100],
    ["recipient"=>"2547XXXXXX","amount"=>100]
  ]
]);
$curl = curl_init();
curl_setopt_array($curl, [
  CURLOPT_URL=>"https://{{url}}/api/endpoint",
  CURLOPT_RETURNTRANSFER=>true,
  CURLOPT_POST=>true,
  CURLOPT_POSTFIELDS=>$payload,
  CURLOPT_HTTPHEADER=>["Content-Type: application/json"]
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
const axios = require('axios');
const data = { recipients: [{recipient:"2547XXXXXX",amount:100},{recipient:"2547XXXXXX",amount:100}] };
axios.post("https://{{url}}/api/endpoint", data, { headers: {"Content-Type":"application/json"} })
.then(res=>console.log(res.data))
.catch(err=>console.error(err));
import requests
url = "https://{{url}}/api/endpoint"
headers = {"Content-Type":"application/json"}
payload = {"recipients":[{"recipient":"2547XXXXXX","amount":100},{"recipient":"2547XXXXXX","amount":100}]}
response = requests.post(url,json=payload,headers=headers)
print(response.json())