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
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
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.
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: 0e58e0ee-f8a4-4bc3-ac69-1e52a2fc4d13' \
-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"
}'