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.
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
{
"failedCancels": 1,
"matchedOrders": 1,
"status": "SUBMITTED",
"submittedCancels": 1,
"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.
Target sub-account numeric ID. When omitted, uses caller's root account.
Up to 100 trading pair symbols, e.g. [BTC-USDT, ETH-USDT]. Empty matches all symbols; duplicates are ignored.
Number of cancels that could not be submitted (already canceled, etc.).
1Number of orders that matched the filter.
1Cancel-all submission outcome.
SUBMITTEDNumber of cancel requests submitted for processing.
1Server timestamp.
2025-01-01T00:00:00ZServer timestamp as epoch nanoseconds (for bots).
1735689600000000000| Key | Status | Error | When |
|---|---|---|---|
| unauthenticated | 401 | Unauthenticated | Authentication required. |
| permission-denied | 403 | Permission Denied | Permission denied. |
| invalid-argument | 400 | Invalid Argument | Invalid argument. |
| not-found | 404 | Not Found | Not found. |
| unavailable | 503 | Unavailable | Service unavailable. |