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

# Place an order directly

> Places a market order on a single named venue without a prior quote. The route is priced and funded server-side and always produces exactly one order. `externalId` is required and unique within your app — two different users of the same app cannot share one — so retrying a timed-out request with the same value returns 409 instead of trading twice.



## OpenAPI

````yaml /openapi/openapi.json post /execution/orders
openapi: 3.0.2
info:
  title: AGG API
  version: 1.0.0
  description: >-
    Prediction market aggregator REST API — authentication, users, venue events,
    venue markets, orderbooks, charts, and execution workflows.
servers:
  - url: https://api.agg.market
    description: Production
  - url: https://api.staging.agg.market
    description: Staging
security: []
paths:
  /execution/orders:
    post:
      tags:
        - Execution
      summary: Place an order directly
      description: >-
        Places a market order on a single named venue without a prior quote. The
        route is priced and funded server-side and always produces exactly one
        order. `externalId` is required and unique within your app — two
        different users of the same app cannot share one — so retrying a
        timed-out request with the same value returns 409 instead of trading
        twice.
      operationId: placeOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - venue
                - venueMarketOutcomeId
                - side
                - externalId
              properties:
                venue:
                  description: >-
                    The venue to trade on. Singular by design — this endpoint
                    never splits an order.
                  type: string
                  enum:
                    - kalshi
                    - polymarket
                    - limitless
                    - opinion
                    - predict
                    - probable
                    - myriad
                    - hyperliquid
                    - novig
                venueMarketOutcomeId:
                  minLength: 1
                  description: >-
                    The outcome to trade. May be the outcome on another venue:
                    it is resolved through matched-outcome links to the
                    equivalent outcome on `venue`. Passing the id that already
                    lives on `venue` is the unambiguous form.
                  type: string
                side:
                  description: >-
                    Trade direction. `sell` closes an existing position on
                    `venue`.
                  type: string
                  enum:
                    - buy
                    - sell
                maxSpend:
                  exclusiveMinimum: true
                  description: Buy only. Maximum all-in USD spend, inclusive of app fee.
                  type: number
                  minimum: 0
                sellShares:
                  exclusiveMinimum: true
                  description: Sell only. Number of contracts to sell.
                  type: number
                  minimum: 0
                externalId:
                  minLength: 1
                  maxLength: 36
                  description: >-
                    Idempotency key. Your own id for this trade — required, and
                    unique within your app: two different users of the same app
                    cannot share one. A repeat is rejected with 409 rather than
                    trading twice, so it is safe to retry a request that timed
                    out using the same value.
                  type: string
                slipCapBps:
                  minimum: 0
                  description: >-
                    Slippage cap in basis points. Defaults to 500 (5%) when
                    omitted. On sells set this explicitly: `sellShares` bounds
                    the shares sold, not the proceeds.
                  type: number
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                required:
                  - orderId
                  - externalId
                  - venue
                  - status
                  - quoteId
                  - quotedPriceRaw
                  - quotedCostRaw
                  - quotedSharesRaw
                properties:
                  orderId:
                    description: The single order this call created.
                    type: string
                  externalId:
                    description: >-
                      Echoed back so a webhook or socket event can be tied to
                      this response.
                    type: string
                  venue:
                    description: The venue the order was placed on.
                    type: string
                    enum:
                      - kalshi
                      - polymarket
                      - limitless
                      - opinion
                      - predict
                      - probable
                      - myriad
                      - hyperliquid
                      - novig
                  status:
                    description: >-
                      Always `pending`: the order is accepted and queued for
                      execution, not yet filled. Poll `GET /execution/orders` or
                      listen for order events for the terminal state.
                    type: string
                    enum:
                      - pending
                  quoteId:
                    description: >-
                      Server-minted quote backing this order. Useful for
                      support, not required.
                    type: string
                  quotedPriceRaw:
                    description: >-
                      Quoted price, decimal string (e.g. "0.53"). `null` if the
                      order row does not carry a quoted price — the order is
                      still live; re-fetch it from `GET /execution/orders`
                      rather than treating this as zero.
                    type: string
                    nullable: true
                  quotedCostRaw:
                    description: >-
                      Quoted cost, 6-decimal atomic USDC. `null` under the same
                      conditions as `quotedPriceRaw`.
                    type: string
                    nullable: true
                  quotedSharesRaw:
                    description: >-
                      Quoted shares, 6-decimal atomic. `null` under the same
                      conditions as `quotedPriceRaw`.
                    type: string
                    nullable: true
        '400':
          description: '400'
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
                  code:
                    type: string
                    enum:
                      - quote_not_found
                      - quote_expired
                      - quote_already_executed
                      - quote_cancelled
                      - quote_user_mismatch
                      - quote_app_blocked
                      - quote_unfillable
                      - quote_min_order_size
                      - quote_stale_status
                      - quote_stale_price
                      - quote_insufficient_balance
                      - quote_market_inactive
                      - venue_not_executable
                      - outcome_ambiguous
        '401':
          description: '401'
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
        '403':
          description: '403'
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
        '404':
          description: '404'
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
        '409':
          description: '409'
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
      security:
        - appId: []
          bearerAuth: []
components:
  securitySchemes:
    appId:
      type: apiKey
      in: header
      name: x-app-id
      description: Your application ID. Required for all app-tier and user-tier routes.
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT access token returned by POST /auth/verify. Required for user-tier
        routes.

````