OrdersService
Cancel All Orders
Cancel all matching open orders for an account. Supports an optional list of symbols and a side filter plus dry-run preview. Returns up to 200 canceled order IDs, oldest first, with the total count.
Request
curl --request POST \ \
--url 'https://api.testnet.polyester.com/v1/orders/cancel-all' \
--header 'Accept: */*' \
--header 'X-API-KEY-ID: YOUR_API_KEY_ID' \
--header 'X-API-TIMESTAMP: YOUR_API_TIMESTAMP' \
--header 'X-API-SIGNATURE: YOUR_API_SIGNATURE' \
--header 'Content-Type: application/json' \
--data '{
"dryRun": false,
"requestId": "request_01J0EXAMPLE",
"side": "BUY",
"subaccountId": "45LUmqjT",
"symbols": [
"BTC-USDT"
]
}'Responses
{
"cancelledOrders": [
{
"clientOrderId": "cli-ord-20250101-001",
"orderId": "5USXJZmk"
}
],
"failedCancels": 1,
"listingStatus": "INCLUDED",
"matchedOrders": 1,
"status": "SUBMITTED",
"submittedCancels": 1,
"totalCancelled": 1,
"truncated": false,
"ts": "2025-01-01T00:00:00Z",
"tsNs": "1735689600000000000"
}If true, return matched counts without actually canceling.
Idempotency key (required). Reuse the same key and criteria for retries. Completed results are retained for at least two minutes. Use a fresh key for a new cancellation; do not reuse a key after its replay window.
Side filter. When set, only orders on this side are canceled.
Optional public subaccount ID. When omitted, subaccount-scoped API keys use their bound subaccount; other callers use their authenticated root account.
Up to 100 trading pair symbols, e.g. [BTC-USDT, ETH-USDT]. Empty matches all symbols; duplicates are ignored.
The order's client order ID; empty when the order has none.
cli-ord-20250101-001Order ID.
5USXJZmkNumber of matched orders that could not be submitted for cancellation because the cancel-all could not be recorded for their symbol. This request does not cancel them; send a new cancel-all with a new `request_id` if they are still open. Zero when `dry_run` is set.
1Availability of the historical listing. An empty retry listing does not change the original counts or mean that no cancellations were requested.
INCLUDEDNumber of open orders that matched the filter when the request was accepted, including orders whose cancellation was already in progress and open orders that triggers placed. Triggers themselves are never counted. Orders placed after acceptance are not counted. Unless `dry_run` is set, equals `submitted_cancels` plus `failed_cancels`.
1Cancel-all submission outcome.
SUBMITTEDNumber of matched orders for which cancellation was requested, including orders whose cancellation was already in progress. Observe order updates or reads for final outcomes; orders may execute before cancellation takes effect. Zero when `dry_run` is set.
1Number of orders whose cancellation was requested, including those not listed in `cancelled_orders`. Equals `submitted_cancels`. Zero when `dry_run` is set.
1True when more orders were canceled than `cancelled_orders` lists.
falseServer timestamp.
2025-01-01T00:00:00ZServer timestamp as epoch nanoseconds (for bots).
1735689600000000000| Key | HTTP status | Connect code | Error | When |
|---|---|---|---|---|
| unauthenticated | 401 | unauthenticated | Unauthenticated | Authentication required. |
| permission-denied | 403 | permission_denied | Permission Denied | Permission denied. |
| invalid-argument | 400 | invalid_argument | Invalid Argument | Invalid argument. |
| not-found | 404 | not_found | Not Found | Not found. |
| unavailable | 503 | unavailable | Unavailable | Service unavailable. |