Airtime To Cash conversion API Integration
Airtime To Cash conversion API Integration
This section contains your RESTful API for Airtime To Cash conversion API integration.
Airtime To Cash conversion API Integration
Airtime To Cash conversion API Integration
This section contains your RESTful API for Airtime To Cash conversion API integration.
The VTU Africa API uses API Key for Authentication.
Please use your APIKEY for authentication
Base URL: https://vtuafrica.com.ng/portal/api/merchant-verify/
Parameters: as specified in the parameters below:
| PARAMETERS | Required/Optional | TYPE | DESCRIPTION |
| apikey | R | String | The reseller gateway API key created at vtuafrica.com.ng |
| serviceName | R | String | This is the Name of the service you are verifiying. In this case it is: Airtime2Cash |
| network | R | String | The Network of the airtime you want to convert. These includes: mtn, airtel, glo, 9mobile |
SAMPLE CODE
$host ="https://vtuafrica.com.ng/portal/api/merchant-verify/?apikey=1234&serviceName=Airtime2Cash&network=mtn";
//Initialize cURL.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $host);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
// Set custom headers
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Accept: application/json, text/plain, */*'
]);
// Set the User-Agent
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36');
$data = curl_exec($ch);
//Close the cURL handle.
curl_close($ch);
$response = json_decode($data);
EXPECTED RESPONSE
{"code":101,
"description":{"Status":"Completed","Phone_Number":"08124139638","Network":"MTN",
"message":"MTN Airtime To Cash Service Is Available. Kindly Transfer The Exact Amount To Convert into Our Phone Number: 08124139638"
} }
Live URL: https://vtuafrica.com.ng/portal/api/airtime-cash/
Sandbox: https://vtuafrica.com.ng/portal/api-test/airtime-cash/
Parameters: as specified in the parameters below:
NOTE: After verification, you are to first Transfer the airtime to the phone number given before proceeding.
| PARAMETERS | Required/Optional | TYPE | DESCRIPTION |
| apikey | R | String | The USER API key created at https://vtuafrica.com.ng. |
| network | R | String | The Network you are converting. These include: mtn, airtel, glo and 9mobile |
| sender | R | String | The email address of the user in your website or any other Unique identifier which you can use to identify and fund the user in your website upon completion. |
| sendernumber | R | Number | The phone number where the Airtime was transferred from. That is, the user phone number. |
| amount | R | Number | The amount you wish to Convert, which you have already sent to the phone number given during the service verification. |
| ref | R | String | This is a unique reference with which you can use to execute and query the transaction. |
| sitephone | O | Number | This is our phone number which was given to you during the service verification. That is, the phone number where you transferred the airtime to. |
| webhookURL | O | URL | This is a webhook URL for notification of the final status of the airtime Convertion. If not provided, the webhook in your profile will be used. Please include http:// or https:// |
SAMPLE CODE
$sandbox = "https://vtuafrica.com.ng/portal/api-test/airtime-cash/?apikey=1234&network=mtn&sender=test@gmail.com&sendernumber=08012345678&amount=1000&sitephone=