Cancel an order created for Mercado Pago Point and its transactions using the reference ID obtained in the response to its creation. Only an order in status "created" can be canceled. In case of success, the request will return a response with status 200.
POST
REQUIRED
REQUIRED
REQUIRED
400Error.
empty_required_header
The "X-Idempotency-Key" header is required and was not sent. Make the requisition again including it.
bad_request
The order_id provided in the request path is not correct. Please confirm it and provide a valid ID to try again.
401Error.
unauthorized
The value sent as Access Token is incorrect. Please check and try again with the correct value.
404Error.
order_not_found
Order not found. Please check if you provided the correct order ID.
409Error.
idempotency_key_already_used
The value sent as the idempotency header has already been used. Please try the request again sending a new value.
cannot_cancel_order
There is a conflict trying to cancel the order due to its current status. Please note that orders can only be cancelled via API when "status=created". If you are trying to cancel an order with status "status=at_terminal", you will need to do from the terminal.
500Error.
idempotency_validation_failed
Validation fail. Please try submitting the request again.
500
Internal server error. Please try submitting the request again.
curl -X POST \
'https://api.mercadopago.com/v1/orders/{order_id}/cancel'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer APP_USR-8*********932064-12*********edf6d3c99*********2236c703f*********668' \
-H 'X-Idempotency-Key: 03928321-dc15-4b98-a15d-9b590bd817d8' \
{
"id": "ORD0000ABCD222233334444555566",
"user_id": "5238400195",
"type": "point",
"external_reference": "ext_ref_1234",
"description": "Point Smart Mini",
"expiration_time": "PT16M",
"country_code": "CL",
"processing_mode": "automatic",
"integration_data": {
"application_id": "1234567890",
"platform_id": "dev_1234567890",
"integrator_id": "dev_123456",
"sponsor": {
"id": "446566691"
}
},
"status": "canceled",
"status_detail": "canceled",
"created_date": "2024-09-10T14:26:42.109320977Z",
"last_updated_date": "2024-09-10T14:26:42.109320977Z",
"config": {
"point": {
"terminal_id": "NEWLAND_N950__N950NCB801293324",
"print_on_terminal": "no_ticket"
},
"payment_method": {
"default_type": "credit_card"
}
},
"transactions": {
"payments": [
{
"id": "PAY01J67CQQH5904WDBVZEM4JMEP3",
"amount": "25",
"status": "canceled",
"status_detail": "canceled_by_api"
}
]
},
"taxes": [
{
"payer_condition": "payment_taxable_iva"
}
]
}