Update an existing order using the ID that was returned when created. Updating performs a merge operation. To explicitly override values such as arrays, use the $set operator.

To cancel an order, set canceled to true. Items that haven't shipped are returned to stock. Canceling doesn't refund the order's payments, and it sends the customer the order canceled email unless the request includes $notify: false.

To cancel some of an order's items, set each item's quantity_canceled to the total number of its units canceled. Item cancels don't send an email, and canceling every item doesn't set the order to canceled.

To cancel without returning items to stock, for example orders that were oversold, include $restock: false. It applies to canceled: true and to quantity_canceled changes in the same request, and isn't stored on the order. A later cancel of the remaining items restocks only those items.