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 Code
Code
Description
Reason

400

40004

transaction id is invalid

Transaction ID is invalid (format)

400

40009

transaction status is invalid

The transaction status does not allow cancellation

403

40301

not allowed

The user is not allowed to perform such action

404

40401

transaction not found

Transaction not found

500

50001

internal error

Internal server error


Still need help?

Didn't find something or still need help? If you're already a client or partner, you can reach out through our Help Center.

Last updated

Copyright © 2024 unico. All rights reserved.