# Cancel order This 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** `/proximity-integration/shipments/{shipment_id}/cancel` ## Request parameters ### Path - `shipment_id` (string, required) Shipment ID of the order. - `status` (string, optional) This field indicates the order status, which must have the value "canceled" for this endpoint. - `cancellation_reason` (object, optional) Reason of the cancellation that was retrieved from the endpoint of cancellation reason. - `cancellation_reason.id` (string, optional) ID of the reason of cancellation. - `cancellation_reason.value` (string, optional) Name of the reason of cancellation. - `cancellation_reason.message` (string, optional) Description of the reason of cancellation. ## Response parameters - `status` (string, optional) Status of the order after its cancellation. The Status value that will be returned is "canceled". ## Errors | Status | Error | Description | | ------- | ------- | ----------- | | 400 | 400 | Conflict-error - This order cannot be canceled due to its current status. | | 401 | 401 | Unauthorized - Access Token is invalid | | 403 | 403 | Forbidden - User cannot access this resource | | 424 | 424 | Not Found - Failed to get some information of the order | | 500 | 500 | Internal server error | ## Request example ### cURL ```bash curl -X PUT \ 'https://api.mercadopago.com/proximity-integration/shipments/{shipment_id}/cancel' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' \ -d '{ "status": "canceled", "cancellation_reason": { "id": "CS7452", "value": "out_of_stock", "message": "Me falta alguno de los productos." } }' ``` ## Response example ```json { "status": "canceled" } ```