---
title: "Create Order"
method: POST
path: "/v1/perps/orders"
tags: ["Orders"]
---

# Create Order

`POST /v1/perps/orders`

Creates a limit or market order. Change the "type" field to switch between order types. If `postOnly` is `true` and an order would match at placement, a 400 is returned with error `post_only_has_match`. For the available order types and their behavior, see [Order types](/order-types).

## Request body

- AddOrderReq
  - `side` 'buy' | 'sell', required — buy or sell
  - `price` string — Limit price. Must be aligned with quoteIncrement from /v1/markets. Omit for market orders.
  - `size` string — Order quantity in base currency. Used for both limit and market orders. Must be aligned with baseIncrement from /v1/markets.
  - `quoteSize` string — Order quantity in quote currency. Can only be set for market order buys.
  - `market` string, required — Trading market pair
  - `clientOrderId` string — Optional client-provided order ID. Must be alphanumeric including underscores and dashes, and at most 64 characters.
  - `type` 'limit' | 'market' — Order type. Defaults to "limit".
  - `timeInForce` 'GTC' | 'IOC' — "GTC" (Good until cancelled) or "IOC" (Immediate or cancel). Cannot be set for market orders. Defaults to "GTC".
  - `postOnly` boolean — If true, the order is rejected if it would match at placement. Returns 400 with error `post_only_has_match` if it would match.
  - `reduceOnly` boolean — If true, the order can only reduce an existing position.
  - `takeProfit` StopOrderReq
    - `triggerPrice` string, required — Trigger price for the stop order
  - `stopLoss` StopOrderReq
    - `triggerPrice` string, required — Trigger price for the stop order

## Response `200`

Created order

- object
  - `success` boolean, required — Whether the request was successful
  - `error` string — Error message, present only on failure
  - `error_code` string — Semantic error code. See each endpoint's error responses for the specific codes it can return.
  - `deprecated` string — Deprecation notice, if applicable
  - `result` ApiOrder
    - `orderId` string, required — Internal order ID
    - `clientOrderId` string — Client-provided order ID (if set)
    - `parentOrderId` string — Parent order ID (e.g. for TWAP child orders)
    - `side` 'buy' | 'sell', required — buy or sell
    - `price` string, required — Limit price
    - `size` string, required — Order quantity in base currency
    - `market` string, required — Trading market
    - `filledSize` string, required — Quantity of the order that has been filled
    - `lastFillSize` string, required — Quantity filled in the most recent trade
    - `filledCost` string, required — Cost of the filled portion of the order (filledSize × fill price)
    - `realizedPnl` string — Realized PNL for this order (perps only)
    - `fee` string, required — Fees incurred on this order
    - `feeRebate` string — Fee rebate earned on this order (perps only)
    - `status` 'open' | 'fullyfilled' | 'canceled' | 'pending' | 'untriggered', required — Order status
    - `createdAt` string, date-time, required — Order creation time
    - `filledAt` string, date-time — Time when the order was fully filled (if applicable)
    - `canceledAt` string, date-time — Order cancellation time (if cancelled)
    - `cancelReason` '' | 'liquidation' | 'selfMatchPrevention' | 'cancelAfterTimeout' | 'startupBadPrice' | 'immediateOrCancel' | 'cancelAfterTimeoutOnShutdown' | 'cancelOnStartup' | 'cancelByAdmin' | 'positionClosed' | 'stopOrderPositionNeutral' | 'stopOrderPositionDirectionMismatch' | 'stopOrderInLiquidation' | 'stopOrderInternalError' — Reason the order was cancelled. Possible values: "" (user cancelled), "liquidation", "selfmatchprevention", "cancelaftertimeout", "startupbadprice", "immediateorcancel"
    - `type` 'limit' | 'market' | 'stopMarket' | 'takeProfitMarket', required — Order type
    - `timeInForce` 'GTC' | 'IOC' — Time in force (GTC or IOC). Not returned for market orders.
    - `reduceOnly` boolean — Whether the order is reduce-only
    - `liquidationId` string — ID of the liquidation event this order participated in (perps only)
    - `closePosition` boolean — True if this is a position-level TP/SL order
    - `stopOrderType` 'stopLoss' | 'takeProfit' — Stop order type (stopLoss or takeProfit), if applicable
    - `triggerPrice` string — Trigger price for stop orders

## Other responses

- `400` — Bad request. The request was malformed or failed validation.
- `401` — Authentication required. Provide a valid JWT or API key.
- `403` — Access denied. The authenticated account does not have permission.
- `429` — Rate limit exceeded. Slow down request frequency.
- `500` — Internal server error.

---

[API](https://skmtc.net/ondoperps/apis/ondo-perps-rest-api.md) · [All operations](https://skmtc.net/ondoperps/apis/ondo-perps-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ondoperps/ondo-perps-rest-api/versions/39df6b2fa672/schema)
