Transaction Logs
View the timeline for a transaction - a list of events that happened to a selected transaction
This endpoint allows you to view the timeline for a transaction. A transaction timeline is a list of events that happened to a selected transaction.
How to View Transaction Timeline
Endpoint: https://api.chapa.co/v1/transaction/events/{tx_ref}
Method: GET
Authorization: Pass your secret key as a bearer token in the request header to authorize this call.
{tx_ref} is the reference id to that specific transaction.
cURL
JavaScript
PHP
Python
Successful Response
The API returns a list of events that occurred during the transaction lifecycle:
{
"message": "Transaction events fetched",
"status": "success",
"data": [
{
"item": 23445,
"message": "Attempted to make payment with telebirr USSD",
"type": "log",
"created_at": "2024-07-23T07:31:32.000000Z",
"updated_at": "2024-07-23T07:31:32.000000Z"
},
{
"item": 23567,
"message": "Transaction is successful with TELEBIRR - RSLT",
"type": "log",
"created_at": "2024-07-23T07:31:55.000000Z",
"updated_at": "2024-07-23T07:31:55.000000Z"
},
{
"item": 24678,
"message": "Redirecting to confirmation page",
"type": "log",
"created_at": "2024-07-23T07:31:32.000000Z",
"updated_at": "2024-07-23T07:31:32.000000Z"
}
]
}Response Parameters
| Parameter | Type | Description |
|---|---|---|
message | string | Response message |
status | string | Status of the request (success/failed) |
data | array | Array of transaction events |
item | number | Unique identifier for the event |
message | string | Description of the event |
type | string | Type of event (e.g., "log") |
created_at | string | Timestamp when the event was created |
updated_at | string | Timestamp when the event was last updated |
Failed Response
{
"message": "Transaction not found",
"status": "failed",
"data": null
}Refer to our Error Codes page for all responses for this request.
Use Cases
Transaction logs are useful for:
- Debugging: Track the exact sequence of events during a transaction
- Auditing: Maintain a complete record of transaction activities
- Support: Help troubleshoot payment issues with detailed event history
- Analytics: Understand payment flow patterns and identify bottlenecks
Next Steps
- All Transactions - View all your transactions
- Verify Payment - Verify transaction status
- Error Codes - Handle errors gracefully