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

# Create order

> Creates a limit or market order intent for asynchronous matching. A successful response means the order was accepted for processing; read the order until it reaches a terminal status before treating execution as final.



## OpenAPI

````yaml /openapi/openapi.json post /partner/exchange/orders
openapi: 3.1.0
info:
  title: Stabyl API
  description: >-
    REST API for approved Stabyl accounts to automate exchange, wallet, and
    non-production simulation workflows.
  contact:
    name: Stabyl Support
    email: support@stabyl.com
  license:
    name: Proprietary
  version: 1.0.0
servers:
  - url: https://api.stabyl.com/v1
    description: Production
  - url: https://api-staging.stabyl.com/v1
    description: Staging
security: []
tags:
  - name: Exchange
    description: Trading market data and order management for account automation.
  - name: Wallets
    description: >-
      Supported routes, deposit destinations, balances, transactions, and saved
      recipients.
  - name: Webhooks
    description: >-
      Outbound event delivery configuration and eventually consistent delivery
      history. Verify Standard Webhooks webhook-id, webhook-timestamp, and
      webhook-signature headers against the unchanged raw request body before
      parsing JSON.
  - name: Simulation
    description: Non-production endpoints for testing integration behavior.
paths:
  /partner/exchange/orders:
    post:
      tags:
        - Exchange
      summary: Create order
      description: >-
        Creates a limit or market order intent for asynchronous matching. A
        successful response means the order was accepted for processing; read
        the order until it reaches a terminal status before treating execution
        as final.
      operationId: post_partner_exchange_orders
      parameters:
        - name: Idempotency-Key
          in: header
          description: >-
            Unique key for this exact write intent. Store it before sending the
            request and reuse it for retries after timeouts or transient errors.
          required: true
          schema:
            type: string
      requestBody:
        description: >-
          Order intent to submit. Amounts are decimal strings; validate pair,
          precision, minimums, and balances before sending.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrderRequest'
        required: true
      responses:
        '200':
          description: Order created
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/CreateOrderResponse'
                  status:
                    type: string
                    enum:
                      - success
              example:
                data:
                  created_at: '2026-05-24T12:00:00Z'
                  order_id: 0197f1f0-0000-7000-8000-000000000001
                  status: pending
                status: success
        '400':
          description: Invalid order parameters
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        example: VALIDATION_FAILED
                      message:
                        type: string
                        example: invalid request parameters
                  status:
                    type: string
                    enum:
                      - error
              example:
                error:
                  code: VALIDATION_FAILED
                  message: invalid request parameters
                status: error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        example: UNAUTHORIZED
                      message:
                        type: string
                        example: missing X-Api-Key header
                  status:
                    type: string
                    enum:
                      - error
              example:
                error:
                  code: UNAUTHORIZED
                  message: missing X-Api-Key header
                status: error
        '409':
          description: Duplicate idempotency key
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        example: CONFLICT
                      message:
                        type: string
                        example: idempotency key already used
                  status:
                    type: string
                    enum:
                      - error
              example:
                error:
                  code: CONFLICT
                  message: idempotency key already used
                status: error
      security:
        - api_key: []
components:
  schemas:
    CreateOrderRequest:
      type: object
      description: >-
        Order intent for creating a limit or market order. Amounts are decimal
        strings.
      required:
        - pair_id
        - side
        - order_type
        - quantity
      properties:
        client_order_id:
          type:
            - string
            - 'null'
          description: Client-provided order identifier
        idempotency_key:
          type:
            - string
            - 'null'
          description: Idempotency key to prevent duplicate orders
        order_type:
          type: string
          description: 'Order type: "limit" or "market"'
          example: limit
        pair_id:
          type: string
          description: Trading pair identifier
          example: USD/NGN
        price:
          type:
            - string
            - 'null'
          description: >-
            Price per unit. Required for limit orders; ignored for market
            orders.
          example: '1650.00'
        quantity:
          type: string
          description: Order quantity in base currency
          example: '100.00'
        side:
          type: string
          description: 'Order side: "buy" or "sell"'
          example: buy
        time_in_force:
          type:
            - string
            - 'null'
          description: >-
            Time in force: "GTC", "IOC", "FOK", "POST_ONLY". Ignored for market
            orders, which always use IOC.
          example: GTC
    CreateOrderResponse:
      type: object
      description: >-
        Result returned after an order create request is accepted for
        processing.
      required:
        - order_id
        - status
        - created_at
      properties:
        created_at:
          type: string
          description: Order creation timestamp
        order_id:
          type: string
          format: uuid
          description: Server-assigned order identifier
        status:
          type: string
          description: Order status (pending)
          example: pending
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        API credential. Withdrawal quote and submit operations additionally
        require the documented Ed25519 timestamp, nonce, and signature headers.
      x-default: sb_test_your_key

````