Deleting matched and partially matched orders

Hi,

What is the expected response when trying to delete a matched or a partially matched order?

It would be great if the response included the amount that was canceled. Any plans for implementing that?

Hey,

If you try to cancel a matched order you will receive error_type': 'ORDER_CANCEL_REJECTED_NOT_LIVE as it’s not possible to delete a matched bet.

Cancelling a partially matched order will only cancel the unmatched amount however as you correctly note the cancelled amount is not returned with a successful delete response. We currently don’t have plans to add it, however, can consider for future updates if more people request it.

Thanks, I’ll check that out.

What is the recommended procedure to confirm that an order is fully or partially deleted?
As I see it I have two options after receiving a code 200 on a cancel request:

  1. Send a get request to /v3/orders/xxxxxx and look for code 404
  2. Send a second delete request to /v3/orders/xxxxxxx and look for code 404

It doesn’t seem like good practice to rely on an error code for normal use. This means that I have to send two commands every time I want to delete an order, even though it is rarely the case that the order was partially matched.

You can use either of the two options - it doesn’t really make any difference to us.

You do raise a good point however and we will certainly take your suggestions into consideration. I’ll let you know if/when we implement any changes to the delete route.