Transactions
Cancel a transaction
Void or cancel a pending transaction before it is processed.
The Cancel Transaction endpoint voids or cancels a transaction that is still in a pending state. Once canceled, the transaction will no longer settle or capture funds.
You can only cancel transactions that have not yet been processed (pending). If a transaction has already succeeded, you must issue a refund instead.
Endpoint
Path Parameters
Parameter | Type | Required | Description |
---|---|---|---|
transaction_id | string | Yes | The unique ID of the transaction to cancel. |
Headers
Key | Value | Required |
---|---|---|
Authorization | Bearer <access_token> | Yes |
Response
Successful Response (200 OK)
Field | Type | Description |
---|---|---|
id | string | Transaction ID. |
status | string | Always canceled after success. |
canceled_at | string | ISO 8601 timestamp when cancellation occurred. |
message | string | Confirmation message. |
Error Response (400 / 404 / 409)
Error Code | Meaning |
---|---|
not_found | Transaction ID does not exist. |
not_cancellable | Transaction cannot be canceled because it is already processed. |
unauthorized | Invalid or missing access token. |
Example Usage
cURL
JavaScript (Fetch)
Canceling a transaction does not remove it from records. The transaction remains visible in reports and APIs with a status of canceled.