> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xo.market/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel orders for a market

> Cancel every order the caller has on one market.



## OpenAPI

````yaml /api-reference/openapi.yaml delete /cancel-market-orders
openapi: 3.0.3
info:
  title: XO Orderbook API
  description: |
    Public REST surface of the XO CLOB API.

    XO mainnet chain id is `3223`. The EIP-712 order domain is
    `XO Market CLOB` with `verifyingContract` set to the
    [CTF Exchange](/) address. See
    [Smart accounts](../guides/smart-accounts) for the smart-account
    identity model and ERC-1271 order signing.

    Wire conventions:
      * Prices are trimmed decimal strings (e.g. `"0.5"`, `"0.555"`).
      * Sizes are decimal-string integers in human shares.
      * Timestamps in trade and book responses are stringified Unix
        seconds / milliseconds (the SDK uses `TimestampSeconds<String>`
        / `TimestampMilliSeconds<String>`).
      * Token IDs are decimal U256 strings; condition IDs are
        `0x`-prefixed 32-byte hex.
  version: 1.0.0
  contact:
    name: XO Market
    url: https://beta.xo.market
servers:
  - url: https://orderbooks.xo.market
    description: Mainnet (XO chain id 3223)
security: []
tags:
  - name: Authentication
    description: >-
      Create and manage API keys. The L1 ClobAuth EIP-712 flow mints HMAC
      credentials that authenticate every other private request.
  - name: Market Data
    description: >-
      Public reads for books, prices, midpoints, spreads, last trades, and price
      history. Also includes server time and per-token configuration.
  - name: Markets
    description: >-
      Discovery for tradable markets, including pagination and SDK-compatible
      simplified shapes.
  - name: Trade
    description: Place, cancel, and inspect orders and trades for the authenticated maker.
  - name: Account
    description: Maker balance, allowance, positions, and claimable settled positions.
paths:
  /cancel-market-orders:
    delete:
      tags:
        - Trade
      summary: Cancel orders for a market
      description: Cancel every order the caller has on one market.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancelMarketOrdersRequest'
            examples:
              one_market:
                value:
                  marketId: >-
                    0x39a12d52b63969654926e095ddd96f5c459112714da03edca769aa58173c78fb
                  signature: >-
                    0xa1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f901b
                  signatureType: 3
                  signer: '0xCAFE000000000000000000000000000000000A11'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelResponse'
              example:
                canceled:
                  - '101'
                  - '102'
                notCanceled: {}
        '401':
          $ref: '#/components/responses/Error401'
      x-codeSamples:
        - lang: Rust
          label: xo-orderbook-client-rs
          source: >
            // Requires an authenticated client.

            use
            xo_orderbook_client::orderbook::types::request::CancelMarketOrderRequest;

            use xo_orderbook_client::types::U256;


            let token_id = U256::from_str_radix(
                "26516164265702901957933644848127860370782874751279270726689263951695181556943",
                10,
            )?;

            let resp = client
                .cancel_market_orders(&CancelMarketOrderRequest {
                    market: "0x39a12d52b63969654926e095ddd96f5c459112714da03edca769aa58173c78fb".to_owned(),
                    asset_id: Some(token_id),
                })
                .await?;
components:
  schemas:
    CancelMarketOrdersRequest:
      type: object
      required:
        - marketId
        - signature
        - signatureType
      properties:
        marketId:
          type: string
        signature:
          type: string
        signatureType:
          type: integer
          enum:
            - 0
            - 3
        signer:
          type: string
    CancelResponse:
      type: object
      description: |
        Wire shape uses **camelCase** (`canceled` / `notCanceled`) per the
        CLOB SDK contract. American spelling — one `l` (NOT `cancelled`).
        Shared by `DELETE /order`, `DELETE /orders`, `DELETE /cancel-all`,
        `DELETE /cancel-market-orders`.
      required:
        - canceled
        - notCanceled
      properties:
        canceled:
          type: array
          items:
            type: string
          description: Order ids that were successfully cancelled, decimal strings.
        notCanceled:
          type: object
          additionalProperties:
            type: string
          description: |
            Map of `<order_id> → <reason>` for orders that could not be
            cancelled. Common reasons: `"already filled"`,
            `"not found"`, `"not owner"`.
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
  responses:
    Error401:
      description: |
        Authentication failure. L1 ClobAuth (wallet) or L2 HMAC (API key)
        headers were missing, malformed, expired, or did not match the
        requested resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            l1_required:
              summary: L1 ClobAuth headers missing
              value:
                error: L1 ClobAuth headers required
            l2_required:
              summary: HMAC credentials missing
              value:
                error: HMAC L2 credentials required
            address_mismatch:
              summary: L1-recovered address does not match request
              value:
                error: L1 auth address does not match request address

````