Data Plans

LIVE
Endpoint

Send a GET request with query parameters to filter plans by provider and plan category.

Production URL
https://pairgate.com/api/v1/data-plans
Method GET
Authentication

This request requires a valid Bearer token.

Header Value Description
Authorization
Bearer {token}
Your unique API authorization token
Query Parameters

Both parameters are required. Include them in the URL query string.

Parameter Type Required Description
provider_id string Yes Provider slug (e.g. mtn, airtel, glo, 9mobile)
plan_type string Yes Plan category label: CG, CG_LITE, SME, GIFTING, AWOOF
Code Examples

Choose your preferred language below. Example shows fetching MTN SME data plans. Replace the parameters and YOUR_API_KEY with your actual values.

PHP (Laravel)
// Get Data Plans
$response = Http::withHeaders([
    'Authorization' => 'Bearer YOUR_API_KEY',
    'Cache-Control' => 'no-cache',
])->get('https://pairgate.com/api/v1/data-plans?provider_id=mtn&plan_type=SME');

$result = $response->json();

dd($result);
cURL
curl -X GET "https://pairgate.com/api/v1/data-plans?provider_id=mtn&plan_type=SME" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Cache-Control: no-cache"
Node.js
const axios = require('axios');

const getDataPlans = async (providerId, planType) => {
    try {
        const response = await axios.get(
            'https://pairgate.com/api/v1/data-plans',
            {
                params: {
                    provider_id: providerId,
                    plan_type: planType
                },
                headers: {
                    'Authorization': 'Bearer YOUR_API_KEY',
                    'Cache-Control': 'no-cache'
                }
            }
        );
        
        console.log(response.data);
    } catch (error) {
        console.error(error.response?.data || error.message);
    }
};

// Example: get MTN SME plans
getDataPlans('mtn', 'SME');
Python
import requests

url = "https://pairgate.com/api/v1/data-plans"

headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Cache-Control": "no-cache"
}

params = {
    "provider_id": "mtn",
    "plan_type": "SME"
}

try:
    response = requests.get(url, headers=headers, params=params)
    response.raise_for_status()
    data = response.json()
    print(data)
except requests.exceptions.RequestException as e:
    print(f"Error: {e}")
Java
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;

HttpClient client = HttpClient.newHttpClient();

String url = "https://pairgate.com/api/v1/data-plans"
    + "?provider_id=" + URLEncoder.encode("mtn", StandardCharsets.UTF_8)
    + "&plan_type=" + URLEncoder.encode("SME", StandardCharsets.UTF_8);

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create(url))
    .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());
}
Test Endpoint

Use the test endpoint to try without spending real money.

https://pairgate.com/api/v1/test/data-plans?provider_id=mtn&plan_type=CG
Response Format

A successful request returns a 200 status with plans grouped by provider name.

Success Response (200)
{
  "code": 200,
  "status": "success",
  "data": {
    "MTN": [
      {
        "plan_id": "45",
        "name": "MTN 1GB Monthly",
        "price": 500.00
      },
      {
        "plan_id": "46",
        "name": "MTN 2GB Monthly",
        "price": 900.00
      }
    ]
  }
}
Response Fields
Field Type Description
plan_id string Plan ID for use in purchase requests
name string Plan description
price float Plan cost in Naira (NGN)
The response is grouped by provider name for easy access.
Error Responses

The following errors may occur when calling this endpoint.

Status Code Description
422 Invalid provider Provider not found or inactive
422 Invalid plan type Plan type label not recognised
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