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

# Cancel order



## OpenAPI

````yaml openapi/order-gateway.json POST /cancel-order
openapi: 3.1.0
info:
  title: ax-order-gateway
  description: ''
  license:
    name: ''
  version: 15.24.0
servers:
  - url: https://gateway.architect.exchange/orders
security: []
tags:
  - name: order-gateway
    description: Order gateway
paths:
  /cancel-order:
    post:
      tags:
        - order-gateway
      operationId: cancel_order
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancelOrderRequest'
        required: true
      responses:
        '200':
          description: Order cancel requested
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelOrderResponse'
        '400':
          description: Bad request
      security:
        - session_token: []
components:
  schemas:
    CancelOrderRequest:
      allOf:
        - $ref: '#/components/schemas/OrderReference'
          description: |-
            Identifier of the order to cancel; either `oid` (server order id) or
            `cid` (client order id).
        - type: object
          properties:
            aid:
              type:
                - string
                - 'null'
              description: >-
                Optional account ID, selecting which account's `cid` namespace
                the

                reference resolves against. Only meaningful when the order is
                given by

                `cid` — a `cid` is unique per account, not globally — and
                superfluous

                when `oid` is supplied (server order ids are globally unique).
                If

                omitted, the account is inferred from the connection: the user's
                default

                account, or the session account for an account-scoped session.
    CancelOrderResponse:
      type: object
      required:
        - cxl_rx
      properties:
        cxl_rx:
          type: boolean
          description: Whether the cancel request has been accepted; e.g. true, false
    OrderReference:
      oneOf:
        - type: object
          required:
            - oid
          properties:
            oid:
              $ref: '#/components/schemas/OrderId'
        - type: object
          required:
            - cid
          properties:
            cid:
              $ref: '#/components/schemas/ClientOrderId'
    OrderId:
      type: string
      description: |-
        Strong type for Order IDs to prevent mixing with other string values

        Order IDs are ULIDs with a prefix:

        - Regular orders: O-<ULID>
        - Liquidation orders: L-<ULID>
    ClientOrderId:
      type: integer
      format: int64
      minimum: 0
  securitySchemes:
    session_token:
      type: http
      scheme: bearer
      description: User session token

````