Skip to main content

Cancel All Orders

Cancel all open orders

info
  • Support cancel orders by symbol/baseCoin/settleCoin. If you pass multiple of these params, the system will process one of param, which priority is symbol > baseCoin > settleCoin.
  • NOTE: category=option, you can cancel all option open orders without passing any of those three params. However, for "linear" and "inverse", you must specify one of those three params.
  • NOTE: category=spot, you can cancel all spot open orders (normal order by default) without passing other params.
info

Spot: classic account - cancel up to 500 orders; Unified account - no limit
Futures: classic account - cancel up to 500 orders; Unified account - cancel up to 500 orders
Options: Unified account - no limit

HTTP Request

POST /v5/order/cancel-all

Request Parameters

ParameterRequiredTypeComments
categorytruestringProduct type
  • UTA2.0, UTA1.0: linear, inverse, spot, option
  • classic account: linear, inverse, spot
symbolfalsestringSymbol name, like BTCUSDT, uppercase only
linear&inverse: Required if not passing baseCoin or settleCoin
baseCoinfalsestringBase coin, uppercase only
  • linear & inverse(classic account): If cancel all by baseCoin, it will cancel all linear & inverse orders. Required if not passing symbol or settleCoin
  • linear & inverse(Unified account): If cancel all by baseCoin, it will cancel all corresponding category orders. Required if not passing symbol or settleCoin
  • spot(classic account): invalid
settleCoinfalsestringSettle coin, uppercase only
  • linear & inverse: Required if not passing symbol or baseCoin
  • Not support spot
orderFilterfalsestring
  • category=spot, you can pass Order, tpslOrder, StopOrder, OcoOrder, BidirectionalTpslOrder
    If not passed, Order by default
  • category=linear or inverse, you can pass Order, StopOrder
    If not passed, all kinds of orders will be cancelled, like active order, conditional order, TP/SL order and trailing stop order
  • category=option, you can pass Order
    No matter it is passed or not, always cancel all orders
stopOrderTypefalsestringStop order type Stop
  • Only used for category=linear or inverse and orderFilter=StopOrder,you can cancel conditional orders except TP/SL order and Trailing stop orders with this param
  • info

    The ack of cancel-all order request indicates that the request is successfully accepted. Please use websocket order stream to confirm the order status


    Response Parameters

    ParameterTypeComments
    listarrayObject
    > orderIdstringOrder ID
    > orderLinkIdstringUser customised order ID
    successstring"1": success, "0": fail
  • UTA1.0(inverse), classic(linear, inverse) do not return this field
  • Request Example

    POST /v5/order/cancel-all HTTP/1.1
    Host: api-testnet.bybit.com
    X-BAPI-SIGN: XXXXX
    X-BAPI-API-KEY: XXXXX
    X-BAPI-TIMESTAMP: 1672219779140
    X-BAPI-RECV-WINDOW: 5000
    Content-Type: application/json

    {
    "category": "linear",
    "symbol": null,
    "settleCoin": "USDT"
    }

    Response Example

    {
    "retCode": 0,
    "retMsg": "OK",
    "result": {
    "list": [
    {
    "orderId": "1616024329462743808",
    "orderLinkId": "1616024329462743809"
    },
    {
    "orderId": "1616024287544869632",
    "orderLinkId": "1616024287544869633"
    }
    ],
    "success": "1"
    },
    "retExtInfo": {},
    "time": 1707381118116
    }