OrdersService
Cancel Order
Cancel a single open order by order ID or client order ID. Supports optional subaccount and symbol scoping.
Method
POST
Path
/v1/orders/cancel
Visibility
Authentication
Session token or API key
MFA Requirement
Not required
POST
/v1/orders/cancel Request
Testnet
curl --request POST \ \
--url 'https://api.testnet.polyester.com/v1/orders/cancel' \
--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 '{
"orderId": "5USXJZmk",
"subaccountId": "45LUmqjT",
"symbol": "BTC-USDT"
}'Responses
{
"orderId": "5USXJZmk",
"status": "ACCEPTED",
"ts": "2025-01-01T00:00:00Z",
"tsNs": "1735689600000000000"
} clientOrderId string
Client order ID.
orderId string
Order ID as fixed64.
subaccountId string
Optional public subaccount ID. When omitted, subaccount-scoped API keys use their bound subaccount; other callers use their authenticated root account.
symbol string
Optional trading symbol numeric identifier. When set, it must match the order's symbol, or the order is reported unknown (ERROR_CODE_ORDER_UNKNOWN) and nothing is canceled. An order that ended a while ago may instead be reported ended (ERROR_CODE_ORDER_ALREADY_TERMINAL). When omitted, the order's own symbol is used.
orderId string
Order ID as fixed64.
Example
5USXJZmk status enum
Cancellation submission outcome.
ACCEPTED
Example
ACCEPTED ts string (date-time)
Server timestamp.
Example
2025-01-01T00:00:00Z tsNs string
Server timestamp as epoch nanoseconds (for bots).
Example
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. |