Cancel All Orders
tip
This endpoint enables to cancel all open orders.
- If
category=linear, one of parambaseCoin,settleCoin,symbolmust be passed.
HTTP Request
POST /unified/v3/private/order/cancel-all
Request Parameters
| Parameter | Required | Type | Comments |
|---|---|---|---|
| category | true | string | Product type. linear, option |
| symbol | false | string | Symbol name |
| baseCoin | false | string | Cancel all open orders by base coin |
| settleCoin | false | string | Cancel all open orders by settle coin. linear only |
| orderFilter | false | string | Order: active order, StopOrder: conditional order |
Response Parameters
| Parameter | Type | Comments |
|---|---|---|
| result | Object | |
| > list | array | Object |
| >> category | string | Products category |
| >> symbol | string | Symbol name |
| >> orderId | string | Order id |
| >> orderLinkId | string | User customised order id |
| retExtInfo | Object | |
| > list | array | Object |
| >> code | integer | Success/error code |
| >> msg | string | Success/error message |
Request Example
POST /unified/v3/private/order/cancel-all HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: XXXXX
X-BAPI-TIMESTAMP: 1672810386137
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json
{
"category": "linear",
"baseCoin": "ETH",
"settleCoin": null
}
Response Example
{
"retCode": 0,
"retMsg": "OK",
"result": {
"list": [
{
"category": "linear",
"symbol": "ETHUSDT",
"orderId": "6cba55ea-6996-44f5-bd0f-ac09ffda4ab1",
"orderLinkId": "liang-001"
}
]
},
"retExtInfo": {
"list": [
{
"code": 0,
"msg": "success"
}
]
},
"time": 1672810388787
}