Cancel a transaction

This endpoint allows you to cancel a scheduled transaction using the reference ID obtained from its creation response. The cancellation is intended to allow the interruption of incorrect or undesired payment operations before financial settlement and is irreversible, in order to preserve operational integrity and ensure full traceability for auditing purposes. Only transactions that have not yet been processed ("pending" and "in_process") can be canceled. In case of success, the request will return a response with status 204.

PUT

https://api.mercadopago.com/v1/payouts/{payout_id}/transactions/{transaction_id}/cancel
Request parameters
Header
Authorization
string

REQUIRED

Access Token obtained through the developer panel. Must be sent in all requests.
Path
payout_id
string

REQUIRED

Identifier of the payout for which you wish to consult the transaction, returned in the response to its creation within the "id" field
transaction_id
string

REQUIRED

Identifier of the transaction for which you wish to consult, returned in the response to its creation within the "id" field
Body
comments
string

REQUIRED

Clear justification for the cancellation (avoid including sensitive personal information). This field is fundamental for history and audit.
deleted_by
string

REQUIRED

Unique identification of who performed the cancellation (user, system, etc). This field is fundamental for history and audit.
Response parameters
Esta solicitação não tem resposta
Errors

400Bad request. The parameters sent are not valid.

bad_request

Invalid data was sent in the request body. Try sending the request again, validating all fields.

401Unauthorized. Invalid or missing credentials.

unauthorized

The value sent as Access Token is incorrect. Please check and try again with the correct value.

403Forbidden. You don't have permissions to access this resource.

forbidden

No permission to access the resource.

404Not found. The requested resource does not exist.

not_found

The requested resource was not found or the value sent for its identification does not exist. Validate the information sent in the parameters and try the request again.

412Precondition not met. The status of the transaction does not allow cancellation.

Precondition Failed

The status of the transaction does not allow its cancelation. Only transactions with "status" 'pending' or 'in_process' can be canceled.

500Internal server error.

internal_server_error

An unexpected error occurred on the server. Try the request again.

Request
curl -X PUT \
    'https://api.mercadopago.com/v1/payouts/{payout_id}/transactions/{transaction_id}/cancel'\
    -H 'Content-Type: application/json' \
       -H 'Authorization: Bearer APP_USR-4*********994754-12*********c73b4e1ac*********cef36b27c*********840' \
    -d '{
  "comments": "delete because the payment was canceled",
  "deleted_by": "user_123"
}'
Response
// This request has not been responded to.