Endpoint Details
HTTP Method
GET
Route Path
/api/v2/data-plans
Base URL
https://app.9jabillz.com.ng
Authentication
HMAC SHA256
Query Parameters (Optional)
| Parameter | Type | Required | Description |
|---|---|---|---|
network |
String | No | Filter plans by telecom provider name (e.g., MTN, AIRTEL, GLO, 9MOBILE). |
Required Request Headers
Pass all 6 security headers with every request. Requests missing valid signature headers will be rejected.
| 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/data-plans" + ""
Signature = LOWERCASE_HEX( HMAC_SHA256(Payload, YOUR_SECRET_KEY) )
Integration Code Examples
Select your programming language below to view implementation snippets:
<?php
$apiKey = "YOUR_LIVE_API_KEY";
$secretKey = "YOUR_LIVE_SECRET_KEY";
$path = "/api/v2/data-plans?network=MTN";
$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/data-plans" . $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/data-plans';
const url = `https://app.9jabillz.com.ng${path}?network=MTN`;
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/data-plans"
url = f"https://app.9jabillz.com.ng{path}?network=MTN"
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": "Data plans retrieved successfully.",
"data": {
"total_plans": 4,
"plans": [
{
"id": 1,
"network": "MTN",
"plan_name": "110MB Daily Plan (1 Day)",
"variation_code": "mtn-10mb-100",
"amount": 100.00,
"validity": "1"
},
{
"id": 2,
"network": "MTN",
"plan_name": "230MB Daily Plan (1 Day)",
"variation_code": "mtn-230mb-200",
"amount": 200.00,
"validity": "1"
},
{
"id": 3,
"network": "MTN",
"plan_name": "1.5GB Weekly Plan (7 Days)",
"variation_code": "mtn-1500mb-1000",
"amount": 1000.00,
"validity": "7"
},
{
"id": 4,
"network": "MTN",
"plan_name": "7GB Monthly Plan",
"variation_code": "mtn-5.5gb-3500",
"amount": 3500.00,
"validity": "30"
}
]
}
}
Response Field Definitions
| Field | Type | Description |
|---|---|---|
status |
Boolean | true for successful operations. |
message |
String | Summary response status description. |
data.total_plans |
Integer | Total number of available data plan records returned. |
plans[].id |
Integer | Internal unique data plan record ID. |
plans[].network |
String | Mobile network operator (MTN, AIRTEL, GLO, 9MOBILE). |
plans[].plan_name |
String | Title and description of the data bundle. |
plans[].variation_code |
String | Stable merchant variation code required when dispatching purchase requests to /api/v2/data-bundle. |
plans[].amount |
Number | Price charged for purchasing the plan in Naira (NGN). |
plans[].validity |
String | Validity period duration (in days or text indicator). |
Error Handling
| Status Code | 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 HTTP verb other than GET. |
500 Internal Error |
Failed to retrieve data plans. | Server or database query exception. |