POST Cancel All Orders
- NT8
- Tradovate
Cancel all open orders across all accounts NT8
Cancels every working order across all connected NT8 accounts.
Endpoint
POST /v1/api/orders/cancelall
Headers
| Name | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
Code examples
- Python
- JavaScript
- cURL
import requests
token = 'my-secret-token'
url = "https://app.crosstrade.io/v1/api/orders/cancelall"
headers = {
"Authorization": f"Bearer {token}",
"Content-Type": "application/json"
}
data = {}
try:
response = requests.post(url, headers=headers, json=data)
print(f"Response Code: {response.status_code}, Response Text: {response.text}")
except Exception as e:
print(f"An error occurred: {e}")
const token = 'my-secret-token';
const url = "https://app.crosstrade.io/v1/api/orders/cancelall";
fetch(url, {
method: "POST",
headers: {
"Authorization": `Bearer ${token}`,
"Content-Type": "application/json"
},
body: JSON.stringify({})
})
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));
TOKEN="my-secret-token"
curl -X POST "https://app.crosstrade.io/v1/api/orders/cancelall" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'
Response
- 200
- 400
{
"orderIds": [
"ddc3f4c244b047fda3f4d9f8f44bc8f3",
"b415488f31ff454682a947684e871a90",
"179b24c22fbd47e98b95b63c8ebd6aa4",
"68d01307c4bf4a6382bb863b42748a28",
"148230092d2144f4b0efa686bf6cb515",
"37101553a8ab466eb2f4f3b138954317",
"2ff65c7460b042da98d5e2936d5a3314",
"46feaed8d96e4261bb0b65fb3f04e417",
"78a571a7ebd9470e8b36af4cbf49809f",
"cfb62ddf171f4e6c9f7ac65939845ea1"
],
"success": true
}
{
"error": "Invalid request"
}
Platform nuances
- This endpoint has no account or instrument filter. It iterates every loaded NT8 account and submits every nonterminal order for cancellation.
- Open positions are not flattened.
orderIdslists the orders submitted for cancellation; the method does not wait for each cancellation to reach a terminal state before returning.
WebSocket API
This request can also be made over the WebSocket API.
{
"action": "rpc",
"id": "my-request-id",
"api": "CancelAllOrders",
"args": {}
}
Cancel all open orders across all accounts Tradovate
Cancels every working order across all linked Tradovate identities. No body fields are required; send an empty JSON object. No NinjaTrader add-on is involved. No account appears in the path, and the command runs server-side with the same validation, Account Manager locks, and Trade Copier fan-out as a webhook signal.
Endpoint
POST /v1/api/tv/orders/cancelall
Headers
| Name | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
Code examples
- Python
- JavaScript
- cURL
import requests
token = 'my-secret-token'
url = "https://app.crosstrade.io/v1/api/tv/orders/cancelall"
headers = {
"Authorization": f"Bearer {token}",
"Content-Type": "application/json"
}
data = {}
try:
response = requests.post(url, headers=headers, json=data)
print(f"Response Code: {response.status_code}, Response Text: {response.text}")
except Exception as e:
print(f"An error occurred: {e}")
const token = 'my-secret-token';
const url = "https://app.crosstrade.io/v1/api/tv/orders/cancelall";
fetch(url, {
method: "POST",
headers: {
"Authorization": `Bearer ${token}`,
"Content-Type": "application/json"
},
body: JSON.stringify({})
})
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));
TOKEN="my-secret-token"
curl -X POST "https://app.crosstrade.io/v1/api/tv/orders/cancelall" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'
Response
The response is the response envelope with api set to cancel_everything. response.cancelled is the total cancellation count, and response.identities contains the per-identity results.
{
"success": true,
"destination": "tradovate",
"api": "cancel_everything",
"response": {
"cancelled": 0,
"identities": []
},
"durationMs": 214
}
Platform nuances
- This is a broad operation across every linked demo and live Tradovate identity.
- CrossTrade enumerates working orders for each identity and cancels them individually.
- Per-identity results include cancelled order ids and errors. Partial failures are surfaced instead of being reported as a clean sweep.
- On failure, the response envelope has
success: falseand anerrormessage.
See the Tradovate API overview for the full field grammar, mutation safety guarantees, and error table.