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

# Create an order

> Creates a limit or market order. The account's email must be verified.

Requires the `ORDER_CREATE` scope.




## OpenAPI

````yaml /openapi.yaml post /orders
openapi: 3.1.0
info:
  title: PaperDrill REST API
  version: 1.0.0
  description: >
    Trade PaperDrill credit markets and read live market data.


    Prices, quantities, balances, and other decimal values are encoded as
    strings so clients do not lose precision.
servers:
  - url: https://api.paperdrill.dev/v1
    description: Production
security: []
tags:
  - name: Market data
    description: Public markets, tickers, candles, trades, and order-book snapshots.
  - name: Trading
    description: Create, inspect, and cancel orders with a scoped API key.
  - name: Account
    description: Read balances, portfolio performance, and private trade history.
paths:
  /orders:
    post:
      tags:
        - Trading
      summary: Create an order
      description: |
        Creates a limit or market order. The account's email must be verified.

        Requires the `ORDER_CREATE` scope.
      operationId: createOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/LimitOrderRequest'
                - $ref: '#/components/schemas/MarketOrderRequest'
              discriminator:
                propertyName: type
            examples:
              limit:
                summary: Limit buy
                value:
                  symbol: SOL_USD
                  side: BUY
                  type: LIMIT
                  price: '125.50'
                  qty: '2.00'
              market:
                summary: Market buy
                value:
                  symbol: SOL_USD
                  side: BUY
                  type: MARKET
                  qty: '1.00'
      responses:
        '201':
          description: Order accepted by the matching engine.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Order'
        '404':
          $ref: '#/components/responses/MarketNotFound'
        '422':
          $ref: '#/components/responses/OrderRejected'
        default:
          $ref: '#/components/responses/RequestError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    LimitOrderRequest:
      type: object
      additionalProperties: false
      required:
        - symbol
        - side
        - type
        - price
        - qty
      properties:
        symbol:
          type: string
          example: SOL_USD
        side:
          $ref: '#/components/schemas/Side'
        type:
          type: string
          const: LIMIT
        price:
          $ref: '#/components/schemas/DecimalString'
        qty:
          $ref: '#/components/schemas/DecimalString'
    MarketOrderRequest:
      type: object
      additionalProperties: false
      required:
        - symbol
        - side
        - type
        - qty
      properties:
        symbol:
          type: string
          example: SOL_USD
        side:
          $ref: '#/components/schemas/Side'
        type:
          type: string
          const: MARKET
        qty:
          $ref: '#/components/schemas/DecimalString'
    Order:
      type: object
      required:
        - id
        - userId
        - symbol
        - side
        - type
        - status
        - qty
        - filledQty
        - createdAt
      properties:
        id:
          type: string
        userId:
          type: string
        symbol:
          type: string
        side:
          $ref: '#/components/schemas/Side'
        type:
          $ref: '#/components/schemas/OrderType'
        status:
          $ref: '#/components/schemas/OrderStatus'
        price:
          $ref: '#/components/schemas/DecimalString'
          description: Present for limit orders.
        qty:
          $ref: '#/components/schemas/DecimalString'
        filledQty:
          $ref: '#/components/schemas/DecimalString'
        averagePrice:
          $ref: '#/components/schemas/DecimalString'
          description: Present after at least one fill.
        createdAt:
          type: string
          format: date-time
      example:
        id: order_123
        userId: user_123
        symbol: SOL_USD
        side: BUY
        type: LIMIT
        status: PARTIALLY_FILLED
        price: '125.50'
        qty: '2.00'
        filledQty: '0.50'
        averagePrice: '125.25'
        createdAt: '2026-09-19T10:00:00.000Z'
    Side:
      type: string
      enum:
        - BUY
        - SELL
    DecimalString:
      type: string
      pattern: ^\d+(\.\d+)?$
      description: A non-negative decimal encoded as a string.
      example: '125.50'
    OrderType:
      type: string
      enum:
        - LIMIT
        - MARKET
    OrderStatus:
      type: string
      enum:
        - OPEN
        - PARTIALLY_FILLED
        - FILLED
        - CANCELLED
    ApiError:
      type: object
      required:
        - error
        - requestId
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: array
              items:
                $ref: '#/components/schemas/ApiErrorDetail'
        requestId:
          type: string
          format: uuid
      example:
        error:
          code: VALIDATION_ERROR
          message: Request validation failed
          details:
            - field: qty
              message: invalid decimal format
        requestId: f4c0baf4-b8d2-4c9a-a17b-c8656c4a7b0e
    ApiErrorDetail:
      type: object
      required:
        - message
      properties:
        field:
          type: string
        message:
          type: string
  responses:
    MarketNotFound:
      description: The market does not exist.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    OrderRejected:
      description: >-
        The order was rejected because of balance, liquidity, or matching
        constraints.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    RequestError:
      description: The request failed. See Errors and rate limits for recovery guidance.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: A scoped API key created in the PaperDrill dashboard.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.