API Documentation for Fetching Data Bundles by Biller
Overview
This endpoint allows fintech developers to fetch available data bundles for a specified biller in Nigeria via MyBundlePay’s API.Important: You must first fetch available data bundle billers using the
/api/data-bundle-billers/NG
endpoint to obtain the correct biller identifiers before calling this endpoint.
POST https://mybundlepay.com/ng/api/data-bundles
HEADERS
Authorization* string
Pass your {secret_key}
as a Bearer token in the request header to authorize this call.
Content-Type* string
Must be set to application/json
BODY PARAMS
biller* string
The biller identifier obtained from the /api/data-bundle-billers/NG
endpoint, e.g. mtn-data-ng
.
RESPONSE
Success response example:
{
"status": true,
"bundles": [
{
"name": "110MB for Daily - Daily",
"price": 10000,
"code": "100_30",
"validity": "Daily",
"data": "110MB for Daily"
},
{
"name": "500MB for Daily - Daily",
"price": 35000,
"code": "350_30",
"validity": "Daily",
"data": "500MB for Daily"
}
// ... additional bundles
]
}
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://mybundlepay.com/ng/api/data-bundles',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"biller": "mtn-data-ng"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Authorization: Bearer {secret_key}'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
const axios = require('axios');
axios.post('https://mybundlepay.com/ng/api/data-bundles', {
biller: 'mtn-data-ng'
}, {
headers: {
'Authorization': 'Bearer {secret_key}',
'Content-Type': 'application/json'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error.response ? error.response.data : error.message);
});
ERROR RESPONSES
{
"message": "Invalid token",
"status": "failed"
}
{
"message": "User not found",
"status": "failed"
}
{
"message": "Business not found",
"status": "failed"
}
{
"message": "KYC not approved",
"status": "failed"
}
{
"message": "You are restricted from fetching data bundles due to suspicious activity.",
"status": "failed"
}
{
"status": false,
"message": "Unsupported country"
}