Cancelling an order¶
- Request the order by its URI, as HAL-FORMS.
- If the order has no cancel link, it cannot be cancelled in its current state. Stop there, there is nothing to submit.
- Otherwise select the template that targets the
cancellink, and submit it using the template's method and target, without a body. - The response is the updated order, now
cancelled, and without acancellink.
A client does not need to know when an order can be cancelled, only to look for the link. If the order changed after it was read, the submission is rejected with order-not-cancellable; read the order again to see its current state.