Data Plan Categories
LIVEQuick Summary
Returns all available data plan categories grouped by network provider. Use this endpoint to discover plan types (such as SME, Gifting, CG, etc.) across all supported networks before fetching specific plans for purchase.
Endpoint
Send a GET request to retrieve all data plan categories across all network providers. No request body or query parameters are required.
https://pairgate.com/api/v1/data-plans/categories
https://pairgate.com/api/v1/test/data-plans/categories
Authentication
This request requires a valid Bearer token.
| Header | Value | Description |
|---|---|---|
Authorization |
Bearer {token}
|
Your unique API authorization token |
Code Examples
Choose your preferred language below. Replace YOUR_API_KEY with your actual API key.
// Get Data Plan Categories
$response = Http::withHeaders([
'Authorization' => 'Bearer YOUR_API_KEY',
'Cache-Control' => 'no-cache',
])->get('https://pairgate.com/api/v1/data-plans/categories');
$result = $response->json();
dd($result);
curl -X GET "https://pairgate.com/api/v1/data-plans/categories" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Cache-Control: no-cache"
const axios = require('axios');
const getDataPlanCategories = async () => {
try {
const response = await axios.get(
'https://pairgate.com/api/v1/data-plans/categories',
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Cache-Control': 'no-cache'
}
}
);
console.log(response.data);
} catch (error) {
console.error(error.response?.data || error.message);
}
};
getDataPlanCategories();
import requests
url = "https://pairgate.com/api/v1/data-plans/categories"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Cache-Control": "no-cache"
}
try:
response = requests.get(url, headers=headers)
response.raise_for_status()
data = response.json()
print(data)
except requests.exceptions.RequestException as e:
print(f"Error: {e}")
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://pairgate.com/api/v1/data-plans/categories"))
.header("Authorization", "Bearer YOUR_API_KEY")
.header("Cache-Control", "no-cache")
.GET()
.build();
try {
HttpResponse response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
} catch (Exception e) {
System.err.println("Error: " + e.getMessage());
}
Response Format
A successful request returns a 200 status with an array of plan categories
grouped by network provider.
Success Response (200)
{
"code": 200,
"status": "success",
"data": [
{
"provider_id": "550e8400-e29b-41d4-a716-446655440000",
"provider_name": "MTN",
"service_type": "data",
"plan_type": "CG"
},
{
"provider_id": "550e8400-e29b-41d4-a716-446655440000",
"provider_name": "MTN",
"service_type": "data",
"plan_type": "SME"
},
{
"provider_id": "660e8400-e29b-41d4-a716-446655440001",
"provider_name": "Airtel",
"service_type": "data",
"plan_type": "GIFTING"
}
]
}
Response Fields
| Field | Type | Description |
|---|---|---|
provider_id |
string | Provider UUID |
provider_name |
string | Network provider name |
service_type |
string | Service type (always data) |
plan_type |
string | Plan category label |
Plan Type Labels
Each plan type represents a different category of data plans available for purchase.
| Label | Description |
|---|---|
CG |
Standard data plans |
CG_LITE |
Lite data plans |
SME |
Small business plans |
GIFTING |
Data gifting plans |
AWOOF |
Promotional plans |
Error Responses
The following errors may occur when calling this endpoint.
| Status | Code | Description |
|---|---|---|
| 401 | Missing API key |
No Bearer token provided |
| 401 | Invalid API key |
Token does not match any active key |
| 403 | Suspended |
API key or account has been suspended |
| 429 | Rate limited |
Too many requests |