Cancel All Open Orders
Cancel every open order on the exchange. Optionally scope to a single symbol.
HTTP
| Method | POST |
| Endpoint | /trade/api/v2/futures/cancel_all |
| Rate limit | 10 requests per 60 seconds |
Request Parameters
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
exchange | string | Yes | EXCHANGE_2. |
symbol | string | No | If provided, only cancel orders on this symbol (e.g. BTCUSDT). If omitted, cancel everything across all symbols. |
This also cancels TP/SL orders (TAKE_PROFIT_MARKET / STOP_MARKET).
Example
- Python
- Java
- Go
- Node.js
import requests
body = {"exchange": "EXCHANGE_2"}
headers, path = sign_request("POST", "/trade/api/v2/futures/cancel_all")
response = requests.post(BASE_URL + path, headers=headers, json=body)
print(response.json())
HttpResponse<String> resp = client.send(
"POST", "/trade/api/v2/futures/cancel_all", null,
Map.of("exchange", "EXCHANGE_2"));
System.out.println(resp.body());
body := map[string]any{
"exchange": "EXCHANGE_2",
}
bodyJSON, _ := json.Marshal(body)
headers, p, err := SignRequest("POST", "/trade/api/v2/futures/cancel_all", nil)
if err != nil { panic(err) }
req, _ := http.NewRequest("POST", BaseURL+p, bytes.NewReader(bodyJSON))
for k, v := range headers { req.Header.Set(k, v) }
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(string(out))
const {signRequest, BASE_URL} = require('./reference-client');
const body = {"exchange": "EXCHANGE_2"};
const {headers, path} = signRequest('POST', '/trade/api/v2/futures/cancel_all');
const r = await fetch(BASE_URL + path, {
method: 'POST',
headers,
body: JSON.stringify(body),
});
console.log(await r.json());
Response
{
"data": {
"orders_ids": [
"01936be4-2571-7a3f-97fa-a29a2b85d717",
"01936be4-9e37-7487-8e31-20fede6ef271"
]
}
}
orders_ids lists every order that was sent for cancellation. Each one transitions through CANCELLATION_RAISED to CANCELLED independently — poll Get Order Status on each order_id to confirm.