Skip to main content

DELETE v3/orders/:id

DELETE 

/v3/orders/:id

Cancel an order, or as much of it as has not shipped yet.

Invoking this endpoint will cause the server to make an effort to cancel an order by cancelling each of its orderItems. This may succeed when there is no shipment fulfilling any of the orderItems yet. Otherwise the cancellation will be at best partially successfull. Depending on the result the server response will be slightly different. (See below and the examples)

The endpoint also supports -to some degree- the inclusion of information of related resources. The resources that can be included in the response are limited to the orderItems, the deliveryAddress, the billingAddress and the pickUpPoint. To get the details of related entities the include parameter must be added to the URI in the following way:

  • DELETE {host}/v3/orders?include=orderItems will attempt to cancel the order and return the order and all its orderItems in their new state.

Responses​

Partial or Complete Cancellation​

If the order was partially or completely cancelled (for example, if it was already partially fulfilled), the server will respond with a field meta.modified attribute set to true. This indicates that the order was modified. To determine which orderItems were modified as a result of this request, the server response will include an array of ids of orderItems in the element meta.modifiedItems. To determine the completeness of the cancellation, refer to the quantities on the orderItems.

No Change​

If none of the orderItems of the order could be cancelled because they were already completely fulfilled, the server will still respond with a 200: OK. However, the attribute meta.modified will be set to false, indicating that the order was not modified as a result of this request.

Limitations of the DELETE v3/orders/:id​

  • Users are rate-limited to 500 requests per hour on this service.

Request​

Responses​

The 200: OK response includes information about the result of the cancellation request. As indicated the order might be cancelled in its entirety, partially or not at all. To understand if anything changed as a result of the request, the field meta.modified will be set to true. Additionally an array of modified orderItems is returned in the meta.modifiedItems element in the response.