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

# Create Order

> Creates a new order.

Publishes updates in the following websocket topics: [`trade`](#operation/trade) (if there is a trade), [`orderbook`](#operation/orderbook), [`balance`](#operation/balance) and [`order_status`](#operation/order_status).

---

**Authorization**

- Requires a valid API key.
- Required API-key permission(s):
  - Trading (Write)



## OpenAPI

````yaml post /trade/orders
openapi: 3.0.0
info:
  title: Ripio Gateway
  description: Ripio API - Services documentation.
  version: 0.1.0
  x-logo:
    url: https://cwstatic.nyc3.digitaloceanspaces.com/1996/bitcointrade.png
servers:
  - url: https://api.ripio.com
    description: Production environment
security: []
paths:
  /trade/orders:
    post:
      tags:
        - Ripio Trade
      summary: Orders - Create Order
      description: >-
        Creates a new order.


        Publishes updates in the following websocket topics:
        [`trade`](#operation/trade) (if there is a trade),
        [`orderbook`](#operation/orderbook), [`balance`](#operation/balance) and
        [`order_status`](#operation/order_status).


        ---


        **Authorization**


        - Requires a valid API key.

        - Required API-key permission(s):
          - Trading (Write)
      parameters:
        - in: header
          name: authorization
          required: true
          description: The API key as a string.
          schema:
            type: string
        - in: header
          name: signature
          required: true
          description: >-
            See the [Generating
            Signature](/static/api/authentication#generating-signature) section
            for more details.
          schema:
            type: string
        - in: header
          name: timestamp
          required: true
          description: >-
            A timestamp in milliseconds. See the [Timestamp
            Security](/static/api/authentication#timestamp-security) section for
            more details.
          schema:
            type: number
        - in: header
          name: timstamp-tolerance
          required: false
          description: >-
            An additional, non-required parameter, that you can send to specify
            the number of milliseconds after the timestamp for the request to be
            valid. See the [Timestamp
            Security](/static/api/authentication#timestamp-security) section for
            more details.
          schema:
            type: number
      requestBody:
        content:
          application/json:
            schema:
              properties:
                external_id:
                  description: Order external identifier (maximum of 36 chars)
                  type: string
                  example: 0f4a8504-21fb-4be6-9771-25dcf5f68f87
                pair:
                  description: Currency pair code
                  type: string
                side:
                  description: Order's side (buy)
                  type: string
                type:
                  description: Order's type (limit)
                  type: string
                amount:
                  description: Order amount in base currency
                  type: number
                price:
                  description: Limit price
                  type: number
                post_only:
                  description: >-
                    If set to `true`, the order will be added directly to the
                    order book without an initial match, provided the request is
                    valid
                  type: boolean
                expiration:
                  description: >-
                    If a valid timestamp is provided, the order will be created
                    with an expiration date and time
                  type: number
                immediate_or_cancel:
                  description: >-
                    If set to `true`, the order will not be added to the order
                    book after the initial match, any remaining unfilled amount
                    will result in the order being canceled
                  type: boolean
                fill_or_kill:
                  description: >-
                    If set to `true`, the order will either be completely filled
                    or canceled
                  type: boolean
                value:
                  description: Order value in quote currency
                  type: number
                stop_price:
                  description: Stop price
                  type: number
                distance:
                  description: Price distance
                  type: number
                step_amount:
                  description: >-
                    Step amount (the ratio of amount to step_amount must be less
                    than or equal to 10)
                  type: number
              required:
                - pair
                - side
                - type
                - amount
                - price
                - value
                - stop_price
                - distance
                - step_amount
              type: object
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                description: Ok
                properties:
                  data:
                    properties:
                      id:
                        description: Order identifier
                        type: string
                      status:
                        description: >-
                          Order status (executed_completely / executed_partially
                          / open / canceled)
                        type: string
                      create_date:
                        description: Datetime of the order creation
                        type: string
                      external_id:
                        description: >-
                          External id (this is sent by the user when creating an
                          order, and it's optional)
                        type: string
                        example: BEAB10B1-45B0-4999-9B2F-D2ED048D6C42
                      pair:
                        description: Currency pair code
                        type: string
                        example: BTC_BRL
                      side:
                        description: Order side (sell / buy)
                        type: string
                      executed_amount:
                        description: Executed amount
                        type: number
                      remaining_amount:
                        description: Remaining amount
                        type: number
                      remaining_value:
                        description: Remaining value
                        type: number
                      requested_amount:
                        description: Requested amount
                        type: number
                      requested_value:
                        description: Requested value
                        type: number
                    required:
                      - id
                      - status
                      - create_date
                      - pair
                      - side
                      - executed_amount
                      - remaining_amount
                      - remaining_value
                      - requested_amount
                    type: object
                    example:
                      id: 7155ED34-9EC4-4733-8B32-1E4319CB662F
                      create_date: '2024-03-27T13:27:19.853Z'
                      executed_amount: 0
                      external_id: BEAB10B1-45B0-4999-9B2F-D2ED048D6C42
                      pair: BTC_BRL
                      remaining_amount: 10
                      remaining_value: 1000
                      requested_amount: 10
                      requested_value: 1000
                      side: buy
                      status: open
                  error_code:
                    type: number
                    example: null
                  message:
                    type: string
                    example: null
                required:
                  - data
                  - error_code
                  - message
                type: object

````