BinanceSpotRest.Endpoints.Trading.OrderDelete.Query (Binance Spot Rest v0.2.1)

View Source

Order (delete)

Cancel order (TRADE)

DELETE /api/v3/order

Cancel an active order.

Weight: 1

Parameters:

NameTypeMandatoryDescription
symbolSTRINGYES
orderIdLONGNO
origClientOrderIdSTRINGNO
newClientOrderIdSTRINGNOUsed to uniquely identify this cancel. Automatically generated by default.
cancelRestrictionsENUMNOSupported 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.
recvWindowDECIMALNOThe value cannot be greater than 60000. Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.
timestampLONGYES

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 cancelRestrictions value 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."
}