Verify Transaction
Asides from the webhooks we send, you can also verify the transaction status of your customer's payment.
Verify Transaction API
API Details
Action: Verify Transaction
Method: GET
Path: /v1/transaction/:transaction_id/status
Auth Requirement: Public or Secret Key (Bearer Auth)
Business Summary
This endpoint verifies the current status of a transaction using its unique transaction ID. It returns the latest transaction details, allowing you to check the current state of the customer's transaction.
You can use this API to:
- Confirm Payment Success: Verify if a transaction has reached the SUCCESS status before delivering the product or service to the customer.
- Poll for Updates: Check the real-time status of a pending transaction to update your UI, especially if webhooks are delayed or unavailable.
Request Parameters
| Name | Type | Required | Default | Allowed Values | Description |
|---|---|---|---|---|---|
| transaction_id | string | Yes | - | - | Basqet transaction ID |
Request Headers
| Name | Type | Required | Default | Allowed Values | Description |
|---|---|---|---|---|---|
| Authorization | string | Yes | - | - | Bearer pub_... or Bearer sec_... |
Request Examples
cURL
curl \--request GET \\
\--url <https://api.basqet.com/v1/transaction/transaction\_id/status> \\
\--header 'Authorization: Bearer bq\_sk\_{domain}\_s3cr3tk3y'
Response Schema
| Field | Type | Nullable | Description |
|---|---|---|---|
| status | string | No | Status of the API request |
| data | object | No | Contains the verified transaction details |
| data.status | string | No | Transaction status. Values: INITIATED, PROCESSING, PENDING, SUCCESSFUL, ABANDONED, OVERPAID, UNDERPAID, FAILED |
| meta | object | No | Additional configuration |
Sample Response
{
"status": "success",
"data": {
"status": "INITIATED"
},
"meta": {}
}
Error Reference
| HTTP Code | Message | Resolution |
|---|---|---|
| 400 | Varies (e.g., "Invalid Key") | Ensure the Authorization header contains a valid key with the correct prefix (pub or sec). |
| 401 | No key provided | Include the Authorization header with a valid bearer token in your request. |
| 403 | You are not permitted to carry out this action | Verify that the API key being used belongs to the same merchant that created the transaction. |
| 404 | Varies (e.g., "Transaction does not exist") | Confirm that the transaction_id or reference in the URL path is correct and exists in the system. |
| 500 | Internal server error | An unexpected error occurred on the server. Please wait a moment and retry your request. |
Updated 5 days ago