Canceling an order
An order can be canceled before and after the payment, as long as the latter has not been captured at the bank, i.e. its status is:
- CREATED and before the order execution,
- PENDING.
If you try to cancel the payment between the time of order execution (while the status is still CREATED) and the end of the payment process (i.e. the transition from CREATED to PENDING), you will receive the following error:
{'Order': "This order has been executed and cannot be canceled until the end of the payment process"}
To cancel an order you must use the DELETE method on the ORDER resource.
DELETE /orders/{uuid}
Example:
DELETE https://secure.lyra.com/marketplace/orders/60c9dbf5-ff99-40fb-9fb6-a709005359f8
In case of success, the server responds by a HTTP 204 code (NO CONTENT).