Cancel order/proximity-integration/shipments/{shipment_id}/cancelThis endpoint cancels an order, changing its status. A reason for the cancellation can be added, it's necessary just to check if the reason of cancellation are available for the current status.
PUT
Products that use it:
Request's parameters
shipment_idstring
Localization: pathShipment ID of the order.REQUIRED
cancellation_reason
Localization: bodyReason of the cancellation that was retrieved from the endpoint of cancellation reason.object
status
Localization: bodyThis field indicates the order status, which must have the value "cancelled" for this endpoint.string
Response parameters
status
Localization: bodyStatus of the order after its cancellation. The Status value that will be returned is "cancelled".string
Request
curl
curl -X PUT \
'https://api.mercadopago.com/proximity-integration/shipments/{shipment_id}/cancel' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"status": "cancelled",
"cancellation_reason": {
"id": "CS7452",
"value": "out_of_stock",
"message": "Me falta alguno de los productos."
}
}'
Answer
json
{
"status": "cancelled"
}
Errors
400bad_request
400
401bad_request
401 Unauthorized - Access Token is invalid
403bad_request
403 Forbidden - User cannot access this resource
424bad_request
424 Not Found - Failed to get some information of the order
500bad_request
500 Internal server error