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); $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=08124139638&ref=882234&webhookURL=http://testlink.com/webhook/"; $host = "https://vtuafrica.com.ng/portal/api/airtime-cash/?apikey=1234&network=mtn&sender=test@gmail.com&sendernumber=08012345678&amount=1000&sitephone=08124139638&ref=882234&webhookURL=http://testlink.com/webhook/"; //Initialize cURL. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $host); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); $data = curl_exec($ch); //Close the cURL handle. curl_close($ch); $result = json_decode($data);
EXPECTED RESPONSE
{"code":101, "description":{"Status":"Processing","Service":"Airtime2Cash", "senderNumber":"08012345678","Network":"MTN","AmountTransferred":"1000", "Charge":"20","Charge":"30","AmountPaid":"980","Current_Balance":"470", "ReferenceID":"884666332234","message":"Airtime Converssion Request Received Successfully. Your Account will be Credited immediately your Airtime is received. Thank YOU" }}
WEBHOOK PAYLOAD
{"ref":"884666332234","status":"Completed", "service":"Airtime2Cash","network":"mtn","amount":"1000", "credit":"980","Charge":"20","Previous_Balance":"0", "Current_Balance":"980","sender":"test@gmail.com","message":"Airtime2Cash Converted Succesfully" }}
EXPECTED WEBHOOK RESPONSE
For your account on VTU Africa to be Succesfully funded, you will have to supplied a valid webhook response such as "code":"101" or "status":"Completed"{"code":101,"status":"Completed","message":"Write your response or status" }}