Skip to main content

Cancel transaction

Introduction

This guide explains how to cancel a transaction through the REST API.

Prerequisites for requesting for cancel a transaction

Cancellation of a transaction can only be requested when::

  • The transaction must be in initial status (status waiting).

How to use?

Make a PUT request to the endpoint /credit/transactions/{transaction_id}/cancel

With a valid access token, make a request to the endpoint (PUT/credit/transactions/{transaction_id}/cancel).

The expected response on a successful request is a JSON containing the status as “canceled”, as in the following example:

{
"status": "canceled"
}

For more information on status codes, see the Enumerated guide.

If an error occurs, the response returned is a JSON containing the error and the error code:

{
"error": {
"code": "40004",
"description": "transaction id is invalid"
}
}

Here's a list of errors returned by the service:

HTTP CodeCodeDescriptionReason
40040004transaction id is invalidTransaction ID is invalid (format)
40040009transaction status is invalidThe transaction status does not allow cancellation
40340301not allowedThe user is not allowed to perform such action
40440401transaction not foundTransaction not found
50050001internal errorInternal server error

Any concerns?

Missing something or still need help? If you are already a customer or partner, you can contact us through the Help Center.