URL: /api/transactions/transaction
Methods: GET
This API endpoint allows users to fetch a single transaction using either a transactionId or a requestId. Only one identifier is allowed per request.
To access this endpoint, users must include their API key and secret key in the request headers.
Note: You must provide either transactionId orrequestId, but not both.
See usage examples in the code snippets below:
GET /api/transactions/transaction?transactionId=20260208hskjhf567890 Content-Type: application/json api-key: your-api-key secret-key: your-secret-key
GET /api/transactions/transaction?requestId=req_9a83ks73 Content-Type: application/json api-key: your-api-key secret-key: your-secret-key
Response:
- Status Code: 200
{
"transactionId": "1234567890",
"email": "user@example.com",
"serviceType": "Airtime",
"activity": "MTN VTU",
"status": "Successful",
"recipient": "08032566178",
"amount": 100,
"amountUsed": 99,
"initialBalance": 500,
"finalBalance": 401,
"Method": "API",
"createdAt": "2025-01-20T12:30:00.000Z",
"updatedAt": "2025-01-20T12:30:01.000Z"
}
- Status Code: 400
{
"error": "transactionId or requestId is required"
}
- Status Code: 400
{
"error": "Provide only one identifier"
}
- Status Code: 404
{
"error": "Transaction not found"
}