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

# Create an order



## OpenAPI

````yaml /openapi.json post /exchange/orders
openapi: 3.0.0
info:
  title: Juicyway API
  version: 1.0.0
servers: []
security: []
tags:
  - description: Payment APIs
    name: payments
  - description: Payouts APIs
    name: payouts
  - description: Exchange APIs
    name: exchange
  - description: Wallets APIs
    name: wallets
paths:
  /exchange/orders:
    post:
      tags:
        - exchange
      summary: Create an order
      operationId: Exchange.Web.Controller.create_order
      parameters:
        - description: ''
          in: header
          name: Idempotency-Key
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrderParams'
        description: Order params
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderResponse'
          description: Order
        '422':
          $ref: '#/components/responses/unprocessable_entity'
      callbacks: {}
components:
  schemas:
    CreateOrderParams:
      description: Order creation params
      example:
        qty: 1
        symbol: USD-NGN
        type: buy
      properties:
        min_qty:
          description: Minimum quantity to be traded at a go, in base currency
          nullable: true
          type: number
        min_quote_qty:
          description: Minimum quantity to be traded at a go, in quote currency
          nullable: true
          type: number
        price:
          description: Order price, in minor units
          type: integer
        price_type:
          description: Price type
          enum:
            - limit
            - market
          type: string
        qty:
          description: Order quantity, denominated in the base currency
          type: number
        quote_qty:
          description: Order quantity, denominated in the quote currency
          nullable: true
          type: number
        symbol:
          description: Currency pair
          type: string
        time_in_force:
          enum:
            - gtc
            - gtt
            - ioc
            - fok
          type: string
        type:
          description: Order type
          enum:
            - sell
            - buy
          type: string
      required:
        - type
        - symbol
      title: CreateOrderParams
      type: object
    OrderResponse:
      description: Response schema for a single order
      properties:
        data:
          $ref: '#/components/schemas/Order'
      title: OrderResponse
      type: object
    Order:
      description: An order
      example:
        accepted_at: '2023-12-23T17:55:42.919523'
        average_fill_price: 80000
        business_id: dd625bec-b1a3-466e-867e-c91ae0b6e71e
        correlation_id: 7da742ea-a1bc-11ee-b907-560f156a658b
        created_at: '2023-12-23T17:55:42.911'
        expires_at: null
        id: 7da75a46-a1bc-11ee-9a32-560f156a658b
        min_qty: null
        min_quote_qty: null
        percent_filled: 10000
        price: 80000
        price_type: market
        qty: 1
        quote_qty: null
        status: filled
        symbol: USD-NGN
        time_in_force: gtc
        trades:
          - buy_order_id: 7da75a46-a1bc-11ee-9a32-560f156a658b
            commission: 0
            correlation_id: 7da742ea-a1bc-11ee-b907-560f156a658b
            created_at: '2023-12-23T17:55:42.921'
            id: 7da8e726-a1bc-11ee-80cf-560f156a658b
            price: 80000
            sell_order_id: 7d97c0b8-a1bc-11ee-b240-560f156a658b
            size: 1
            symbol: USD-NGN
        type: buy
        updated_at: '2023-12-23T17:55:42.911'
        user_id: b101f718-d133-450c-a572-c281c7341803
      properties:
        accepted_at:
          description: Order book registration timestamp
          format: date-time
          type: string
        average_fill_price:
          description: Order average price, in major units
          nullable: true
          type: string
        correlation_id:
          description: Correlation ID
          type: string
        created_at:
          description: Creation timestamp
          format: date-time
          type: string
        expires_at:
          description: Expiration timestamp
          format: date-time
          nullable: true
          type: string
        id:
          description: Order ID
          type: string
        min_qty:
          description: Minimum quantity to be traded at a go, in base currency
          nullable: true
          type: number
        min_quote_qty:
          description: Minimum quantity to be traded at a go, in quote currency
          nullable: true
          type: number
        percent_filled:
          description: Percentage of qty filled, in basis points
          type: integer
        price:
          description: Order price, in major units
          type: string
        price_type:
          description: Price type
          enum:
            - limit
            - market
          type: string
        qty:
          description: Order quantity, denominated in the base currency
          nullable: true
          type: number
        quote_qty:
          description: Order quantity, denominated in the quote currency
          nullable: true
          type: number
        status:
          enum:
            - open
            - cancelled
            - rejected
            - filled
            - expired
            - closed
          type: string
        symbol:
          description: Currency pair
          type: string
        time_in_force:
          enum:
            - gtc
            - gtt
            - ioc
            - fok
          type: string
        trades:
          description: Trades
          items:
            $ref: '#/components/schemas/Trade'
          type: array
        type:
          description: Order type
          enum:
            - sell
            - buy
          type: string
        updated_at:
          description: Update timestamp
          format: date-time
          type: string
      title: Order
      type: object
    Trade:
      description: An exchange trade
      example:
        buy_order_id: 7da75a46-a1bc-11ee-9a32-560f156a658b
        commission: '0.00'
        correlation_id: 7da742ea-a1bc-11ee-b907-560f156a658b
        created_at: '2023-12-23T17:55:42.921'
        id: 7da8e726-a1bc-11ee-80cf-560f156a658b
        price: '800.00'
        sell_order_id: 7d97c0b8-a1bc-11ee-b240-560f156a658b
        size: 1
        symbol: USD-NGN
      properties:
        buy_order_id:
          description: Buy order ID
          type: string
        commission:
          description: Trade commission in major units
          type: string
        correlation_id:
          description: Correlation ID
          type: string
        created_at:
          description: Creation timestamp
          format: date-time
          type: string
        id:
          description: Order ID
          type: string
        price:
          description: Trade price in major units
          type: string
        sell_order_id:
          description: Sell order ID
          type: string
        size:
          description: Trade size
          type: number
        symbol:
          description: Currency pair
          type: string
      title: Trade
      type: object
  responses:
    unprocessable_entity:
      content:
        application/json:
          schema:
            type: object
      description: Unprocessable Entity

````