O
suruleredatacom
Type to search the docs...

Data PIN API

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


Get PIN Networks

Retrieve a list of networks that support PIN generation.

GET https://suruleredatacom.com.ng/api/get-pin-networks?service=mtn

Query Parameters

Parameter Type Required Description
service String Required Must be exactly Datapin.
curl -X GET "https://suruleredatacom.com.ng/api/get-pin-networks?service=Datapin" \
          -H "Authorization: Token YOUR_API_KEY" \
          -H "Content-Type: application/json"
<?php
        $url = 'https://suruleredatacom.com.ng/api/get-pin-networks?service=Datapin';
        $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://suruleredatacom.com.ng/api/get-pin-networks?service=Datapin', {
          headers: {
            'Authorization': 'Bearer YOUR_API_KEY',
            'Content-Type': 'application/json'
          }
        });
        const data = await response.json();
        console.log(data);
import requests

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

Response

✓ 200 OK
{
          [
  {
    "plan_id": 1,
    "day": "30",
    "type": "SME PIN",
    "network": "MTN",
    "datasize": "500MB",
    "price": 450
  },
  {
    "plan_id": 2,
    "day": "30",
    "type": "SME PIN",
    "network": "MTN",
    "datasize": "1GB",
    "price": 650
  }
]
        }

Purchase Data PIN

Generate one or multiple Data PINs.

POST https://suruleredatacom.com.ng/api/data_card

Request Body

Parameter Type Required Description
network Integer Yes Network ID from /get-pin-networks.
amount String|Integer Yes Denomination amount (e.g., 100, 200, 500, 1000).
quantity Integer Optional Number of PINs to generate. Defaults to 1. Max 50.
business_name String Optional Name to print on the PIN slip.
request-id String Optional Idempotency key.
curl -X POST "https://suruleredatacom.com.ng/api/data_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://suruleredatacom.com.ng/api/data_card';
        $payload = [
            'network' => 1,
            'amount' => '100',
            '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://suruleredatacom.com.ng/api/data_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://suruleredatacom.com.ng/api/data_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": "Datapin Purchase For Hundredkey Successful. Thank you for your patronage!",
          "amount": 390,
          "old_balance": 124941,
          "new_balance": 124551,
          "request-id": "Datapin|CD261FC8-C91E-495D-B56B-5F30FE3B8915",
          "service": "Datapin",
          "response": "Data PIN Generated successfully.",
          "api_response": "Data PIN Generated successfully.",
          "card_name": "Hundredkey",
          "quantity": "4",
          "network": "MTN",
          "pinsize": "100",
          "serial": "00000000000000000,00000000000000000,00000000000000000,00000000000000000",
          "pin": "11111111111111111,22222222222222222,33333333333333333,44444444444444444",
          "available": 1410
        }