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

# Create orders (batch)

> Place up to 20 limit orders in one call (`trade` key), in the order given. Every item answers for itself — an order, or an error with the same codes as POST /portfolio/orders — so one refusal never fails the rest. Each item costs one unit of the key's order budget; an item past the budget is answered RATE_LIMITED in place.



## OpenAPI

````yaml api-reference/openapi.json POST /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:
    post:
      summary: Create orders (batch)
      description: >-
        Place up to 20 limit orders in one call (`trade` key), in the order
        given. Every item answers for itself — an order, or an error with the
        same codes as POST /portfolio/orders — so one refusal never fails the
        rest. Each item costs one unit of the key's order budget; an item past
        the budget is answered RATE_LIMITED in place.
      operationId: createOrders
      requestBody:
        $ref: '#/components/requestBodies/BatchCreateOrders'
      responses:
        '200':
          description: One result per item, in the order sent.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchOrdersResponse'
        '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:
    BatchCreateOrders:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BatchCreateOrdersRequest'
  schemas:
    BatchOrdersResponse:
      type: object
      properties:
        results:
          type: array
          items:
            type: object
            properties:
              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.
              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:
              - client_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
    BatchCreateOrdersRequest:
      type: object
      properties:
        orders:
          minItems: 1
          maxItems: 20
          type: array
          items:
            type: object
            properties:
              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).
              count:
                type: string
                pattern: ^(0|[1-9]\d*)(\.\d{1,2})?$
                description: Contracts, as a string — up to two decimals (centi-contracts).
              time_in_force:
                default: good_till_canceled
                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:
                default: false
                description: >-
                  Refuse the order (POST_ONLY_CROSS) if any of it would trade at
                  once, so it only rests on the book as a fee-free maker order
                  that earns rebates. good_till_canceled only.
                type: boolean
              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.
            required:
              - market_ticker
              - outcome
              - action
              - price
              - count
              - client_order_id
            additionalProperties: false
          description: >-
            1–20 orders, placed together; results in this order. Each
            client_order_id at most once.
      required:
        - orders
      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.