Endpoint Details
HTTP Method
GET
Route Path
/api/v2/cable-tv/packages
Base URL
https://app.9jabillz.com.ng
Authentication
HMAC SHA256
Query Parameters (Optional)
| Parameter | Type | Required | Description |
|---|---|---|---|
provider |
String | No | Filter packages by provider code (e.g., dstv, gotv, startimes, showmax). |
Required Request Headers
Pass all standard security headers with every request. Requests missing valid signature headers will be rejected with 401 Unauthorized.
| Header Name | Type | Required | Description |
|---|---|---|---|
Accept |
String | Yes | Must be set to application/json |
X-API-KEY |
String | Yes | Your public API key (9ja_live_pk_...) |
X-API-SIGNATURE |
String | Yes | Hex-encoded HMAC SHA256 signature generated with your Secret Key. |
X-API-TIMESTAMP |
String | Yes | Current Unix timestamp in seconds (time()). Max skew: 300s. |
X-API-NONCE |
String | Yes | Unique random alphanumeric string per request. |
HMAC SHA256 Signature Formula (GET Request)
Signature Payload String
Payload = TIMESTAMP + NONCE + HTTP_METHOD + REQUEST_PATH + REQUEST_BODY
Example = "1792008086" + "a1b2c3d4e5" + "GET" + "/api/v2/cable-tv/packages" + ""
Signature = LOWERCASE_HEX( HMAC_SHA256(Payload, YOUR_SECRET_KEY) )
Integration Code Examples
Select your programming language below to view production-ready implementation snippets:
<?php
$apiKey = "YOUR_LIVE_API_KEY";
$secretKey = "YOUR_LIVE_SECRET_KEY";
$path = "/api/v2/cable-tv/packages?provider=dstv";
$url = "https://app.9jabillz.com.ng" . $path;
$method = "GET";
$timestamp = (string) time();
$nonce = bin2hex(random_bytes(8));$body = ""; // Empty body for GET
// Construct Pre-hash Payload String
$payload = $timestamp .$nonce . $method . "/api/v2/cable-tv/packages" . $body;
$signature = hash_hmac('sha256', $payload,$secretKey);
$headers = [
"Accept: application/json",
"X-API-KEY: " . $apiKey,
"X-API-SIGNATURE: " . $signature,
"X-API-TIMESTAMP: " . $timestamp,
"X-API-NONCE: " . $nonce
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
const axios = require('axios');
const crypto = require('crypto');
const apiKey = 'YOUR_LIVE_API_KEY';
const secretKey = 'YOUR_LIVE_SECRET_KEY';
const path = '/api/v2/cable-tv/packages';
const url = `https://app.9jabillz.com.ng${path}?provider=dstv`;
const method = 'GET';
const timestamp = Math.floor(Date.now() / 1000).toString();
const nonce = crypto.randomBytes(8).toString('hex');
const body = '';
const payload = timestamp + nonce + method + path + body;
const signature = crypto.createHmac('sha256', secretKey)
.update(payload)
.digest('hex');
axios.get(url, {
headers: {
'Accept': 'application/json',
'X-API-KEY': apiKey,
'X-API-SIGNATURE': signature,
'X-API-TIMESTAMP': timestamp,
'X-API-NONCE': nonce
}
})
.then(response => console.log(response.data))
.catch(error => console.error(error.response ? error.response.data : error.message));
import time
import secrets
import hmac
import hashlib
import requests
api_key = "YOUR_LIVE_API_KEY"
secret_key = "YOUR_LIVE_SECRET_KEY"
path = "/api/v2/cable-tv/packages"
url = f"https://app.9jabillz.com.ng{path}?provider=dstv"
method = "GET"
timestamp = str(int(time.time()))
nonce = secrets.token_hex(8)
body = ""
payload = f"{timestamp}{nonce}{method}{path}{body}"
signature = hmac.new(secret_key.encode('utf-8'), payload.encode('utf-8'), hashlib.sha256).hexdigest()
headers = {
"Accept": "application/json",
"X-API-KEY": api_key,
"X-API-SIGNATURE": signature,
"X-API-TIMESTAMP": timestamp,
"X-API-NONCE": nonce
}
response = requests.get(url, headers=headers)
print(response.json())
// Postman Pre-request Script Tab:
const secretKey = "YOUR_SECRET_KEY";
const timestamp = Math.floor(Date.now() / 1000).toString();
const nonce = Math.random().toString(36).substring(2, 15);
const method = pm.request.method.toUpperCase();
const path = pm.request.url.getPath();
const body = pm.request.body && pm.request.body.raw ? pm.request.body.raw : "";
const bodyHash = CryptoJS.SHA256(body).toString(CryptoJS.enc.Hex);
const canonicalData = [method, path, timestamp, nonce, bodyHash].join("\n");
const signature = CryptoJS.HmacSHA256(canonicalData, secretKey).toString(CryptoJS.enc.Hex);
pm.variables.set("X-API-TIMESTAMP", timestamp);
pm.variables.set("X-API-NONCE", nonce);
pm.variables.set("X-API-SIGNATURE", signature);
Response Schema
HTTP 200 OK (Success Response)
JSON Response Payload
{
"status": true,
"message": "Cable TV packages retrieved successfully.",
"data": {
"total_packages": 4,
"packages": [
{
"id": 1,
"provider": "dstv",
"package_name": "DStv Padi",
"package_code": "dstv-padi",
"price": 3600.00
},
{
"id": 2,
"provider": "dstv",
"package_name": "DStv Yanga",
"package_code": "dstv-yanga",
"price": 5100.00
},
{
"id": 3,
"provider": "gotv",
"package_name": "GOtv Smallie",
"package_code": "gotv-smallie",
"price": 1575.00
},
{
"id": 4,
"provider": "gotv",
"package_name": "GOtv Jolli",
"package_code": "gotv-jolli",
"price": 4850.00
}
]
}
}
Response Field Definitions
| Field | Type | Description |
|---|---|---|
status |
Boolean | true on success. |
message |
String | Human-readable response summary. |
data.total_packages |
Integer | Total count of cable TV packages returned. |
packages[].id |
Integer | System ID for the package record. |
packages[].provider |
String | Cable provider code (dstv, gotv, startimes, showmax). |
packages[].package_name |
String | Title and description of the subscription bouquet. |
packages[].package_code |
String | Stable merchant package code required when dispatching purchase requests to /api/v2/cable-tv. |
packages[].price |
Number | Charge amount for the subscription bouquet in Naira (NGN). |
Error Handling
| HTTP Code | Error Response Message | Description |
|---|---|---|
401 Unauthorized |
Authentication required. Invalid or missing API key or HMAC signature. | Header verification failed, timestamp expired, or signature mismatch. |
405 Method Not Allowed |
Method Not Allowed | Sent request verb other than GET. |
500 Internal Error |
Failed to retrieve cable packages. | Server or database query exception. |