e-Pin Purchase
LIVEQuick Summary
Purchase e-Pins (electronic PINs) from supported telecom providers. A successful request initiates a purchase order and returns the generated e-Pins for the specified denomination and quantity. Pins are delivered instantly in the response.
Endpoint
Send a POST request with the purchase details in the request body.
https://pairgate.com/api/v1/epin/purchase
https://pairgate.com/api/v1/test/epin/purchase
Authentication
This request requires a valid Bearer token.
| Header | Value | Description |
|---|---|---|
Authorization |
Bearer {token}
|
Your unique API authorization token |
Request Body Parameters
The request body should be sent as form-data.
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
provider_id |
string | Yes | mtn |
The e-Pin provider. Supported: mtn, glo, airtel, 9mobile |
quantity |
integer | Yes | 2 |
The number of e-Pins to purchase |
denomination |
integer | Yes | 100 |
The card denomination value (e.g. 100, 200, 500) |
reference |
string | Yes | epin-order-1rr001mmb |
A unique reference string for this transaction. Must be unique per request |
Code Examples
Choose your preferred language below. Replace YOUR_API_KEY with your actual API key.
// Purchase e-Pins
$response = Http::withHeaders([
'Authorization' => 'Bearer YOUR_API_KEY',
'Content-Type' => 'application/json',
])->post('https://pairgate.com/api/v1/epin/purchase', [
'provider_id' => 'mtn',
'quantity' => 1,
'denomination' => 100,
'reference' => 'epin-order-1rr001mmb',
]);
$result = $response->json();
dd($result);
curl -X POST "https://pairgate.com/api/v1/epin/purchase" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider_id": "mtn",
"quantity": 1,
"denomination": 100,
"reference": "epin-order-1rr001mmb"
}'
const axios = require('axios');
const purchaseEPins = async () => {
try {
const response = await axios.post(
'https://pairgate.com/api/v1/epin/purchase',
{
provider_id: 'mtn',
quantity: 1,
denomination: 100,
reference: 'epin-order-1rr001mmb'
},
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
}
);
console.log(response.data);
} catch (error) {
console.error(error.response?.data || error.message);
}
};
purchaseEPins();
import requests
import json
url = "https://pairgate.com/api/v1/epin/purchase"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"provider_id": "mtn",
"quantity": 1,
"denomination": 100,
"reference": "epin-order-1rr001mmb"
}
try:
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
data = response.json()
print(json.dumps(data, indent=2))
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();
String jsonBody = "{"
+ "\"provider_id\": \"mtn\","
+ "\"quantity\": 1,"
+ "\"denomination\": 100,"
+ "\"reference\": \"epin-order-1rr001mmb\""
+ "}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://pairgate.com/api/v1/epin/purchase"))
.header("Authorization", "Bearer YOUR_API_KEY")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(jsonBody))
.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
Success Response (200)
{
"code": 200,
"status": "success",
"data": {
"batch_id": "719967449127914",
"quantity": 1,
"pins": [
{
"pin": "9786586070682089",
"serial": "SN-6056A7681E",
"denomination": 500,
"price": 490
}
]
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
batch_id |
string | Unique batch identifier for the purchase order |
quantity |
integer | Number of e-Pins purchased |
pins |
array | List of generated e-Pins |
pin |
string | The recharge card PIN number |
serial |
string | The recharge card serial number |
denomination |
integer | Card denomination value in Naira |
price |
float | Actual price charged per e-Pin |
Error Responses
The following errors may occur when calling this endpoint.
| Status | Description |
|---|---|
| 400 | Missing or invalid request parameters |
| 401 | Invalid or missing Bearer token |
| 422 | Duplicate reference or insufficient balance |
| 500 | Server-side error |
reference value is unique for every purchase request
to avoid duplicate transaction errors.