I am implementing a method to allow for a customer to cancel an order after the order has already been paid for. I currently am refunding the customer when they request the cancellation. Now I am looking for a way to update the order.state
to be set to “CANCELED” after I refund the payments attached to this order.
This is the error response I receive:
{"errors": [{"code": "BAD_REQUEST","detail": "Orders cannot be canceled after payments have been processed.","field": "order.state","category": "INVALID_REQUEST_ERROR"}]}
How can I set the order.state
after the refund to “CANCELED”?