Skip to main content
POST
/
{payment_id}
/
transactions
/
{transaction_id}
/
cancel
Cancel Payment
curl --request POST \
  --url https://api-sandbox.y.uno/v1/payments/{payment_id}/transactions/{transaction_id}/cancel \
  --header 'Content-Type: application/json' \
  --header 'X-Idempotency-Key: <api-key>' \
  --header 'private-secret-key: <api-key>' \
  --header 'public-api-key: <api-key>' \
  --data '
{
  "description": "Duplicate",
  "reason": "REQUESTED_BY_CUSTOMER",
  "merchant_reference": "AAB01-432245"
}
'
{
  "id": "438bea6c-9061-4416-b824-469c3c05868d",
  "type": "CANCEL",
  "status": "SUCCEEDED",
  "category": "CARD",
  "amount": {
    "captured": 0,
    "currency": "USD",
    "currency_conversion": null,
    "refunded": 0,
    "value": 30000
  },
  "merchant_reference": "",
  "created_at": "2024-06-06T14:03:08.384014Z",
  "updated_at": "2024-06-06T14:03:08.453617Z",
  "provider_data": {
    "id": "YUNO_TEST_PAYMENT_GW",
    "transaction_id": "",
    "account_id": "",
    "status": "SUCCEEDED",
    "sub_status": "",
    "status_detail": "SUCCEEDED",
    "response_message": null,
    "response_code": "SUCCEEDED",
    "raw_response": {
      "message": "provider response"
    },
    "third_party_transaction_id": null,
    "third_party_account_id": null,
    "iso8583_response_code": "00",
    "iso8583_response_message": "Approved or completed successfully"
  },
  "response_code": "SUCCEEDED",
  "response_message": "Transaction successful",
  "payment": {
    "id": "2d6f75c1-c4bc-4d2d-80ec-0af4d12c85da",
    "account_id": "",
    "description": "Test",
    "country": "US",
    "status": "CANCELED",
    "sub_status": "CANCELED",
    "merchant_order_id": "0000023",
    "created_at": "2024-06-06T14:01:34.286228Z",
    "updated_at": "2024-06-06T14:03:08.484781Z",
    "amount": {
      "captured": 0,
      "currency": "USD",
      "currency_conversion": null,
      "refunded": 0,
      "value": 30000
    },
    "split_marketplace": []
  },
  "customer_payer": null,
  "simplified_mode": false,
  "receipt": false,
  "receipt_url": null,
  "receipt_language": null
}
A payment with a PENDING status due to an AUTHORIZE transaction status can be canceled before it is completed if the payment is no longer required. Sending a cancel request will update the payment status to CANCELLED.
3DS PaymentsPayments in a PENDING status due to 3DS authentication cannot be canceled. These payments are in a temporary state awaiting user authentication. The payment status will automatically update to either FRAUD VERIFIED or CANCELLED based on the outcome of the authentication process.
Alternative Payment MethodsAlternative payment methods such as PIX also support payment cancellation with a PENDING status. Reach out to your technical account manager for more information.
If you need a receipt for the canceled transaction, you can retrieve it after it has been created. To do this, use the Retrieve Payment by ID endpoint and check the receipt_url field in the payment.transaction object. See The Payment Object for receipt, receipt_url, and receipt_language. To use this endpoint, you have to provide an X-Idempotency-Key in your request. Check the Authentication page for more information.

Authorizations

public-api-key
string
header
default:<Your public-api-key>
required
private-secret-key
string
header
default:<Your private-secret-key>
required
X-Idempotency-Key
string
header
default:<Your X-Idempotency-Key>
required

Path Parameters

payment_id
string
required

The unique identifier of the payment (UUID, 36 chars).

transaction_id
string
required

The unique identifier of the transaction (UUID, 36 chars).

Body

application/json
merchant_reference
string
required

Identification of the payment transaction defined by the merchant (MAX 255; MIN 3).

description
string

Description of the cancellation.(MAX 255; MIN 3)

reason
enum<string>

Reason for the cancellation. Values can be DUPLICATE, FRAUDULENT, and REQUESTED_BY_CUSTOMER.

Available options:
DUPLICATE,
FRAUDULENT,
REQUESTED_BY_CUSTOMER
response_additional_data
object

Specifies additional data for required the transaction response

Response

200

id
string
Example:

"438bea6c-9061-4416-b824-469c3c05868d"

type
string
Example:

"CANCEL"

status
string
Example:

"SUCCEEDED"

category
string
Example:

"CARD"

amount
object
merchant_reference
string
Example:

""

created_at
string
Example:

"2024-06-06T14:03:08.384014Z"

updated_at
string
Example:

"2024-06-06T14:03:08.453617Z"

provider_data
object
response_code
string
Example:

"SUCCEEDED"

response_message
string
Example:

"Transaction successful"

payment
object
customer_payer
any
simplified_mode
boolean
default:true
Example:

false

receipt
boolean
default:true
Example:

false

receipt_url
any
receipt_language
any