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

# Submit Order

> Accepts one or more market orders and returns an issued `orderId`.



## OpenAPI

````yaml /openapi/v1.json post /v1/orders
openapi: 3.0.0
info:
  title: ParlayX API
  version: 1.0.0
  description: Aggregated prediction-market trading API
servers:
  - url: https://api.parlayx.com
security:
  - apiKey: []
tags:
  - name: Markets
    description: Discover markets and find cross-venue matches.
  - name: Orders
    description: Submit, inspect, and cancel orders.
  - name: Rebalances
    description: Move funds between venues and track the transfer.
  - name: Balance
    description: Read account balances and funding state.
paths:
  /v1/orders:
    post:
      tags:
        - Orders
      summary: Submit Order
      description: Accepts one or more market orders and returns an issued `orderId`.
      operationId: submitOrder
      parameters:
        - schema:
            type: string
            minLength: 1
            description: >-
              Idempotency key for this request. Re-sending the same key with the
              same body returns the original result and creates no duplicate;
              re-sending it with a different body is rejected with 422.
            example: 2f1a8c4e-0b3d-4a9c-8e7f-1a2b3c4d5e6f
          required: true
          name: Idempotency-Key
          in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitOrderRequest'
      responses:
        '200':
          description: Order accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitOrderResponse'
        '400':
          description: Invalid request, or a missing/malformed Idempotency-Key header
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
        '403':
          description: API key missing, malformed, or not recognized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
              example:
                message: Forbidden
        '422':
          description: Idempotency key reused with a different request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IdempotencyConflictError'
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      x-codeSamples:
        - lang: typescript
          label: TypeScript SDK
          source: >
            import { createClient } from "@parlayx/sdk";


            const client = createClient({ apiKey: process.env.PARLAYX_API_KEY!
            });


            const { orderId } = await client.submitOrder({
              marketOrders: [
                {
                  marketInfo: {
                    venue: "polymarket",
                    outcomeId: "5161623255678193352839985156330393796378434470119114669671615782853260939535",
                  },
                  side: "buy",
                  amount: 5,
                  type: "market",
                  timeInForce: { type: "FOK" },
                },
              ],
            });


            console.log("submitted order:", orderId);
components:
  schemas:
    SubmitOrderRequest:
      type: object
      properties:
        marketOrders:
          type: array
          items:
            $ref: '#/components/schemas/OrderRequest'
          minItems: 1
          description: One or more market orders to submit.
      required:
        - marketOrders
    SubmitOrderResponse:
      type: object
      properties:
        orderId:
          type: string
          minLength: 1
          description: Issued `orderId`. Stable handle for status lookups.
          example: 3f8b2c9a-2d18-4f7e-9c2a-1b6e1f0c8a4d
      required:
        - orderId
    BadRequestError:
      anyOf:
        - $ref: '#/components/schemas/ApiError'
        - $ref: '#/components/schemas/IdempotencyBadRequestError'
    AuthError:
      type: object
      properties:
        message:
          type: string
          description: Plain-text explanation of the authentication error.
      required:
        - message
    IdempotencyConflictError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - IDEMPOTENCY_CONFLICT
              example: IDEMPOTENCY_CONFLICT
            message:
              type: string
              example: Idempotency key was reused with a different request body
          required:
            - code
            - message
      required:
        - error
    ApiError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              $ref: '#/components/schemas/ApiErrorCode'
            message:
              type: string
              description: Plain-text explanation of the error.
          required:
            - code
            - message
      required:
        - error
    OrderRequest:
      oneOf:
        - $ref: '#/components/schemas/MarketOrder'
        - $ref: '#/components/schemas/LimitOrder'
        - $ref: '#/components/schemas/StopOrder'
        - $ref: '#/components/schemas/StopLimitOrder'
        - $ref: '#/components/schemas/IcebergOrder'
      discriminator:
        propertyName: type
        mapping:
          market:
            $ref: '#/components/schemas/MarketOrder'
          limit:
            $ref: '#/components/schemas/LimitOrder'
          stop:
            $ref: '#/components/schemas/StopOrder'
          stop_limit:
            $ref: '#/components/schemas/StopLimitOrder'
          iceberg:
            $ref: '#/components/schemas/IcebergOrder'
      title: OrderRequest
    IdempotencyBadRequestError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              $ref: '#/components/schemas/IdempotencyBadRequestErrorCode'
            message:
              type: string
          required:
            - code
            - message
      required:
        - error
    ApiErrorCode:
      type: string
      enum:
        - INVALID_REQUEST
        - NOT_FOUND
        - INSUFFICIENT_BALANCE
        - IDEMPOTENCY_CONFLICT
        - ORDER_NOT_CANCELLABLE
        - INTERNAL_ERROR
      description: Stable identifier for the error category.
    MarketOrder:
      type: object
      properties:
        marketInfo:
          $ref: '#/components/schemas/MarketInfo'
        side:
          $ref: '#/components/schemas/OrderSide'
        amount:
          type: number
          minimum: 0
          exclusiveMinimum: true
          description: >-
            Order amount in USDC (minimum $1). Up to 6 decimal places
            (micro-USDC). Mutually exclusive with `shares`.
          example: 20
        shares:
          type: number
          minimum: 0
          exclusiveMinimum: true
          description: >-
            Order size in outcome shares (contracts). Mutually exclusive with
            `amount`. A market or stop BUY is sized in USDC notional, so
            `shares` is rejected there; every other order (any sell, and resting
            limit / stop-limit / iceberg buys) may be share-sized. Floored to
            the venue's share tick at execution.
          example: 100
        type:
          type: string
          enum:
            - market
          description: >-
            Market order. Executes immediately against resting liquidity; bound
            a BUY with maxFillPrice or a SELL with minFillPrice.
          example: market
        timeInForce:
          oneOf:
            - $ref: '#/components/schemas/FokTimeInForce'
            - $ref: '#/components/schemas/FakTimeInForce'
          discriminator:
            propertyName: type
            mapping:
              FOK:
                $ref: '#/components/schemas/FokTimeInForce'
              FAK:
                $ref: '#/components/schemas/FakTimeInForce'
          description: |-
            Market fill policy. Allowed values by venue:

            - **Polymarket:** FOK, FAK
            - **Limitless:** FAK
        maxFillPrice:
          type: number
          minimum: 0
          exclusiveMinimum: true
          maximum: 1
          exclusiveMaximum: true
          description: Per-share cap for a BUY (0–1); fills come back at or below it.
          example: 0.6
        minFillPrice:
          type: number
          minimum: 0
          exclusiveMinimum: true
          maximum: 1
          exclusiveMaximum: true
          description: Per-share floor for a SELL (0–1); fills come back at or above it.
          example: 0.4
        allowDustSell:
          type: boolean
          description: >-
            Escape hatch for exiting a sub-$1 position. Valid ONLY on a
            Polymarket amount-sized market SELL, where execution normally clamps
            the fill to the held balance so an over-large USD request liquidates
            the whole position. When set, the order is exempt from the $1
            minimum-notional floor. Rejected on any other venue, side, or on a
            share-sized order.
          example: true
      required:
        - marketInfo
        - side
        - type
        - timeInForce
      additionalProperties: false
      title: MarketOrder
    LimitOrder:
      type: object
      properties:
        marketInfo:
          $ref: '#/components/schemas/MarketInfo'
        side:
          $ref: '#/components/schemas/OrderSide'
        amount:
          type: number
          minimum: 0
          exclusiveMinimum: true
          description: >-
            Order amount in USDC (minimum $1). Up to 6 decimal places
            (micro-USDC). Mutually exclusive with `shares`.
          example: 20
        shares:
          type: number
          minimum: 0
          exclusiveMinimum: true
          description: >-
            Order size in outcome shares (contracts). Mutually exclusive with
            `amount`. A market or stop BUY is sized in USDC notional, so
            `shares` is rejected there; every other order (any sell, and resting
            limit / stop-limit / iceberg buys) may be share-sized. Floored to
            the venue's share tick at execution.
          example: 100
        type:
          type: string
          enum:
            - limit
          description: >-
            Limit order. Rests at limitPrice until filled, cancelled, or (GTD)
            expired.
          example: limit
        timeInForce:
          oneOf:
            - $ref: '#/components/schemas/FakTimeInForce'
            - $ref: '#/components/schemas/GtcTimeInForce'
            - $ref: '#/components/schemas/GtdTimeInForce'
          discriminator:
            propertyName: type
            mapping:
              FAK:
                $ref: '#/components/schemas/FakTimeInForce'
              GTC:
                $ref: '#/components/schemas/GtcTimeInForce'
              GTD:
                $ref: '#/components/schemas/GtdTimeInForce'
          description: |-
            Limit fill policy (all require limitPrice). Allowed values by venue:

            - **Polymarket:** GTC, GTD
            - **Limitless:** FAK, GTC, GTD
            - **predict.fun:** GTC, GTD
        limitPrice:
          type: number
          minimum: 0
          exclusiveMinimum: true
          maximum: 1
          exclusiveMaximum: true
          description: Limit price (0–1 implied probability).
          example: 0.55
      required:
        - marketInfo
        - side
        - type
        - timeInForce
        - limitPrice
      additionalProperties: false
      title: LimitOrder
    StopOrder:
      type: object
      properties:
        marketInfo:
          $ref: '#/components/schemas/MarketInfo'
        side:
          $ref: '#/components/schemas/OrderSide'
        amount:
          type: number
          minimum: 0
          exclusiveMinimum: true
          description: >-
            Order amount in USDC (minimum $1). Up to 6 decimal places
            (micro-USDC). Mutually exclusive with `shares`.
          example: 20
        shares:
          type: number
          minimum: 0
          exclusiveMinimum: true
          description: >-
            Order size in outcome shares (contracts). Mutually exclusive with
            `amount`. A market or stop BUY is sized in USDC notional, so
            `shares` is rejected there; every other order (any sell, and resting
            limit / stop-limit / iceberg buys) may be share-sized. Floored to
            the venue's share tick at execution.
          example: 100
        type:
          type: string
          enum:
            - stop
          description: >-
            Stop (market): a market order plus a trigger. Rests nothing on the
            venue; watches the executable side of top-of-book and fires a child
            market order once the reference price crosses `triggerPrice`. Watch
            direction comes from `side`: a SELL stop fires when the reference
            falls to/through the trigger, a BUY stop when it rises to/through
            it. Certain to fire, fill price not guaranteed — a gap-through fills
            the child at the next available price.
          example: stop
        timeInForce:
          oneOf:
            - $ref: '#/components/schemas/FokTimeInForce'
            - $ref: '#/components/schemas/FakTimeInForce'
          discriminator:
            propertyName: type
            mapping:
              FOK:
                $ref: '#/components/schemas/FokTimeInForce'
              FAK:
                $ref: '#/components/schemas/FakTimeInForce'
          description: >-
            Fill policy for the child market order the trigger fires. Allowed
            values by venue:


            - **Polymarket:** FOK, FAK

            - **Limitless:** FAK
        triggerPrice:
          type: number
          minimum: 0
          exclusiveMinimum: true
          maximum: 1
          exclusiveMaximum: true
          description: >-
            Trigger level (0–1 implied probability). The child order fires when
            the executable side of top-of-book crosses this level (falls to it
            for a SELL, rises to it for a BUY).
          example: 0.35
        triggerFillDepth:
          type: number
          minimum: 0
          exclusiveMinimum: true
          default: 1
          description: >-
            Cumulative size (outcome shares) that must rest past `triggerPrice`
            before firing. Default 1 fires on touch; a larger value waits for
            that much fillable depth past the level.
          example: 1
      required:
        - marketInfo
        - side
        - type
        - timeInForce
        - triggerPrice
      additionalProperties: false
      title: StopOrder
    StopLimitOrder:
      type: object
      properties:
        marketInfo:
          $ref: '#/components/schemas/MarketInfo'
        side:
          $ref: '#/components/schemas/OrderSide'
        amount:
          type: number
          minimum: 0
          exclusiveMinimum: true
          description: >-
            Order amount in USDC (minimum $1). Up to 6 decimal places
            (micro-USDC). Mutually exclusive with `shares`.
          example: 20
        shares:
          type: number
          minimum: 0
          exclusiveMinimum: true
          description: >-
            Order size in outcome shares (contracts). Mutually exclusive with
            `amount`. A market or stop BUY is sized in USDC notional, so
            `shares` is rejected there; every other order (any sell, and resting
            limit / stop-limit / iceberg buys) may be share-sized. Floored to
            the venue's share tick at execution.
          example: 100
        type:
          type: string
          enum:
            - stop_limit
          description: >-
            Stop (limit): a limit order plus a trigger. Rests nothing on the
            venue; watches the executable side of top-of-book and, once the
            reference price crosses `triggerPrice`, fires a child limit order
            that rests at `limitPrice`. Watch direction comes from `side`, as
            for a stop. Fill price is guaranteed (the resting limit), the fill
            itself is not — a gap-through may leave the child limit unfilled.
          example: stop_limit
        timeInForce:
          oneOf:
            - $ref: '#/components/schemas/GtcTimeInForce'
            - $ref: '#/components/schemas/GtdTimeInForce'
          discriminator:
            propertyName: type
            mapping:
              GTC:
                $ref: '#/components/schemas/GtcTimeInForce'
              GTD:
                $ref: '#/components/schemas/GtdTimeInForce'
          description: >-
            Fill policy for the child limit order the trigger fires; the child
            rests

            at limitPrice, so only the resting policies are allowed. Allowed
            values by venue:


            - **Polymarket:** GTC, GTD

            - **Limitless:** GTC, GTD

            - **predict.fun:** GTC, GTD
        limitPrice:
          type: number
          minimum: 0
          exclusiveMinimum: true
          maximum: 1
          exclusiveMaximum: true
          description: Limit price (0–1 implied probability).
          example: 0.55
        triggerPrice:
          type: number
          minimum: 0
          exclusiveMinimum: true
          maximum: 1
          exclusiveMaximum: true
          description: >-
            Trigger level (0–1 implied probability). The child order fires when
            the executable side of top-of-book crosses this level (falls to it
            for a SELL, rises to it for a BUY).
          example: 0.35
        triggerFillDepth:
          type: number
          minimum: 0
          exclusiveMinimum: true
          default: 1
          description: >-
            Cumulative size (outcome shares) that must rest past `triggerPrice`
            before firing. Default 1 fires on touch; a larger value waits for
            that much fillable depth past the level.
          example: 1
      required:
        - marketInfo
        - side
        - type
        - timeInForce
        - limitPrice
        - triggerPrice
      additionalProperties: false
      title: StopLimitOrder
    IcebergOrder:
      type: object
      properties:
        marketInfo:
          $ref: '#/components/schemas/MarketInfo'
        side:
          $ref: '#/components/schemas/OrderSide'
        amount:
          type: number
          minimum: 0
          exclusiveMinimum: true
          description: >-
            Order amount in USDC (minimum $1). Up to 6 decimal places
            (micro-USDC). Mutually exclusive with `shares`.
          example: 20
        shares:
          type: number
          minimum: 0
          exclusiveMinimum: true
          description: >-
            Order size in outcome shares (contracts). Mutually exclusive with
            `amount`. A market or stop BUY is sized in USDC notional, so
            `shares` is rejected there; every other order (any sell, and resting
            limit / stop-limit / iceberg buys) may be share-sized. Floored to
            the venue's share tick at execution.
          example: 100
        type:
          type: string
          enum:
            - iceberg
          description: >-
            Iceberg order. A resting limit order worked in small visible slices:
            only the visible slice (`displayAmount` when amount-sized,
            `displayShares` when share-sized) is posted to the venue at a time
            (post-only / maker-only, enforced by the engine — not a caller
            field), and as each slice fills the next is reloaded until the full
            `amount`/`shares` is worked off, cancelled, or (for a GTD iceberg)
            the `timeInForce` deadline passes. `timeInForce` is the order's
            lifetime, exactly as for a limit order.
          example: iceberg
        timeInForce:
          oneOf:
            - $ref: '#/components/schemas/GtcTimeInForce'
            - $ref: '#/components/schemas/GtdTimeInForce'
          discriminator:
            propertyName: type
            mapping:
              GTC:
                $ref: '#/components/schemas/GtcTimeInForce'
              GTD:
                $ref: '#/components/schemas/GtdTimeInForce'
          description: >-
            The iceberg's lifetime, exactly as for a limit order — the engine
            works

            slices until it. The slices rest at limitPrice, so only the resting

            policies are allowed (FOK/FAK is contradictory for an iceberg):


            - **GTC:** work until fully filled or cancelled.

            - **GTD:** work until `expiresAt`, then stop reloading. The engine
            clamps
              each internal slice to that one deadline.

            Allowed values by venue:


            - **Polymarket:** GTC, GTD

            - **Limitless:** GTC (the venue rejects an on-chain expiration, so
            no GTD)
        limitPrice:
          type: number
          minimum: 0
          exclusiveMinimum: true
          maximum: 1
          exclusiveMaximum: true
          description: Limit price (0–1 implied probability).
          example: 0.55
        displayAmount:
          type: number
          minimum: 0
          exclusiveMinimum: true
          description: >-
            Visible slice size in USDC, for an amount-sized iceberg. At most
            this much notional rests on the venue at once (the engine converts
            to shares via `limitPrice`); the engine reloads the next slice as
            each fills. Required (and only allowed) when the order is sized in
            `amount`; must be <= `amount`, and the resulting share slice
            (displayAmount / limitPrice) must independently clear the venue
            minimum order size (Polymarket: 5 shares; Limitless: 1 whole share)
            as well as this $1 notional floor.
          example: 5
        displayShares:
          type: number
          minimum: 0
          exclusiveMinimum: true
          description: >-
            Visible slice size in outcome shares (contracts), for a share-sized
            iceberg. At most this many shares rest on the venue at once; the
            engine reloads the next slice as each fills. Required (and only
            allowed) when the order is sized in `shares`; must be <= `shares`,
            and each slice must independently clear the venue minimum order size
            (Polymarket: 5 shares; Limitless: 1 whole share) in addition to the
            $1 slice-notional floor.
          example: 25
      required:
        - marketInfo
        - side
        - type
        - timeInForce
        - limitPrice
      additionalProperties: false
      title: IcebergOrder
    IdempotencyBadRequestErrorCode:
      type: string
      enum:
        - IDEMPOTENCY_KEY_REQUIRED
        - IDEMPOTENCY_KEY_INVALID
      description: Stable identifier for the Idempotency-Key header validation failure.
      example: IDEMPOTENCY_KEY_REQUIRED
    MarketInfo:
      oneOf:
        - $ref: '#/components/schemas/PolymarketMarketInfo'
        - $ref: '#/components/schemas/LimitlessMarketInfo'
        - $ref: '#/components/schemas/PredictFunMarketInfo'
      discriminator:
        propertyName: venue
        mapping:
          polymarket:
            $ref: '#/components/schemas/PolymarketMarketInfo'
          limitless:
            $ref: '#/components/schemas/LimitlessMarketInfo'
          predict_fun:
            $ref: '#/components/schemas/PredictFunMarketInfo'
      description: The market and outcome to trade.
      title: MarketInfo
    OrderSide:
      type: string
      enum:
        - buy
        - sell
      example: buy
    FokTimeInForce:
      type: object
      properties:
        type:
          type: string
          enum:
            - FOK
      required:
        - type
      additionalProperties: false
      description: >-
        Fill or kill: fill in full immediately against resting liquidity,
        otherwise cancel.
      title: FillOrKill
    FakTimeInForce:
      type: object
      properties:
        type:
          type: string
          enum:
            - FAK
      required:
        - type
      additionalProperties: false
      description: >-
        Fill and kill: fill whatever is immediately available, then cancel the
        remainder.
      title: FillAndKill
    GtcTimeInForce:
      type: object
      properties:
        type:
          type: string
          enum:
            - GTC
      required:
        - type
      additionalProperties: false
      description: 'Good til cancelled: rest at limitPrice until filled or cancelled.'
      title: GoodTillCancelled
    GtdTimeInForce:
      type: object
      properties:
        type:
          type: string
          enum:
            - GTD
        expiresAt:
          type: string
          format: date-time
          description: >-
            ISO-8601 expiry (UTC). Truncated to whole seconds. Must be at least
            60 seconds in the future.
          example: '2099-12-31T00:00:00Z'
      required:
        - type
        - expiresAt
      additionalProperties: false
      description: >-
        Good til date: rest at limitPrice until filled, cancelled, or expired at
        expiresAt.
      title: GoodTillDate
    PolymarketMarketInfo:
      type: object
      properties:
        venue:
          type: string
          enum:
            - polymarket
        outcomeId:
          type: string
          minLength: 1
          description: The outcome's venue-native id from discovery.
      required:
        - venue
        - outcomeId
      additionalProperties: false
      title: PolymarketMarketInfo
    LimitlessMarketInfo:
      type: object
      properties:
        venue:
          type: string
          enum:
            - limitless
        marketId:
          type: string
          minLength: 1
          description: The market's `marketId` from discovery (the Limitless market slug).
        outcomeId:
          type: string
          minLength: 1
          description: The outcome's venue-native id from discovery.
      required:
        - venue
        - marketId
        - outcomeId
      additionalProperties: false
      title: LimitlessMarketInfo
    PredictFunMarketInfo:
      type: object
      properties:
        venue:
          type: string
          enum:
            - predict_fun
        marketId:
          type: string
          pattern: ^[1-9]\d*$
          description: predict.fun numeric market id — a positive integer, as a string.
          example: '481'
        outcomeId:
          type: string
          minLength: 1
          description: The outcome's venue-native id from discovery.
      required:
        - venue
        - marketId
        - outcomeId
      additionalProperties: false
      title: PredictFunMarketInfo
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````