> ## 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.

# Batch Cancel Orders

> Cancel up to 20 unfilled or partially filled orders.

`exit_info` is 1:1 with the request. `result` lists successful items only. Set `await_outcome=true` to wait for each item's final outcome (`EcOrderNotExist`, `EcTooLateToCancel`).



## OpenAPI

````yaml /v2/api-reference/openapi.json post /api/v1/order/cancel-batch
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.dev.ekiden.fi/
    description: Production (Canton Mainnet)
security: []
paths:
  /api/v1/order/cancel-batch:
    post:
      tags:
        - Trade
      summary: Batch Cancel Orders
      description: >-
        Cancel up to 20 unfilled or partially filled orders.


        `exit_info` is 1:1 with the request. `result` lists successful items
        only. Set `await_outcome=true` to wait for each item's final outcome
        (`EcOrderNotExist`, `EcTooLateToCancel`).
      operationId: batch_cancel_orders
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchCancelOrdersRequest'
        required: true
      responses:
        '200':
          description: Orders processed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchCancelOrdersResponse'
        '400':
          description: Bad request
      security:
        - bearer_auth: []
components:
  schemas:
    BatchCancelOrdersRequest:
      type: object
      description: >-
        Cancel up to 20 unfilled or partially filled orders. `exit_info` is 1:1
        with the request.
      required:
        - request
      properties:
        await_outcome:
          type: boolean
          description: >-
            If true, wait for each item's final outcome in `exit_info` (timeout
            3s).
        request:
          type: array
          items:
            $ref: '#/components/schemas/CancelOrderRequest'
    BatchCancelOrdersResponse:
      type: object
      description: Response of batch cancel orders.
      required:
        - result
        - exit_info
        - time
      properties:
        exit_info:
          type: array
          items:
            $ref: '#/components/schemas/ExitMessage'
          description: Per-item outcome, 1:1 with the request.
        result:
          type: array
          items:
            $ref: '#/components/schemas/CancelOrderResponse'
          description: Successful items only.
        time:
          type: string
          format: date-time
          example: '1672531200000'
    CancelOrderRequest:
      type: object
      description: >-
        Cancel an unfilled or partially filled order.


        Either `order_id` or `order_link_id` is required. If both are passed,
        `order_id` is used.
      required:
        - sub_account_address
        - symbol
      properties:
        order_id:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/OrderId'
              description: Order ID. Either `order_id` or `order_link_id` is required.
        order_link_id:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/OrderLinkId'
              description: >-
                User-customised order ID. Either `order_id` or `order_link_id`
                is required.
        sub_account_address:
          type: string
        symbol:
          $ref: '#/components/schemas/Symbol'
          description: Symbol name, e.g. `BTC-USDTx`.
    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: Acknowledgement of a cancel request.
      properties:
        order_id:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/OrderId'
        order_link_id:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/OrderLinkId'
    OrderId:
      type: string
      format: uuid
    OrderLinkId:
      type: string
    Symbol:
      type: string
      example: BTCUSDC
    String:
      type: string
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.