Fetch Transaction Endpoint
Fetch a single transaction by ID or request ID.
Endpoint
URL: /api/transactions/transaction
Methods: GET
Description
This API endpoint allows users to fetch a single transaction using either a transactionId or arequestId. Only one identifier is allowed per request.
Authentication
To access this endpoint, users must include their API key and secret key in the request headers.
Request Headers
- api-key (string, required): The API key of the user.
- secret-key (string, required): The secret key of the user.
Query Parameters
- transactionId (string, optional): The unique transaction ID generated on our system for every transaction.
- requestId (string, optional): The optional request ID included by the user when sending the transaction request.
Note: You must provide either transactionId or requestId, but not both.
Usage Example
Fetch by Transaction ID:
GET /api/transactions/transaction?transactionId=20260208hskjhf567890 Content-Type: application/json api-key: your-api-key secret-key: your-secret-key
Fetch by Request ID:
GET /api/transactions/transaction?requestId=req_9a83ks73 Content-Type: application/json api-key: your-api-key secret-key: your-secret-key
Response:
{
"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"
}Failed Response Format
{
"error": "transactionId or requestId is required"
}{
"error": "Provide only one identifier"
}{
"error": "Transaction not found"
}