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

# Place an order

> Submits an order for the authenticated client. Supported types are
      `LIMIT`, `MARKET` and `STOP_LIMIT`; the required fields vary by type
      (a MARKET BUY is sized by `quote_value`, STOP_LIMIT adds `stop_price`).

      **Idempotency**
      Replays of the same `client_order_id` return the original order with
      `type=DUPLICATE_REPLAY` instead of creating a new one.



## OpenAPI

````yaml /api-reference/openapi.json post /order
openapi: 3.0.0
info:
  title: Xenios Trading API
  description: >-
    Place and manage orders, stream live market and account data, and read
    wallets, deposits and reference data over one authenticated gateway. All
    protected endpoints are authenticated with an HMAC-SHA256 request signature
    (see the Authentication guide). Decimal amounts are strings; timestamps are
    ISO-8601. Successful responses are wrapped in a standard { statusCode,
    success, message, data } envelope.
  version: '1.0'
  contact: {}
servers:
  - url: https://<your-host>/api/v1/trading
    description: Development gateway. Prefix every trading path with this base URL.
security:
  - xenios-hmac: []
tags:
  - name: Orders
    description: >-
      Place, cancel, and read your orders. Placement is idempotent on
      client_order_id.
  - name: Order Book
    description: Top-of-book depth snapshots for a trading pair.
  - name: Products
    description: Tradable products and pairs, plus OHLCV candles for charting.
  - name: Assets
    description: The assets available to your account.
  - name: Wallets
    description: Generate deposit addresses and read deposit history.
  - name: Account
    description: Your trading fee and effective account settings.
  - name: Health
    description: Liveness and readiness probes.
paths:
  /order:
    post:
      tags:
        - Orders
      summary: Place an order
      description: |-
        Submits an order for the authenticated client. Supported types are
              `LIMIT`, `MARKET` and `STOP_LIMIT`; the required fields vary by type
              (a MARKET BUY is sized by `quote_value`, STOP_LIMIT adds `stop_price`).

              **Idempotency**
              Replays of the same `client_order_id` return the original order with
              `type=DUPLICATE_REPLAY` instead of creating a new one.
      operationId: createOrder
      parameters: []
      requestBody:
        required: true
        description: >-
          Order payload. Required fields depend on `type` (LIMIT, MARKET,
          STOP_LIMIT).
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderRequest'
      responses:
        '200':
          description: >-
            Order creation outcome. Inspect `data.type` to distinguish
            `NEW_ORDER`, `DUPLICATE_REPLAY`, and the `*_EXECUTION_FAILED`
            variants.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/OrderResult'
        '400':
          description: >-
            Invalid order payload, a per-client rule violation (product not
            enabled for your account, or order size below/above your configured
            limit), or rejected by the exchange. The `message` explains which.
        '401':
          description: Missing or invalid API credentials.
      security:
        - xenios-hmac:
            - write:orders
components:
  schemas:
    OrderRequest:
      type: object
      properties:
        side:
          type: string
          description: Order side.
          enum:
            - BUY
            - SELL
          example: BUY
        type:
          type: string
          description: Order type. `LIMIT`, `MARKET` and `STOP_LIMIT` are accepted.
          enum:
            - LIMIT
            - MARKET
            - STOP_LIMIT
          example: LIMIT
        base_quantity:
          type: string
          description: >-
            Base asset quantity (string-encoded decimal). Required for all
            orders except a MARKET BUY, which is sized by `quote_value` instead.
          example: '0.50'
        quote_value:
          type: string
          description: >-
            Quote spend (string-encoded decimal). Required for a MARKET BUY (the
            amount of quote currency to spend); ignored otherwise.
          example: '100.00'
        price:
          type: string
          description: >-
            Limit price (string-encoded decimal). Required for LIMIT and
            STOP_LIMIT orders; omitted for MARKET (executes at the prevailing
            price).
          example: '3000.00'
        stop_price:
          type: string
          description: >-
            Stop (trigger) price (string-encoded decimal). Required for
            STOP_LIMIT orders; ignored otherwise.
          example: '2900.00'
        client_order_id:
          type: string
          description: >-
            Client-generated idempotency key (UUID v4). Replays of the same
            value return the original order.
          example: a1b2c3d4-e5f6-7890-abcd-ef0123456789
        product:
          type: string
          description: Trading pair id (e.g. `BTC-USD`, `ETH-USDC`).
          example: ETH-USDC
      required:
        - side
        - type
        - base_quantity
        - client_order_id
        - product
    ApiResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code echoed in the body.
          example: 200
        success:
          type: boolean
          description: True for success responses.
          example: true
        message:
          type: string
          description: Human-readable status message.
          example: Request processed successfully
      required:
        - statusCode
        - success
    OrderResult:
      type: object
      properties:
        type:
          type: string
          description: Outcome discriminator.
          enum:
            - NEW_ORDER
            - DUPLICATE_REPLAY
            - EXTERNAL_EXECUTION_FAILED
            - INTERNAL_EXECUTION_FAILED
            - CLIENT_NOT_FOUND
          example: NEW_ORDER
        order:
          description: >-
            The created or matched order. Present for `NEW_ORDER` and
            `DUPLICATE_REPLAY`; absent otherwise.
          allOf:
            - $ref: '#/components/schemas/Order'
        message:
          type: string
          description: Human-readable explanation, populated on failure or duplicate.
          example: Duplicate order request detected.
      required:
        - type
    Order:
      type: object
      properties:
        createdAt:
          type: string
          description: Row creation timestamp (ISO 8601).
          format: date-time
          example: '2026-03-12T09:21:44.000Z'
        updatedAt:
          type: string
          description: Row last-update timestamp (ISO 8601).
          format: date-time
          example: '2026-05-08T14:03:11.000Z'
        id:
          type: string
          description: Order id.
          example: b9f266be-ebe9-41fc-a07f-57ad43dee26f
        externalId:
          type: object
          description: Exchange-side reference id assigned once the order is accepted.
          example: 8aa8b3e8-6f3d-4f9a-9c2a-2a5a8f9b1c3d
          nullable: true
        userId:
          type: string
          description: Id of the client that owns this order.
          nullable: true
        portfolioId:
          type: string
          description: Portfolio id the order was placed under.
          nullable: true
        productId:
          type: string
          description: Trading product id.
          example: BTC-USD
        side:
          type: string
          description: Order side.
          enum:
            - BUY
            - SELL
        clientOrderId:
          type: string
          description: Client-generated idempotency key (UUID) supplied on create.
          example: a1b2c3d4-e5f6-7890-abcd-ef0123456789
        type:
          type: string
          description: Order type. Currently only `LIMIT` is supported.
          enum:
            - MARKET
            - LIMIT
            - TWAP
            - BLOCK
            - VWAP
            - STOP_LIMIT
            - RFQ
            - PEG
        baseQuantity:
          type: string
          description: Base asset quantity (string-encoded decimal).
          example: '0.50'
          nullable: true
        quoteValue:
          type: string
          description: Quote value = `baseQuantity` × `limitPrice` (string-encoded).
          nullable: true
        limitPrice:
          type: string
          description: Limit price (string-encoded decimal).
          example: '50000.00'
          nullable: true
        startTime:
          type: string
          format: date-time
          nullable: true
        expiryTime:
          type: string
          format: date-time
          nullable: true
        status:
          type: string
          description: Current order status.
          enum:
            - OPEN
            - FILLED
            - CANCELLED
            - EXPIRED
            - FAILED
            - PENDING
        timeInForce:
          type: string
          description: Time-in-force flag.
          nullable: true
        filledQuantity:
          type: string
          description: Filled quantity (string-encoded decimal).
          nullable: true
        filledValue:
          type: string
          description: Filled value in quote asset (string-encoded decimal).
          nullable: true
        averageFilledPrice:
          type: string
          description: Volume-weighted average fill price (string-encoded decimal).
          nullable: true
        commission:
          type: string
          description: Commission charged (string-encoded).
          nullable: true
        exchangeFee:
          type: string
          description: Exchange fee charged (string-encoded).
          nullable: true
        historicalPov:
          type: string
          nullable: true
        stopPrice:
          type: string
          description: Stop price (string-encoded).
          nullable: true
        netAverageFilledPrice:
          type: string
          description: Average filled price net of fees (string-encoded).
          nullable: true
        userContext:
          type: string
          nullable: true
        clientProductId:
          type: string
          nullable: true
        postOnly:
          type: boolean
          nullable: true
        orderEditHistory:
          type: array
          items:
            type: object
          nullable: true
        isRaiseExact:
          type: boolean
          nullable: true
        displaySize:
          type: string
          nullable: true
        editHistory:
          type: array
          items:
            type: object
          nullable: true
        displayQuoteSize:
          type: string
          nullable: true
        displayBaseSize:
          type: string
          nullable: true
        synced:
          type: boolean
          description: >-
            True once the latest order state has been reconciled with the
            exchange.
          default: false
        fees:
          type: string
          description: Total fees (string-encoded decimal).
          nullable: true
        totalUserRecieveAmount:
          type: string
          description: >-
            Final amount credited to the client. For `BUY` this is base asset;
            for `SELL` it is quote asset (string-encoded).
          nullable: true
      required:
        - id
        - productId
        - side
        - clientOrderId
        - type
        - status
        - synced
  securitySchemes:
    xenios-hmac:
      type: apiKey
      in: header
      name: X-API-KEY
      description: >-
        HMAC-SHA256 authentication. Sign every request and send X-API-KEY,
        X-API-SIGNATURE, X-API-TIMESTAMP and X-API-NONCE (see the Authentication
        guide). Each route also requires a specific claim on your API key (e.g.
        read:orders, write:orders, read:account, read:market-data).

````