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

# Cancel orders (batch)

> Cancel up to 100 of your orders by id in one call, in the order given, each with its own result. Never rate limited.



## OpenAPI

````yaml api-reference/openapi.json DELETE /portfolio/orders/batch
openapi: 3.1.0
info:
  title: updown Trade API
  version: 1.0.0
  description: >-
    Public REST API. Market data needs no key; `/account` (and order entry, when
    it ships) takes an API key. Prices are dollar strings: whole cents (0.55),
    or 0.1¢ steps (0.999) in the tails of a market whose price_ranges list them;
    counts are contract strings, times are epoch ms. Generated from
    packages/protocol — do not edit by hand.
servers:
  - url: https://api.updown.fast/trade-api/v1
    description: production
security: []
paths:
  /portfolio/orders/batch:
    delete:
      summary: Cancel orders (batch)
      description: >-
        Cancel up to 100 of your orders by id in one call, in the order given,
        each with its own result. Never rate limited.
      operationId: cancelOrders
      requestBody:
        $ref: '#/components/requestBodies/BatchCancelOrders'
      responses:
        '200':
          description: One result per id, in the order sent.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchCancelResponse'
        '400':
          description: Invalid request (code BAD_REQUEST).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: No API key, or one that isn't valid (code UNAUTHORIZED).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            The key lacks the permission, or the account can't trade yet (code
            FORBIDDEN).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limited (code RATE_LIMITED); wait `Retry-After` seconds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: The book could not be read (code EXCHANGE_UNAVAILABLE); retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - apiKey: []
components:
  requestBodies:
    BatchCancelOrders:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BatchCancelOrdersRequest'
  schemas:
    BatchCancelResponse:
      type: object
      properties:
        results:
          type: array
          items:
            type: object
            properties:
              order_id:
                type: string
              order:
                type: object
                properties:
                  order_id:
                    type: string
                  client_order_id:
                    type: string
                    pattern: ^[A-Za-z0-9._:-]{1,64}$
                    description: >-
                      Your id for the order, unique per account. Retrying with
                      the same id never places a second order.
                  market_ticker:
                    type: string
                    pattern: ^[a-z0-9][a-z0-9-]{0,63}-\d{6}-\d{4}-\d{4}(d\d{1,2})?$
                    description: >-
                      Market ticker (one window of a series), e.g.
                      "btc-15m-261002-1400-1415". Opaque.
                  outcome:
                    type: string
                    enum:
                      - up
                      - down
                  action:
                    type: string
                    enum:
                      - buy
                      - sell
                  price:
                    type: string
                    pattern: ^0\.(0[1-9]|[1-9]\d|0\d[1-9]|9\d[1-9])$
                    description: >-
                      Contract price in dollars: "0.01"–"0.99" (whole cents), or
                      "0.001"–"0.099" / "0.901"–"0.999" on a tapered_deci_cent
                      market (see price_ranges).
                  time_in_force:
                    type: string
                    enum:
                      - good_till_canceled
                      - immediate_or_cancel
                    description: >-
                      good_till_canceled: what doesn't fill rests on the book
                      until it fills, you cancel it or the window closes.
                      immediate_or_cancel: fills what it can now; the rest is
                      cancelled.
                  post_only:
                    type: boolean
                  status:
                    type: string
                    enum:
                      - resting
                      - executed
                      - canceled
                  count:
                    type: string
                    pattern: ^(0|[1-9]\d*)(\.\d{1,2})?$
                    description: >-
                      Contracts, as a string — up to two decimals
                      (centi-contracts).
                  fill_count:
                    type: string
                    pattern: ^(0|[1-9]\d*)(\.\d{1,2})?$
                    description: >-
                      Contracts, as a string — up to two decimals
                      (centi-contracts).
                  remaining_count:
                    type: string
                    pattern: ^(0|[1-9]\d*)(\.\d{1,2})?$
                    description: >-
                      Contracts, as a string — up to two decimals
                      (centi-contracts).
                  average_fill_price:
                    type: string
                  fees_paid:
                    type: string
                  created_ts_ms:
                    type: integer
                    minimum: 0
                    maximum: 9007199254740991
                    description: Epoch milliseconds (UTC).
                required:
                  - order_id
                  - client_order_id
                  - market_ticker
                  - outcome
                  - action
                  - price
                  - time_in_force
                  - post_only
                  - status
                  - count
                  - fill_count
                  - remaining_count
                  - created_ts_ms
                additionalProperties: false
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - BAD_REQUEST
                      - NOT_FOUND
                      - SERIES_NOT_FOUND
                      - MARKET_NOT_FOUND
                      - METHOD_NOT_ALLOWED
                      - RATE_LIMITED
                      - UNAUTHORIZED
                      - FORBIDDEN
                      - ORDER_NOT_FOUND
                      - IDEMPOTENCY_CONFLICT
                      - ACCOUNT_BUSY
                      - MARKET_NOT_OPEN
                      - INSUFFICIENT_BALANCE
                      - LIMIT_EXCEEDED
                      - POST_ONLY_CROSS
                      - SELF_TRADE
                      - TRADING_PAUSED
                      - ORDER_REJECTED
                      - BOOST_UNAVAILABLE
                      - INTERNAL_ERROR
                      - EXCHANGE_UNAVAILABLE
                  message:
                    type: string
                  details:
                    type: string
                required:
                  - code
                  - message
                additionalProperties: false
            required:
              - order_id
            additionalProperties: false
      required:
        - results
      additionalProperties: false
    Error:
      type: object
      properties:
        code:
          type: string
          enum:
            - BAD_REQUEST
            - NOT_FOUND
            - SERIES_NOT_FOUND
            - MARKET_NOT_FOUND
            - METHOD_NOT_ALLOWED
            - RATE_LIMITED
            - UNAUTHORIZED
            - FORBIDDEN
            - ORDER_NOT_FOUND
            - IDEMPOTENCY_CONFLICT
            - ACCOUNT_BUSY
            - MARKET_NOT_OPEN
            - INSUFFICIENT_BALANCE
            - LIMIT_EXCEEDED
            - POST_ONLY_CROSS
            - SELF_TRADE
            - TRADING_PAUSED
            - ORDER_REJECTED
            - BOOST_UNAVAILABLE
            - INTERNAL_ERROR
            - EXCHANGE_UNAVAILABLE
        message:
          type: string
        details:
          type: string
      required:
        - code
        - message
      additionalProperties: false
    BatchCancelOrdersRequest:
      type: object
      properties:
        order_ids:
          minItems: 1
          maxItems: 100
          type: array
          items:
            type: string
            minLength: 1
          description: 1–100 of your order ids, cancelled together; results in this order.
      required:
        - order_ids
      additionalProperties: false
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        An API key from your account: `Authorization: Bearer
        udk_<live|test>_<id>_<secret>`.

````

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