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

# Cancel All Orders

> Cancel all existing orders for a user



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/order/cancel-all
openapi: 3.1.0
info:
  title: ekiden-gateway
  description: >-
    API Gateway and WebSocket proxy based on Axum and Utoipa, handling auth,
    rate limiting, and connection buffering.
  license:
    name: ''
  version: 0.1.1
servers:
  - url: https://api.ekiden.fi/
    description: Production
  - url: https://api.staging.ekiden.fi/
    description: Staging
  - url: https://api.dev.ekiden.fi/
    description: Development
  - url: http://localhost:4020/
    description: Local
security: []
paths:
  /api/v1/order/cancel-all:
    post:
      tags:
        - Trade
      summary: Cancel All Orders
      description: Cancel all existing orders for a user
      operationId: cancel_all_orders
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancelAllOrdersRequest'
        required: true
      responses:
        '200':
          description: Orders canceled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelAllOrdersResponse'
      security:
        - bearer_auth: []
components:
  schemas:
    CancelAllOrdersRequest:
      type: object
      description: >-
        Request to cancel all orders, optionally filtered by symbol

        TODO: Cancels up to 500 orders per request

        TODO: System picks up 500 orders randomly to cancel when you have over
        500 orders
      required:
        - sub_account_address
      properties:
        sub_account_address:
          type: string
        symbol:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Symbol'
    CancelAllOrdersResponse:
      type: object
      required:
        - result
        - exit_info
        - time
      properties:
        exit_info:
          $ref: '#/components/schemas/ExitMessage'
          description: Information about the exit status of the cancel all operation.
        result:
          type: array
          items:
            $ref: '#/components/schemas/CancelOrderResponse'
        time:
          type: string
          format: date-time
          example: '1672531200000'
    Symbol:
      type: string
      example: BTCUSDC
    ExitMessage:
      oneOf:
        - type: object
          required:
            - Error
          properties:
            Error:
              type: object
              required:
                - code
                - msg
              properties:
                code:
                  type: integer
                  format: int32
                  minimum: 0
                msg:
                  $ref: '#/components/schemas/String'
        - type: object
          required:
            - Success
          properties:
            Success:
              type: object
              required:
                - code
                - msg
              properties:
                code:
                  type: integer
                  format: int32
                  minimum: 0
                msg:
                  type: string
    CancelOrderResponse:
      type: object
      description: Response for canceling an order.
      properties:
        order_id:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/OrderId'
        order_link_id:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/OrderLinkId'
    String:
      type: string
    OrderId:
      type: string
      format: uuid
    OrderLinkId:
      type: string
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer

````