Skip to main content

Cancel All Orders

Cancel all open orders

Unified account covers: Spot / USDT perpetual / USDC contract / Inverse contract / Options
Classic account covers: Spot / USDT perpetual / Inverse contract

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
  • Unified account: spot, linear, inverse, option
  • Classic account: spot, linear, inverse
symbolfalsestringSymbol name. linear & inverse: Required if not passing baseCoin or settleCoin
baseCoinfalsestringBase coin
  • 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
  • Classic spot: invalid
settleCoinfalsestringSettle coin
  • linear & inverse: Required if not passing symbol or baseCoin
  • Does 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

  • Response Parameters

    ParameterTypeComments
    listarrayObject
    > orderIdstringOrder ID
    > orderLinkIdstringUser customised order ID
    successstring"1": success, "0": fail

    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
    }