Overview
This section outlines the recommended flow for integrating Electricity Bill Subscription services on the @jannah_opt('site_name') RESTful API.
Available Endpoints
To integrate the @jannah_opt('site_name') Electricity Bill Subscription Payment RESTful API, the following parameters apply:
- disco - The electricity provider ID
- meter_type - The type of meter (prepaid/postpaid)
- meter_number - The meter number
- amount - The amount to be paid
Purchase Product
To purchase an electricity bill bundle, use a POST request with the endpoint below:
@jannah_opt('site_url')/api/bill
Code Sample
$payload = array(
'disco' => 1,
'meter_type' => 'prepaid',
'meter_number' => '080*****112',
'amount' => 300
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, '@jannah_opt('site_url')/api/bill');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$headers = [
"Authorization: Bearer {{ $user->api_token }}",
'Content-Type: application/json'
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
Expected Response
{
"status": "success",
"message": "Transaction successful for electricity bill payment of ₦300 to meter number 070*******66"
}