Verify Transaction
Aside from the webhooks Basqet sends, you can also verify the transaction status of your customer’s payment.
API Details
| Field | Value |
|---|---|
| Action | Verify Transaction |
| Method | GET |
| Path | /v1/transaction/:transaction_id/status |
| Auth Requirement | Public or secret key using 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
SUCCESSFULstatus 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
Path 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_... | Bearer token for authentication. |
Request Example
cURL
curl --request GET \
--url https://api.basqet.com/v1/transaction/transaction_id/status \
--header 'Authorization: Bearer sec_live_xxxxxxxxxxxxx'
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. Possible values include INITIATED, PROCESSING, PENDING, SUCCESSFUL, ABANDONED, OVERPAID, UNDERPAID, and 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, either 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. Retry the request. |
Updated 3 months ago
Did this page help you?