Overview
This section outlines the recommended flow for integrating Cable Subscription services on the @jannah_opt('site_name') RESTful API.
Available Endpoints
To integrate the @jannah_opt('site_name') Cable Subscription Payment RESTful API, the following parameters apply:
- cable - The cable provider ID
- iuc - The decoder IUC number
- cable_plan - The selected plan ID
Purchase Product
To purchase a cable bundle, use a POST request with the endpoint below:
@jannah_opt('site_url')/api/cable
Code Sample
$payload = array(
'cable' => 1,
'iuc' => '080*****112',
'cable_plan' => 1,
'
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, '@jannah_opt('site_url')/api/cable');
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": "Successfully purchased DSTV joli joli ₦12000 to 070*******66"
}