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

# Create Order

> Submit a new order.



## OpenAPI

````yaml POST /v1/matching/orders/create
openapi: 3.1.0
info:
  title: Options Matching API
  version: 1.0.0
  description: >-
    Order management endpoints for Rails Options. Base URLs vary by environment
    — see the Environments page. Authorize with the access token obtained from
    the Auth API.
servers:
  - url: https://api-options.sandbox.rails.xyz
security:
  - bearerAuth: []
paths:
  /v1/matching/orders/create:
    post:
      summary: Create Order
      description: >-
        Submits a new order to the matching engine. See [Order
        Lifecycle](/latest/options/guides/order-lifecycle#placing-orders-over-rest).
      operationId: createOptionsOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrderRequest'
            example:
              clientRequestId: 9f1c2c9e-3f4a-4a4e-9f10-2b7d3f2a1c55
              order:
                contract: BTC-7FEB26-100000-C
                orderType: buy
                tradeType: limit
                price: '1250.5'
                quantity: '2'
                postOnly: false
      responses:
        '202':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateOrderQueued'
              example:
                queued: true
                accepted: false
                body: order queued, pending acceptance
                action: create
                messageId: 1770000000000-0
                clientRequestId: 9f1c2c9e-3f4a-4a4e-9f10-2b7d3f2a1c55
                contract: BTC-7FEB26-100000-C
                orderId: 01JRQM8H5XYZABCDEFGHJKMNPQ
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: contract is required
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '502':
          $ref: '#/components/responses/MatchingUnavailableOnSubmit'
        '504':
          $ref: '#/components/responses/MatchingTimeoutOnSubmit'
components:
  schemas:
    CreateOrderRequest:
      type: object
      properties:
        clientRequestId:
          type: string
          description: Client-generated UUID for correlation.
        order:
          $ref: '#/components/schemas/CreateOrderPayload'
      required:
        - order
    CreateOrderQueued:
      type: object
      properties:
        queued:
          type: boolean
          description: Always `true`.
        accepted:
          type: boolean
          description: Always `false`.
        body:
          type: string
          description: Always `order queued, pending acceptance`.
        action:
          type: string
          description: Always `create`.
        messageId:
          type: string
          description: Identifier assigned to the queued request.
        clientRequestId:
          type: string
          description: Client-generated UUID for correlation.
        contract:
          type: string
          description: Contract name.
        orderId:
          type: string
          description: Unique identifier for the order.
      required:
        - queued
        - accepted
        - action
        - contract
        - orderId
    Error:
      type: object
      properties:
        error:
          type: string
          description: A human-readable message describing the error.
      required:
        - error
    CreateOrderPayload:
      type: object
      properties:
        orderId:
          type: string
          description: Unique identifier for the order. Generated if omitted.
        contract:
          type: string
          description: >-
            Contract name. Example value: `BTC-7FEB26-100000-C`. To get all
            tradable contracts, call the [Get
            Contracts](/latest/options/rest-api/get-contracts) endpoint.
        orderType:
          type: string
          description: Order side.
          enum:
            - buy
            - sell
        tradeType:
          type: string
          description: Order type.
          enum:
            - limit
            - market
        price:
          type: string
          description: Limit price; for market orders, expected price.
        quantity:
          type: string
          description: Order quantity.
        postOnly:
          type: boolean
          description: Maker-only creation flag.
        reduceOnly:
          type: boolean
          description: >-
            Reduce-only flag. When `true`, the order can only reduce an existing
            position.
        maxSlippage:
          type: string
          description: Market-only; `0 - 1` inclusive. Defaults to `0.1`. `0` acts as IOC.
      required:
        - contract
        - orderType
        - tradeType
        - price
        - quantity
  responses:
    Unauthorized:
      description: ''
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: unauthorized
    Forbidden:
      description: ''
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: read-only token cannot create orders
    RateLimited:
      description: ''
      headers:
        Retry-After:
          description: >-
            Number of seconds to wait before making another request (429
            responses only).
          required: true
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: api rate limit exceeded
    MatchingUnavailableOnSubmit:
      description: ''
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: matching service unavailable
    MatchingTimeoutOnSubmit:
      description: ''
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: matching service timed out
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````