Canceling a existing order failed binance futures.

Hi I am trying to cancel a existing order via binance_f python sdk. I am facing the following error: {“code”:-2011,“msg”:“Unknown order sent.”}

====== Request ======
<binance_f.impl.restapirequest.RestApiRequest object at 0x7fc0d3fc0a60>
header:{'client_SDK_Version': 'binance_futures-1.0.1-py3.7', 'Content-Type': 'application/x-www-form-urlencoded'}
host:https://testnet.binancefuture.com
json_parser:None
method:GET
post_body:
url:/fapi/v1/order?symbol=BTCUSDT&orderId=2629856486&recvWindow=60000&timestamp=1612779537372&signature=611ceb3870edf9a0cff94be15cc929aec76aad25033c8bd3e5cca5a0ae2dad00
=====================
{"orderId":2629856486,"symbol":"BTCUSDT","status":"NEW","clientOrderId":"LL6gcJaN7ameilh1T5jNYd","price":"39020.01","avgPrice":"0.00000","origQty":"0.005","executedQty":"0","cumQuote":"0","timeInForce":"GTX","type":"LIMIT","reduceOnly":false,"closePosition":false,"side":"SELL","positionSide":"SHORT","stopPrice":"0","workingType":"CONTRACT_PRICE","priceProtect":false,"origType":"LIMIT","time":1612779422486,"updateTime":1612779422486}
2021-02-08 10:19:01,493 - INFO - binance - The current order is 2629856486 has status NEW
INFO:root:The current order is 2629856486 has status NEW
====== Request ======
<binance_f.impl.restapirequest.RestApiRequest object at 0x7fc0d3f16d90>
header:{'client_SDK_Version': 'binance_futures-1.0.1-py3.7', 'Content-Type': 'application/json}
host:https://testnet.binancefuture.com
json_parser:None
method:DELETE
post_body:
url:/fapi/v1/order?symbol=BTCUSDT&orderId=2629856486&recvWindow=60000&timestamp=1612779540499&signature=7032b481b2ed1aba41bea2db9049659fe02252d5537dc1b8f9178b0a679dded1
=====================
{"code":-2011,"msg":"Unknown order sent."}

Please check the timestamp from the order details, and see if the order is not in open status when sending the cancel request.

1 Like

How to check whether a order is in open status. Because from the rest api call i received the order is in NEW status. And there is no OPEN status mentioned in the official documentation: docs . Can you also mention what’s the best way to cancel order to mitigate errors like these in future.