This endpoint allows you to cancel an eligible scheduled transaction using the payout_id and transaction_id returned when the payout was created. Only transactions that have not yet been processed and have status=pending or status=in_process can be canceled, and the cancellation is irreversible. The cancellation request must be sent at least 12 hours before the scheduled execution date and time. On success, the request returns status 204.
PUT
REQUIRED
REQUIRED
CONDITIONALLY REQUIRED
CONDITIONALLY REQUIRED
boolean indicating whether the integrator will send the signature. It must be false for test environments, and true for production environments, when the signature is mandatory.REQUIRED
id field of the response to POST /v1/payouts.REQUIRED
transactions[].id field of the response to POST /v1/payouts.400Bad request. The parameters sent are not valid.
invalid_payout_id
Invalid data was sent in the request body. The payout was not found. Try sending the request again, validating all fields.
invalid_transaction_id
Invalid data was sent in the request body. The transaction was not found. Try sending the request again, validating all fields.
invalid_signature
Invalid data was sent in the request body. Check if the secret was generated correctly and is registered with Mercado Pago. Also check if the body you are sending is the one that was encrypted.
idempotency_key_required
Invalid data was sent in the request body. The idempotency key (idempotency_key) is missing. Try sending the request again, validating all fields.
invalid_account
The `account` object was sent without the data required to identify the destination account. Provide `email` for a Mercado Pago account or the required bank details for an external account, including `number` and `bank_id`.
401Error. Access Token not authorized.
invalid_token
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.
404Error. Payout not found.
not_found
Payout not found. Please check if you provided the correct payout ID.
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 status=in_process can be canceled.
500Internal server error.
internal_server_error
An unexpected error occurred on the server. Try the request again.
502Bad gateway. Integration failure with an external service.
bad_gateway
An error occurred in the integration with an external service. Try the request again.
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' \
-H 'X-Idempotency-Key: d7247773-7f75-4f5a-9c7c-fd99d75d1ea6' \
-H 'X-signature: true' \
-H 'X-enforce-signature: false' \
-H 'X-test-token: false' \
-d '{
"comments": "delete because the payment was canceled",
"deleted_by": "user_123"
}'