Get e-Pins by Batch ID
LIVEQuick Summary
Retrieve all e-Pins associated with a specific batch ID.
Use the batch_id returned from the e-Pin purchase endpoint to look up
previously purchased e-Pins at any time.
Endpoint
Send a GET request with the batch ID as a query parameter.
Production URL
https://pairgate.com/api/v1/epin/batch
Method
GET
Test Endpoint
https://pairgate.com/api/v1/test/epin/batch?batch_id=719967449127914
Authentication
This request requires a valid Bearer token.
| Header | Value | Description |
|---|---|---|
Authorization |
Bearer {token}
|
Your unique API authorization token |
Query Parameters
This parameter is required. Include it in the URL query string.
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
batch_id |
string | Yes | 719967449127914 |
The batch ID returned from the e-Pin purchase response |
Code Examples
Choose your preferred language below. Replace YOUR_API_KEY and batch_id with your actual values.
PHP (Laravel)
// Get e-Pins by Batch ID
$batchId = '719967449127914';
$response = Http::withHeaders([
'Authorization' => 'Bearer YOUR_API_KEY',
'Cache-Control' => 'no-cache',
])->get('https://pairgate.com/api/v1/epin/batch?batch_id=' . $batchId);
$result = $response->json();
dd($result);
cURL
curl -X GET "https://pairgate.com/api/v1/epin/batch?batch_id=719967449127914" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Cache-Control: no-cache"
Node.js
const axios = require('axios');
const getEPinsByBatch = async (batchId) => {
try {
const response = await axios.get(
'https://pairgate.com/api/v1/epin/batch',
{
params: {
batch_id: batchId
},
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Cache-Control': 'no-cache'
}
}
);
console.log(response.data);
} catch (error) {
console.error(error.response?.data || error.message);
}
};
// Example
getEPinsByBatch('719967449127914');
Python
import requests
url = "https://pairgate.com/api/v1/epin/batch"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Cache-Control": "no-cache"
}
params = {
"batch_id": "719967449127914"
}
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/epin/batch"
+ "?batch_id=" + URLEncoder.encode("719967449127914", 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());
}
Response Format
Success Response (200)
{
"code": 200,
"status": "success",
"data": {
"batch_id": "719967449127914",
"quantity": 8,
"pins": [
{
"pin": "9786586070682089",
"serial": "SN-6056A7681E",
"denomination": 500,
"price": 490
},
{
"pin": "6109470944359491",
"serial": "SN-E31C54C9A5",
"denomination": 500,
"price": 490
},
{
"pin": "0981522006555551",
"serial": "SN-0FE182448E",
"denomination": 500,
"price": 490
},
{
"pin": "9326480801054771",
"serial": "SN-CA7CB0CC28",
"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 in the batch |
pins |
array | List of e-Pins associated with the batch |
pin |
string | The recharge card PIN number |
serial |
string | The recharge card serial number |
denomination |
integer | Card denomination value in Naira |
price |
float | Price charged per e-Pin |
Error Responses
The following errors may occur when calling this endpoint.
| Status | Description |
|---|---|
| 400 | Missing or invalid batch_id parameter |
| 401 | Invalid or missing Bearer token |
| 404 | No e-Pins found for the specified batch |
| 500 | Server-side error |
Note: This endpoint returns e-Pins scoped to the batch specified via
batch_id. Use the batch_id returned from the e-Pin purchase response.