Cancel Order
Cancel a single open futures order.
HTTP
| Method | DELETE |
| Endpoint | /trade/api/v2/futures/order |
| Rate limit | 10 requests per 60 seconds |
Request Parameters
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
exchange | string | Yes | EXCHANGE_2. |
order_id | string | Yes | The order_id to cancel. |
Example
- Python
- Java
- Go
- Node.js
import requests
body = {
"exchange": "EXCHANGE_2",
"order_id": "698ed406-8ef5-4664-9779-f7978702a447",
}
headers, path = sign_request("DELETE", "/trade/api/v2/futures/order")
response = requests.delete(BASE_URL + path, headers=headers, json=body)
print(response.json())
HttpResponse<String> resp = client.send(
"DELETE", "/trade/api/v2/futures/order", null,
Map.of("exchange", "EXCHANGE_2",
"order_id", "698ed406-8ef5-4664-9779-f7978702a447"));
System.out.println(resp.body());
body := map[string]any{
"exchange": "EXCHANGE_2",
"order_id": "698ed406-8ef5-4664-9779-f7978702a447",
}
bodyJSON, _ := json.Marshal(body)
headers, p, err := SignRequest("DELETE", "/trade/api/v2/futures/order", nil)
if err != nil { panic(err) }
req, _ := http.NewRequest("DELETE", 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",
"order_id": "698ed406-8ef5-4664-9779-f7978702a447",
};
const {headers, path} = signRequest('DELETE', '/trade/api/v2/futures/order');
const r = await fetch(BASE_URL + path, {
method: 'DELETE',
headers,
body: JSON.stringify(body),
});
console.log(await r.json());
Response
{
"data": {
"order_id": "0193688e-5212-7493-be58-4f83644772e8",
"exchange": "EXCHANGE_2",
"symbol": "DOGEUSDT",
"side": "BUY",
"order_type": "LIMIT",
"status": "CANCELLATION_RAISED",
"quantity": "22",
"exec_quantity": "0",
"price": "0.28",
"avg_exec_price": "0",
"exec_fee": "0",
"reduce_only": false,
"created_at": 1732625977884,
"updated_at": 1732626020104
}
}
The cancel response uses slightly different field names from other order responses: avg_exec_price (not avg_execution_price) and exec_fee (not execution_fee). Other fields are the same.
The status will be CANCELLATION_RAISED immediately after the call. Poll Get Order Status to confirm it resolves to CANCELLED. See Order Lifecycle.