Cancel All Orders
Cancel all open orders
HTTP Request
POST/v5/spread/order/cancel-allRequest Parameters
| Parameter | Required | Type | Comments |
|---|---|---|---|
| symbol | false | string | Spread combination symbol name
|
| cancelAll | false | boolean | true, false |
info
The acknowledgement of cancel all orders request indicates that the request was sucessfully accepted. This request is asynchronous so please use the websocket to confirm the order status.
Response Parameters
| Parameter | Type | Comments |
|---|---|---|
| list | array<object> | |
| > orderId | string | Order ID |
| > orderLinkId | string | User customised order ID |
| success | string | The field can be ignored |
Request Example
- HTTP
- Python
POST /v5/spread/order/cancel-all HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXXX
X-BAPI-API-KEY: XXXXXX
X-BAPI-TIMESTAMP: 1744090967121
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json
Content-Length: 49
{
"symbol": null,
"cancelAll": true
}
from pybit.unified_trading import HTTP
session = HTTP(
testnet=True,
api_key="xxxxxxxxxxxxxxxxxx",
api_secret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
)
print(session.spread_cancel_all_orders(
cancelAll=True
))
Response Example
{
"retCode": 0,
"retMsg": "OK",
"result": {
"list": [
{
"orderId": "11ec47f3-f0a2-4b2a-b302-236f2a2d53a2",
"orderLinkId": ""
}
],
"success": "1"
},
"retExtInfo": {},
"time": 1744090940933
}