Tpay
API

Canceling a transaction

Tpay allows the cancellation of unpaid transactions by assigning them the status "cancel." A transaction that remains unpaid for 30 calendar days will be automatically canceled and cannot be paid. If a payer attempts to complete the payment, they will be informed that it is no longer possible. If, despite this, the payment is processed, the funds will be automatically refunded to the payer. Transactions can be canceled manually from the Merchant Panel or via the API.

Before you start

Make sure that:

Canceling a transaction in Merchant Panel

  1. Log in to your account to the Merchant Panel.
  2. Navigate to tab Transaction > List.
  3. Select the transaction you want to cancel.
  4. Use the option Cancel.
Note

The ability to cancel transactions is available for accounts with the following permissions: Admin, IT and Accounting (full access).

Send a request to cancel a transaction

To change the status of a transaction to canceled, send a POST request to endpoint:

https://api.tpay.com/transactions/{transactionId}/cancel

Replace {transactionId} with the ID of the transaction you want to cancel:

https://api.tpay.com/transactions/ta_7dbkalWZoLYJ12Yw/cancel

Check the details in the API Reference documentation: POST /transactions/{transactionId}/cancel

In the request, specify the following parameters:

transactionId
The unique identifier of the transaction.

The request body should be empty:

{}

Example:

curl --location --request POST 'http://api.tpay.com/transactions/ta_jrkNGj5L29pnlbqw/cancel' \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json'
Note

The status change is only possible for pending transactions. It does not apply to transactions that have already been successfully paid, refunded, or completed with an error.