# Cancel order (by order_id or client_order_id) **DELETE /trading/accounts/{account_id}/orders** Requires market_id in body; if both order_id and client_order_id are provided, order_id takes precedence. ## Servers - Production: https://api.example.com/v1 (Production) - Sandbox: https://sandbox.api.example.com/v1 (Sandbox) ## Authentication methods - Api key auth ## Parameters ### Headers - **PRE-ACCESS-KEY** (string) Broker access key identifier. - **PRE-ACCESS-SIGNATURE** (string) Keyed BLAKE2b-256 signature (hex lowercase, 64 characters). - **PRE-ACCESS-TIMESTAMP** (string(date-time)) RFC3339 timestamp with milliseconds (e.g., 2025-10-30T06:00:34.075Z). Must be within clock_skew_tolerance (default 5m) of server time. - **Idempotency-Key** (string) Stable idempotency token reused on retries. Reuse with identical payload => 202. Reuse with different payload => 409 idempotency_key_mismatch. - **Correlation-Id** (string) Optional UUIDv7 correlation identifier (lowercase). Must match RFC4122 UUIDv7 (version nibble '7', variant 8|9|a|b). If present but invalid → 422 invalid_correlation_id (error_code). ### Path parameters - **account_id** (string) Broker-supplied account identifier; length 1..128; charset [A-Za-z0-9._~-]. ### Body: application/json (object) - **market_id** (string) - **order_id** (string(uuid)) If both order_id and client_order_id are provided, order_id takes precedence - **client_order_id** (string) Alternative client-supplied identifier (unique per broker_id) ## Responses ### 201 Cancellation command accepted #### Body: application/json (object) - **order_id** (string(uuid)) Internal Order ID (if known or generated). - **client_order_id** (string) Client-supplied identifier (if provided). ### 202 Idempotent replay (already accepted) #### Body: application/json (object) - **order_id** (string(uuid)) Internal Order ID (if known or generated). - **client_order_id** (string) Client-supplied identifier (if provided). ### 404 Resource not found #### Body: application/json (object) - **error_code** (string) - **message** (string) - **details** (object) ### 409 Idempotency-Key reused with different payload #### Body: application/json (object) - **error_code** (string) - **message** (string) - **details** (object) ### 422 Validation / semantic error #### Body: application/json (object) - **error_code** (string) - **message** (string) - **details** (object) ### 503 Backpressure / temporary unavailability #### Body: application/json (object) - **error_code** (string) - **message** (string) - **details** (object) [Powered by Bump.sh](https://bump.sh)