# Cancel all orders of the broker on a market **DELETE /trading/markets/{market_id}/orders** Cancels every resting order the authenticated broker has on the market, across all of its accounts. The command is accepted asynchronously: each cancelled order arrives later as a regular order update (status CANCELLED, status_reason USER_REQUEST) whose last_cmd_id_hex equals the returned ref_id. A market that is unknown, closed, settled or voided is rejected with 422. If the market closes while the command is in flight, the engine ignores the command: the close has already cancelled every order. ## 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. Its server-side context has a sliding TTL of one hour, refreshed by every request carrying the key. Reuse with a different payload returns 409 idempotency_key_mismatch. Reuse with an identical payload returns 202 after the command has been accepted; if its outcome cannot be confirmed after the safe retry period, it returns 503 outcome_unknown and the server makes no further delivery attempts. - **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 - **market_id** (string) Unique identifier for the market ## Responses ### 201 Cancel-all command accepted #### Body: application/json (object) - **ref_id** (string) System fingerprint of the request (cmd_id, 32 lowercase hex). Every order cancelled by this command carries it as last_cmd_id_hex. ### 202 Idempotent replay (already accepted) #### Body: application/json (object) - **ref_id** (string) System fingerprint of the request (cmd_id, 32 lowercase hex). Every order cancelled by this command carries it as last_cmd_id_hex. ### 403 The broker is not allowed to perform this action in the current market state #### 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 The request could not be served. `error_code` in the response body gives the reason and determines whether the request may be retried. #### Body: application/json (object) - **error_code** (string) - **message** (string) - **details** (object) [Powered by Bump.sh](https://bump.sh)