Get a purchase
/airtime/v1/purchases/{id}Returns a purchase by its id. Use it to check a PENDING purchase or to look up an earlier purchase.
Path parameters
- The purchase id returned by POST /purchases.Example:
8d60dc7f-78a2-4ed5-99d9-d1dfeb2338d0
Ponitor checks a PENDING purchase every 30 seconds for up to an hour. If you poll, wait 30 to 60 seconds between calls. A webhook tells you when it settles.
Example request
- curl
- Node.js
- Python
- PHP
curl "https://sandbox-api.ponitor.com/airtime/v1/purchases/8d60dc7f-78a2-4ed5-99d9-d1dfeb2338d0" \
-H "apiKey: $PONITOR_API_KEY"
const response = await fetch('https://sandbox-api.ponitor.com/airtime/v1/purchases/8d60dc7f-78a2-4ed5-99d9-d1dfeb2338d0', {
headers: { apiKey: process.env.PONITOR_API_KEY },
});
console.log(response.status, await response.json());
import os
import requests
response = requests.get(
"https://sandbox-api.ponitor.com/airtime/v1/purchases/8d60dc7f-78a2-4ed5-99d9-d1dfeb2338d0",
headers={"apiKey": os.environ["PONITOR_API_KEY"]},
timeout=30,
)
print(response.status_code, response.json())
<?php
$ch = curl_init('https://sandbox-api.ponitor.com/airtime/v1/purchases/8d60dc7f-78a2-4ed5-99d9-d1dfeb2338d0');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['apiKey: ' . getenv('PONITOR_API_KEY')],
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status, ' ', $body, PHP_EOL;
Responses
- 200
- 400
- 401
- 404
- 429
OK. The purchase object, with the current status. A data bundle purchase has type DATA and the bundle in product.
{
"id": "8d60dc7f-78a2-4ed5-99d9-d1dfeb2338d0",
"externalId": "order-8842",
"type": "AIRTIME",
"msisdn": "231770000000",
"carrier": "ORANGE",
"product": null,
"amount": 5,
"cost": 5,
"status": "SUCCESS",
"failureReason": null,
"instructions": null,
"createdAt": "2026-09-21T22:57:02.278Z"
}
Bad Request. id is not a valid UUID (E01001). Every error has an error object. See The error body.
Unauthorized. The API key is missing (E02001), wrong or revoked (E02002), or sent to the other base URL (E02003). See API keys and base URLs.
Not Found. No purchase with that id belongs to your team (E01005).
{
"error": {
"type": "not_found_error",
"code": "E01005",
"name": "NotFound",
"message": "Airtime transaction with id (8d60dc7f-78a2-4ed5-99d9-d1dfeb2338d0) not found",
"doc_url": "https://docs.ponitor.com/api/errors#E01005",
"request_id": "4a5b6c7d-8e9f-4a0b-8c1d-2e3f4a5b6c7d"
}
}
Too Many Requests. Your team went over its rate limit (E01011). Wait, then try again.