O
247API
Type to search the docs...

Airtime PIN API

Generate physical-like Airtime PINs that users can load on their devices.


Get PIN Networks

Retrieve a list of networks that support PIN generation.

GET https://247api.com.ng/api/get-pin-networks?service=airtimepin

Query Parameters

Parameter Type Required Description
service String Required Must be exactly airtimepin.
curl -X GET "https://247api.com.ng/api/get-pin-networks?service=airtimepin" \
          -H "Authorization: Token YOUR_API_KEY" \
          -H "Content-Type: application/json"
<?php
        $url = 'https://247api.com.ng/api/get-pin-networks?service=airtimepin';
        $ch = curl_init($url);
        curl_setopt_array($ch, [
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_HTTPHEADER => [
                'Authorization: Token YOUR_API_KEY',
                'Content-Type: application/json',
            ]
        ]);
        $response = curl_exec($ch);
        curl_close($ch);
        print_r(json_decode($response, true));
        ?>
const response = await fetch('https://247api.com.ng/api/get-pin-networks?service=airtimepin', {
          headers: {
            'Authorization': 'Bearer YOUR_API_KEY',
            'Content-Type': 'application/json'
          }
        });
        const data = await response.json();
        console.log(data);
import requests

        url = "https://247api.com.ng/api/get-pin-networks?service=airtimepin"
        headers = {
            "Authorization": "Bearer YOUR_API_KEY",
            "Content-Type": "application/json"
        }
        response = requests.get(url, headers=headers)
        print(response.json())

Response

✓ 200 OK
{
          "status": "success",
          "data": [
            { "id": 1, "name": "MTN PIN", "code": "MTN_PIN" },
            { "id": 2, "name": "Airtel PIN", "code": "AIRTEL_PIN" }
          ]
        }

Purchase Airtime PIN

Generate one or multiple Airtime PINs.

POST https://247api.com.ng/api/recharge_card

Request Body

Parameter Type Required Description
network Integer Yes Network ID from /get-pin-networks.
plan_type String|Integer Yes Denomination Plan id. Check plan id in API portal (e.g., 14 for 100, 17 for200, 19 for500, 16 for1000).
quantity Integer Yes Number of PINs to generate. Minimum is 1. Max 50.
business_name String Yes Name to print on the PIN slip.
request-id String Optional Idempotency key.
curl -X POST "https://247api.com.ng/api/recharge_card" \
          -H "Authorization: Token YOUR_API_KEY" \
          -H "Content-Type: application/json" \
          -d '{
            "network": 1,
            "amount": "100",
            "quantity": 2,
            "business_name": "My Shop",
            "request-id": "pin_123"
          }'
<?php
        $url = 'https://247api.com.ng/api/recharge_card';
        $payload = [
            'network' => 1,
            'plan_type' => '17',
            'quantity' => 2,
            'business_name' => 'My Shop',
            'request-id' => 'API_' . uniqid()
        ];
        $ch = curl_init($url);
        curl_setopt_array($ch, [
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_POST => true,
            CURLOPT_POSTFIELDS => json_encode($payload),
            CURLOPT_HTTPHEADER => [
                'Authorization: Token YOUR_API_KEY',
                'Content-Type: application/json',
            ]
        ]);
        $response = curl_exec($ch);
        curl_close($ch);
        print_r(json_decode($response, true));
        ?>
const response = await fetch('https://247api.com.ng/api/recharge_card', {
          method: 'POST',
          headers: {
            'Authorization': 'Bearer YOUR_API_KEY',
            'Content-Type': 'application/json'
          },
          body: JSON.stringify({
            network: 1,
            amount: '100',
            quantity: 2,
            business_name: 'My Shop',
            'request-id': 'pin_123'
          })
        });
        const data = await response.json();
        console.log(data);
import requests

        url = "https://247api.com.ng/api/recharge_card"
        headers = {
            "Authorization": "Bearer YOUR_API_KEY",
            "Content-Type": "application/json"
        }
        payload = {
            "network": 1,
            "amount": "100",
            "quantity": 2,
            "business_name": "My Shop",
            "request-id": "pin_123"
        }
        response = requests.post(url, json=payload, headers=headers)
        print(response.json())

Responses

✓ 200 OK
{
          "status": "success",
          "Status": "successful",
          "message": "Airtimepin Purchase For Hundredkey Successful. Thank you for your patronage!",
          "amount": 390,
          "old_balance": 124941,
          "new_balance": 124551,
          "request-id": "AIRTIMEPIN|CD261FC8-C91E-495D-B56B-5F30FE3B8915",
          "service": "airtimepin",
          "response": "Airtime Pin Generated successfully.",
          "api_response": "Airtime Pin Generated successfully.",
          "card_name": "Hundredkey",
          "quantity": "4",
          "network": "MTN",
          "pinsize": "100",
          "serial": "00000000000000000,00000000000000000,00000000000000000,00000000000000000",
          "pin": "11111111111111111,22222222222222222,33333333333333333,44444444444444444",
          "available": 1410
        }