BILLS PAYMENT
Get Data Plans
List the available data bundle packages for a given network, so you can pick a package_id to purchase.
GET /v1/bills/data-plans
Use this endpoint to
- List all data plans available on a network
- Get the
package_idand price to show a customer before they buy - Confirm the exact amount that will be charged for a plan
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
network |
string | Yes | A data biller slug from Get Billers (e.g. MTN_NIGERIA) |
Code Samples
const response = await fetch(
"https://sandbox.hitchpay.ng/v1/bills/data-plans?network=MTN_NIGERIA",
{
method: "GET",
headers: {
Authorization: "Bearer YOUR_ACCESS_TOKEN"
}
}
);
const data = await response.json();
console.log(data);<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => "https://sandbox.hitchpay.ng/v1/bills/data-plans?network=MTN_NIGERIA",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_ACCESS_TOKEN"
]
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;import requests
url = "https://sandbox.hitchpay.ng/v1/bills/data-plans"
params = {"network": "MTN_NIGERIA"}
headers = {"Authorization": "Bearer YOUR_ACCESS_TOKEN"}
response = requests.get(url, params=params, headers=headers)
print(response.json())Response
{
"status": "success",
"message": "Data plans retrieved",
"data": [
{
"package_id": "12345",
"biller_id": "…",
"name": "1GB - 30 days",
"amount": 500,
"network": "MTN_NIGERIA"
}
]
}Fields
| Field | Type | Description |
|---|---|---|
package_id |
string | Pass this in the package_id field of Buy Data |
biller_id |
string | Internal biller identifier |
name |
string | Plan name / description |
amount |
number | Price in NGN, this is what will actually be charged |
network |
string | Echoes the requested network slug |
Note: The amount Shown here is the amount that will be charged when you purchase this plan. The purchase endpoint does not accept a client-supplied amount for data, it always uses the plan's price.
Errors
| Code | Meaning |
|---|---|
INVALID_REQUEST |
network missing or not a recognized slug |
UNAUTHORIZED |
Business not found or inactive |
PRODUCT_UNAVAILABLE |
No data plans configured for this network |
Questions? Email [email protected]. Also on GitBook.