post https://integrations.getravenbank.com/v1/data_plans/recharge
Raven atlas api allows you to purchase mobile plans by making a POST request to the endpoint /data-plans/recharge
and parsing code
, phone_number
, provider_code
, merchant_reference
, as shown in the example below
Example Requests
var axios = require('axios');
var qs = require('qs');
var data = qs.stringify({
'code': 'glo100',
'phone_number': '09052137639',
'provider_code': '1',
'merchant_reference': '123456'
});
var config = {
method: 'post',
url: 'http://localhost:4000/data_plans/recharge',
headers: { },
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Example Response
{
"status": "success",
"message": "Data purchase successful",
"data": {
"amount": "100.00",
"phone_number": "09052137639",
"network": "GLO",
"reference": "20220823004208mj08wxzyj7iw665e9etsv",
"merchant_ref": "123456",
"amount_charged": 100
}
}