<?php // Using cURL POST $key="YOUR-ACCOUNT-KEY"; $network_provider="MTN, AIRTEL, GLO, 9MOBILE"; $phone="SUBSCRIBER NUMBER"; $response = httpPost("https://api.textng.xyz/vtu-airtime/" ,array("key"=>"$key","phone"=>$phone,"network_provider"=>"$network_provider","$amount"=>"$amount")); // using php curlfunction httpPost($url, $data) { $curl =curl_init ($url);curl_setopt ($curl, CURLOPT_POST, true);curl_setopt ($curl, CURLOPT_POSTFIELDS, http_build_query($data));curl_setopt ($curl, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($curl); curl_close($curl);echo $response; } ?>
| Parameters | Example | Description |
|---|---|---|
| Key | XXXXX-XXXX-XXXXX | Your developer API key. This authorizes every request and can be found on your Developer Dashboard. |
| Phone |
08031234567 | The phone number that will receive the airtime. |
| network_provider |
MTN | The mobile network provider for the destination phone number. Example values: MTN, GLO, AIRTEL, 9MOBILE. |
| Amount |
100 | The airtime amount to purchase in Naira. |
{
"status": true ,
"message": "ORDER-COMPLETED" ,
"data": {
"reference": "REFERENCE_ID",
"purchase_amount": 100,
"amount_charged": 98.50,
"discount": 1.50
}
}
{
"status": false ,
"message": "Unable to process order at this time",
"reason": ""
}