status: 400, error code: -2011, error message: Unknown order sent
This is a common error when calling this API endpoint to cancel an open order:
DELETE /api/v3/order
There are various reasons that can cause this; There is a checklist that may be helpful to understand the issue:
- API key and account
- Is the API key the correct one that has the order you like to cancel?
- Some users may use Key A to cancel othe rder in Key B, it won’t work.
- Testnet
- If your key is from testnet, you can’t user it to cancel order in production.
- Order lookup
- If the order does not exist, it will fail
- If the order id is not under that symbol, it will fail, e.g.:
- if you have an order Id = 1234 in symbol
BTCUSDT
, you can not cancel it with symbolETHUSDT
unelss the order id1234
can be found inETHUSDT
and is available to be cancelled.
- if you have an order Id = 1234 in symbol
- Order status
- The order only can be cancelled if it’s status is
NEW
orPARTIALLY_FILLED
- The order in other status like
FILLED
,CANCELED
, etc can NOT be cancelled.
- The order only can be cancelled if it’s status is