Retrieve available data plans for all supported networks.
Data Plans
Retrieve a list of all available data plans and their IDs for use with the Data Purchase endpoint.
Endpoint
GET https://example.com/api/data_plans
Request Headers
{
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
Example Request
curl -X GET https://example.com/api/data_plans \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Response
Success (200)
Returns data plans grouped by network. Each plan includes its integer id which is used as the plan field in the Data Purchase request.
[
{
"id": 12,
"size": "1",
"volume": "GB",
"validity": "30 days",
"amount": 230,
"network": "MTN",
"type": "SME"
},
{
"id": 15,
"size": "2",
"volume": "GB",
"validity": "30 days",
"amount": 460,
"network": "MTN",
"type": "SME"
}
]
Network IDs
| ID | Network |
|---|---|
1 | MTN |
2 | Glo |
3 | 9mobile |
4 | Airtel |
Filtered Data Plans
For more advanced filtering, use the filtered endpoint:
GET https://example.com/api/data-plans-prices/filtered
Query Parameters (All Optional)
| Parameter | Type | Description |
|---|---|---|
mobile_network | integer | Filter by network ID |
data_plan_type | integer | Filter by plan type ID |
min_price | numeric | Minimum price |
max_price | numeric | Maximum price |
validity | string | Filter by validity period (e.g., "Monthly") |
Example Request
curl -X GET "https://example.com/api/data-plans-prices/filtered?mobile_network=1&min_price=100&max_price=500" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Success Response (200)
{
"success": true,
"data": [
{
"id": 1,
"name": "MTN",
"code": "mtn",
"data_active": true,
"data_plan_types": [
{
"id": 1,
"name": "SME",
"code": "sme",
"active": true,
"plans": [
{
"id": 12,
"size": "1",
"volume": "GB",
"validity": "30 days",
"validity_normalized": "Monthly",
"amount": 230,
"smart_earner_amount": 210,
"affiliate_amount": 200,
"top_user_amount": 195,
"api_amount": 220,
"formatted_price": "₦230.00",
"active": true
}
]
}
]
}
],
"filters_applied": {
"mobile_network": "MTN",
"min_price": "100",
"max_price": "500"
},
"total_plans": 8,
"message": "Filtered plans retrieved successfully"
}
Error Response (500)
{
"success": false,
"message": "Failed to fetch filtered plans",
"error": "Error details"
}
Filtered Plan Response Fields
| Field | Type | Description |
|---|---|---|
id | integer | Plan ID (use as plan in data purchase) |
size | string | Data size value |
volume | string | Data unit (e.g., "GB", "MB") |
validity | string | Raw validity string |
validity_normalized | string | Normalized validity (e.g., "Monthly", "Weekly") |
amount | number | Standard price |
smart_earner_amount | number | Smart earner price |
affiliate_amount | number | Affiliate price |
top_user_amount | number | Top user price |
api_amount | number | API user price |
formatted_price | string | Formatted price string (e.g., "₦230.00") |
active | boolean | Whether the plan is currently active |
Notes
- Plan IDs and pricing may change — always fetch the latest plans before displaying options to users
- Use the returned plan
id(integer) as theplanfield in the Data Purchase request - The filtered endpoint provides more detailed pricing tiers for different user levels