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

# create_order

> Submit a new order.

Submit a new order.


## OpenAPI

````yaml openpx.openapi.yaml POST /v1/orders/create_order
openapi: 3.1.0
info:
  title: OpenPX Unified API
  description: >-
    Unified API surface across prediction-market exchanges. One `Exchange`
    trait, one set of models, one shape — implemented in Rust with
    auto-generated Python and TypeScript SDKs.


    This OpenAPI spec is **auto-generated** from
    `engine/core/src/exchange/traits.rs` and `schema/openpx.schema.json`. Edit
    the trait or the schema, then regenerate via `just openapi`. The spec models
    trait methods as REST operations for documentation rendering only — OpenPX
    is an in-process Rust library, not a REST service.
  version: 0.3.1
  license:
    name: MIT
servers:
  - url: https://github.com/openpx-trade/openpx
    description: >-
      Documentation surface only. OpenPX is an in-process Rust library; there is
      no hosted REST endpoint.
security: []
tags:
  - name: Markets
  - name: Orders
  - name: Positions
  - name: Balance
  - name: Orderbook
  - name: Trades
  - name: Fills
  - name: Server
paths:
  /v1/orders/create_order:
    post:
      tags:
        - Orders
      summary: Create order
      description: Submit a new order.
      operationId: create_order
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrderRequest'
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Order'
        default:
          description: Unified error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenPxError'
components:
  schemas:
    CreateOrderRequest:
      description: Input for `create_order`.
      properties:
        asset_id:
          description: >-
            The orderable asset — Kalshi market ticker or Polymarket CTF token
            id (e.g. `"KXBTCD-25APR1517"`).
          type: string
        order_type:
          allOf:
            - $ref: '#/components/schemas/OrderType'
          default: gtc
          description: 'Time-in-force; defaults to `gtc` (options: `gtc`, `ioc`, `fok`).'
        outcome:
          allOf:
            - $ref: '#/components/schemas/OrderOutcome'
          description: >-
            Outcome to trade. Options: `yes`, `no`, or `label: "<name>"`
            (Polymarket categorical markets only).
        price:
          description: Limit price as YES probability in `(0, 1)` (e.g. `0.62`).
          format: double
          type: number
        side:
          allOf:
            - $ref: '#/components/schemas/OrderSide'
          description: 'Order direction. Options: `buy`, `sell`.'
        size:
          description: Order size in contracts (e.g. `100.0`).
          format: double
          type: number
      required:
        - asset_id
        - outcome
        - price
        - side
        - size
      title: CreateOrderRequest
      type: object
    Order:
      description: An order on the unified surface.
      properties:
        created_at:
          description: Order creation time (UTC) (e.g. `"2026-04-25T12:00:00Z"`).
          format: date-time
          type: string
        fee:
          default: null
          description: >-
            Volume-weighted per-contract fee in quote dollars; `null` on
            Polymarket and on unfilled orders.
          format: double
          type:
            - number
            - 'null'
        filled:
          description: Cumulative filled size in contracts (e.g. `25.0`).
          format: double
          type: number
        id:
          description: Globally-unique exchange order id (e.g. `"a1b2c3d4-..."`).
          type: string
        market_ticker:
          description: >-
            Unified market ticker the order belongs to (e.g.
            `"KXBTCD-25APR1517"`).
          type: string
        outcome:
          description: >-
            Outcome label as published by the exchange (e.g. `"Yes"`, `"No"`, or
            a categorical label).
          type: string
        price:
          description: Limit price as YES probability in `(0, 1)` (e.g. `0.62`).
          format: double
          type: number
        side:
          allOf:
            - $ref: '#/components/schemas/OrderSide'
          description: 'Order direction. Options: `buy`, `sell`.'
        size:
          description: Order size in contracts (e.g. `100.0`).
          format: double
          type: number
        status:
          allOf:
            - $ref: '#/components/schemas/OrderStatus'
          description: >-
            Order lifecycle state. Options: `pending`, `open`, `filled`,
            `partially_filled`, `cancelled`, `rejected`.
        updated_at:
          default: null
          description: Last update time (UTC); `null` if untouched since creation.
          format: date-time
          type:
            - string
            - 'null'
      required:
        - created_at
        - filled
        - id
        - market_ticker
        - outcome
        - price
        - side
        - size
        - status
      title: Order
      type: object
    OpenPxError:
      type: object
      description: >-
        Unified error type returned when an exchange call fails. The `kind`
        field is the canonical category; `message` carries the upstream
        explanation. Per-exchange variants are mapped into this shape before
        they cross the trait boundary.
      required:
        - kind
        - message
      properties:
        kind:
          type: string
          enum:
            - Authentication
            - InsufficientFunds
            - MarketNotFound
            - OrderNotFound
            - RateLimited
            - NetworkError
            - Api
            - Config
            - NotSupported
        message:
          type: string
    OrderType:
      description: >-
        Time-in-force. Options: `gtc` (rests on book), `ioc`
        (fill-now-or-cancel-rest), `fok` (all-or-nothing).
      enum:
        - gtc
        - ioc
        - fok
      type: string
    OrderOutcome:
      description: >-
        Outcome targeted by an order. Options: `yes`, `no`, or `label: "<name>"`
        for categorical Polymarket markets.
      oneOf:
        - enum:
            - 'yes'
            - 'no'
          type: string
        - additionalProperties: false
          properties:
            label:
              type: string
          required:
            - label
          type: object
      title: OrderOutcome
    OrderSide:
      description: 'Order direction. Options: `buy`, `sell`.'
      enum:
        - buy
        - sell
      type: string
    OrderStatus:
      description: >-
        Order lifecycle state. Options: `pending`, `open`, `filled`,
        `partially_filled`, `cancelled`, `rejected`.
      enum:
        - pending
        - open
        - filled
        - partially_filled
        - cancelled
        - rejected
      title: OrderStatus
      type: string

````