BinanceSpotRest.Endpoints.Trading.OrderDelete.Query (Binance Spot Rest v0.2.1)
View SourceOrder (delete)
Cancel order (TRADE)
DELETE /api/v3/orderCancel an active order.
Weight: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| orderId | LONG | NO | |
| origClientOrderId | STRING | NO | |
| newClientOrderId | STRING | NO | Used to uniquely identify this cancel. Automatically generated by default. |
| cancelRestrictions | ENUM | NO | Supported values: <br>ONLY_NEW - Cancel will succeed if the order status is NEW.<br> ONLY_PARTIALLY_FILLED - Cancel will succeed if order status is PARTIALLY_FILLED. |
| recvWindow | DECIMAL | NO | The value cannot be greater than 60000. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified. |
| timestamp | LONG | YES |
Either orderId or origClientOrderId must be sent.
If both parameters are sent, orderId takes precedence.
Data Source: Matching Engine
Response:
{
"symbol": "LTCBTC",
"origClientOrderId": "myOrder1",
"orderId": 4,
"orderListId": -1, // Unless it's part of an order list, value will be -1
"clientOrderId": "cancelMyOrder1",
"transactTime": 1684804350068,
"price": "2.00000000",
"origQty": "1.00000000",
"executedQty": "0.00000000",
"cummulativeQuoteQty": "0.00000000",
"status": "CANCELED",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "BUY",
"selfTradePreventionMode": "NONE"
}Note: The payload above does not show all fields that can appear in the order response. Please refer to Conditional fields in Order Responses.
Regarding cancelRestrictions
- If the
cancelRestrictionsvalue is not any of the supported values, the error will be:
{
"code": -1145,
"msg": "Invalid cancelRestrictions"
}- If the order did not pass the conditions for
cancelRestrictions, the error will be:
{
"code": -2011,
"msg": "Order was not canceled due to cancel restrictions."
}