> ## Documentation Index
> Fetch the complete documentation index at: https://whitebit-mintlify-fix-broken-links-1774051868.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Limit Order



## OpenAPI

````yaml /openapi/private/http-trade-v4.yaml POST /api/v4/order/new
openapi: 3.0.3
info:
  title: Private HTTP API V4 - Collateral Trading
  description: |
    WhiteBIT Private HTTP API V4 for collateral/margin trading operations.

    Base URL: https://whitebit.com

    All endpoints return time in Unix-time format.
    All endpoints return either a JSON object or array.
    For receiving responses from API calls please use http method POST.

    Authentication required for all endpoints.
  version: 4.0.0
  license:
    name: WhiteBIT Terms of Service
    url: https://whitebit.com/terms
servers:
  - url: https://whitebit.com
    description: WhiteBIT Global Server
  - url: https://whitebit.eu
    description: WhiteBIT EU Server
security: []
tags:
  - name: Collateral Trading
    description: Endpoints for collateral/margin trading operations
  - name: Spot Trading
    description: Endpoints for spot trading operations
  - name: Market Fee
    description: Endpoints for querying trading fees
paths:
  /api/v4/order/new:
    post:
      tags:
        - Spot Trading
      summary: Create Limit Order
      description: |
        The endpoint creates [limit trading order](/glossary#limit-order).

        <Warning>
        Rate limit: 10000 requests/10 sec.
        </Warning>

        <Note>
          - RPI orders do not appear in public order book feeds (`depth`, `bookTicker`). RPI orders are visible only in private active orders and in the exchange UI order book (web/mobile).
          - RPI orders are post-only by design and cannot be used with the IOC flag. The API returns error code `37` when both `rpi=true` and `ioc=true` are used.
        </Note>

        <Accordion title="Error Codes">
          - `30` - default validation error code
          - `31` - market validation failed
          - `32` - amount validation failed
          - `33` - price validation failed
          - `36` - client_order_id validation failed
          - `37` - `ioc=true` cannot be used with `postOnly=true` or `rpi=true`
        </Accordion>

        <Accordion title="Errors">
        ```json
        {
          "code": 30,
          "message": "Validation failed",
          "errors": {
            "amount": ["Amount field is required."],
            "market": ["Market field is required."],
            "price": ["Price field is required."],
            "side": ["Side field is required."]
          }
        }
        ```

        ```json
        {
          "code": 30,
          "message": "Validation failed",
          "errors": {
            "side": ["Side field should contain only 'buy' or 'sell' values."]
          }
        }
        ```

        ```json
        {
          "code": 32,
          "message": "Validation failed",
          "errors": {
            "amount": ["Amount field should be numeric string or number."]
          }
        }
        ```

        ```json
        {
          "code": 33,
          "message": "Validation failed",
          "errors": {
            "price": ["Price field should be numeric string or number."]
          }
        }
        ```

        ```json
        {
          "code": 31,
          "message": "Validation failed",
          "errors": {
            "market": ["Market is not available."]
          }
        }
        ```

        ```json
        {
          "code": 31,
          "message": "Validation failed",
          "errors": {
            "market": ["Market field should not be empty string."]
          }
        }
        ```

        ```json
        {
          "code": 32,
          "message": "Validation failed",
          "errors": {
            "amount": [
              "Given amount is less than min amount 0.001",
              "Min amount step = 0.000001"
            ]
          }
        }
        ```

        ```json
        {
          "code": 36,
          "message": "Validation failed",
          "errors": {
            "client_order_id": ["ClientOrderId field should be a string."]
          }
        }
        ```

        ```json
        {
          "code": 36,
          "message": "Validation failed",
          "errors": {
            "client_order_id": [
              "ClientOrderId field should contain only latin letters, numbers and dashes."
            ]
          }
        }
        ```

        ```json
        {
          "code": 36,
          "message": "Validation failed",
          "errors": {
            "client_order_id": [
              "This client order id is already used by the current account."
            ]
          }
        }
        ```

        ```json
        {
          "code": 37,
          "message": "Validation failed",
          "errors": {
            "ioc": ["Either IOC or PostOnly flag in true state is allowed."]
          }
        }
        ```

        ```json
        {
          "code": 30,
          "message": "Validation failed",
          "errors": {
            "total": ["Total (amount * price) is less than 5.05"]
          }
        }
        ```

        ```json
        {
          "code": 32,
          "message": "Validation failed",
          "errors": {
            "amount": [
              "Min amount step = 0.01"
            ]
          }
        }
        ```

        ```json
        {
          "code": 33,
          "message": "Validation failed",
          "errors": {
            "price": ["Price field should be at least 10", "Min price step = 0.000001"]
          }
        }
        ```

        ```json
        {
          "code": 33,
          "message": "Validation failed",
          "errors": {
            "price": ["Price should be greater than 0."]
          }
        }
        ```

        ```json
        {
          "code": 35,
          "message": "Validation failed",
          "errors": {
            "maker_fee": ["Incorrect maker fee"]
          }
        }
        ```
        </Accordion>
      operationId: createLimitOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LimitOrderRequest'
      responses:
        '200':
          description: Order created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderResponse'
        '400':
          description: Inner validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Request validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Service temporarily unavailable
      security:
        - ApiKeyAuth: []
components:
  schemas:
    LimitOrderRequest:
      type: object
      required:
        - market
        - side
        - amount
        - price
        - request
        - nonce
      properties:
        market:
          type: string
          description: 'Available [market](/glossary#market). Example: BTC_USDT'
          example: BTC_USDT
        side:
          type: string
          enum:
            - buy
            - sell
          description: 'Order type. Variables: ''buy'' / ''sell'' Example: ''buy'''
          example: buy
        amount:
          type: string
          description: >-
            Amount of [stock](/glossary#stock) currency to buy or sell. Example:
            '0.001' or 0.001
          example: '0.001'
        price:
          type: string
          description: 'Price in money currency. Example: ''9800'' or 9800'
          example: '9800'
        client_order_id:
          type: string
          description: >-
            Identifier should be unique and contain letters, dashes, numbers,
            dots or underscores. The identifier must be unique.
          example: order1987111
        postOnly:
          type: boolean
          default: false
          description: >-
            [Orders](/glossary#orders) are guaranteed to be the
            [maker](/glossary#maker) order when
            [executed](/glossary#finished-orders). Variables: 'true' / 'false'
            Example: 'false'.
          example: false
        ioc:
          type: boolean
          default: false
          description: >
            Immediate-or-cancel (IOC) executes all or part of an order
            immediately and cancels any unfilled portion.


            IOC does not support `rpi=true` because RPI uses post-only behavior
            by design.

            The API returns error code `37` when a request sets both `ioc=true`
            and `rpi=true`.


            Refer to [Order Parameter Rules](/guides/order-parameter-rules) for
            unsupported parameter combinations.
          example: false
        bboRole:
          type: integer
          enum:
            - 1
            - 2
          description: >-
            When the [BBO](/glossary#bbo) option is activated for Limit orders,
            the system selects the best market prices for execution. Variables:
            1 - Queue Method / 2 - Counterparty Method. Use method 2 with ioc
            flag. Example: 2.
        stp:
          type: string
          enum:
            - 'no'
            - cancel_both
            - cancel_new
            - cancel_old
          default: 'no'
          description: >-
            Self trade prevention mode. Variables: 'no' / 'cancel_both' /
            'cancel_new' / 'cancel_old'. Example: 'no'.
          example: 'no'
        rpi:
          type: boolean
          description: >
            Enables Retail Price Improvement (RPI) mode.


            RPI orders use post-only behavior by design. An RPI order does not
            support `ioc=true`.

            The API returns error code `37` when a request sets both `rpi=true`
            and `ioc=true`.

            RPI orders do not appear in public order book feeds (`depth`,
            `bookTicker`). RPI orders are visible only in private active orders
            and in the exchange UI order book (web/mobile).

            RPI executions may apply custom fees or rebates, especially when
            trading via sub-accounts. Use Query Market Fee / Query All Market
            Fees to verify effective fees.


            Refer to [Order Parameter Rules](/guides/order-parameter-rules) for
            unsupported parameter combinations.
          example: true
        request:
          type: string
          example: '{{request}}'
        nonce:
          type: string
          example: '{{nonce}}'
    OrderResponse:
      type: object
      properties:
        order_id:
          type: integer
          description: Order ID
          example: 4180284841
        client_order_id:
          type: string
          description: Custom client order ID; empty string if not specified
          example: order1987111
        market:
          type: string
          description: Deal market
          example: BTC_USDT
        side:
          type: string
          description: Order side
          example: buy
        type:
          type: string
          description: Order type
          example: limit
        timestamp:
          type: number
          description: Timestamp of order creation
          example: 1595792396.165973
        deal_money:
          type: string
          description: If order finished - amount in money currency that is finished
          example: '0'
        deal_stock:
          type: string
          description: If order finished - amount in stock currency that is finished
          example: '0'
        amount:
          type: string
          description: Amount
          example: '0.01'
        left:
          type: string
          description: If order not finished - rest of the amount that must be finished
          example: '0.001'
        deal_fee:
          type: string
          description: Fee in money currency when order is filled
          example: '0'
        price:
          type: string
          description: Price
          example: '40000'
        postOnly:
          type: boolean
          description: PostOnly flag
          example: false
        ioc:
          type: boolean
          description: IOC flag
          example: false
        status:
          type: string
          description: Order status
          example: FILLED
        stp:
          type: string
          description: Self trade prevention mode
          example: 'no'
        positionSide:
          type: string
          description: Position side (for collateral orders)
          example: LONG
        rpi:
          type: boolean
          description: Indicates Retail Price Improvement (RPI) mode for the order.
          example: true
    ErrorResponse:
      type: object
      properties:
        code:
          type: integer
          description: Error code
          example: 30
        message:
          type: string
          description: Error message
          example: Validation failed
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Detailed error information
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-TXC-APIKEY
      description: |
        API Key authentication for private endpoints.

        Required headers:
        - X-TXC-APIKEY: API key
        - X-TXC-PAYLOAD: Base64 encoded JSON payload
        - X-TXC-SIGNATURE: HMAC SHA512 signature

````