---
title: "Place a new order"
method: POST
path: "/trade/accounts/{accountId}/orders"
tags: ["Trading"]
---

# Place a new order

`POST /trade/accounts/{accountId}/orders`

Place a new order.<br>
Fields `qty, routeId, side, validity, type, tradableInstrumentId` are mandatory inside of the request body. Price can be set to 0 for market orders.

If using a `stop` type of order, you must specify the `stopPrice`.

Validity (also known as TimeInForce - TIF in some error messages) must be `IOC` for `market` orders and `GTC` for `limit` and `stop` orders.

## Path parameters

- `accountId` integer, required

## Headers

- `accNum` integer, required
- `developer-api-key` string

## Request body

- PostOrder
  - `price` number — Limit Price for Limit order.
  - `qty` number, required — The number of units to open the buy or sell order.
  - `routeId` number, required — Identifier of the trade connection. Find the corresponding INFO or TRADE routeId by querying the /trade/accounts/{accountId}/instruments endpoint.
  - `side` 'buy' | 'sell', required — Order side. If the creating order is a closing one for the position, then the side must be opposite to the side of the position
  - `strategyId` string — Arbitrary string (up to 31 chars) that can be attached to identify orders and positions placed through algorithmic trading. This value will also be visible in `GET /orders`, `GET /ordersHistory`, and `GET /positions`.
  - `stopLoss` number — Stop loss amount for the order. Must be specified in case of `absolute` or `offset` stop loss type.
  - `stopLossType` 'absolute' | 'offset' | 'trailingOffset' — Type of stop loss price for the order. Available types: absolute, offset, trailingOffset.
  - `stopPrice` number — Stop Price for Stop orders.
  - `takeProfit` number — TakeProfit amount for the order. Must be specified together with the `takeProfitType` field. Specifies either the absolute price, or an offset in pips.
  - `takeProfitType` 'absolute' | 'offset' — Type of take profit for the order. Available types: [absolute, offset]. Must be specified together with the `takeProfit` field.
  - `trStopOffset` number — For the 'trailingOffset' stopLossType. The trailing offset in pips.
  - `tradableInstrumentId` integer, required — Identifier of the instrument that is used for trading purposes.
  - `type` 'limit' | 'market' | 'stop', required — Order type. Available types: limit, market, stop. If using a stop order, the stopPrice field must be specified. If using a limit order, the price field must be specified. If using a market order, the price field is ignored.
  - `validity` 'GTC' | 'IOC', required — Whether the order is Good Till Cancelled (GTC) or Immediate or Cancel (IOC). For `market` orders, use IOC, otherwise, use GTC. In error messages, Validity is sometimes referred to as TimeInForce (TIF).

## Response `200`

OK

- PostOrderResponse
  - `d` PostOrderResponseD, required
    - `orderId` string — New order identifier.
  - `s` string, required — Status will always be `ok`.

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found

---

[API](https://skmtc.net/tradelocker/apis/trading-api.md) · [All operations](https://skmtc.net/tradelocker/apis/trading-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tradelocker/trading-api/revisions/5b184d9b617c/schema)
