---
updatedAt: 2026-03-26T12:27:31.000Z
agentTools:
  projectIndex: https://public-api.tradelocker.com/llms.txt
---

# Place a new order

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.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "description": "Trading API",
    "version": "2.11.0",
    "title": "Trading API",
    "contact": {}
  },
  "tags": [
    {
      "name": "Trading",
      "description": "Creating, modifying and deleting orders."
    }
  ],
  "paths": {
    "/trade/accounts/{accountId}/orders": {
      "post": {
        "tags": [
          "Trading"
        ],
        "summary": "Place a new order",
        "description": "Place a new order.<br>\nFields `qty, routeId, side, validity, type, tradableInstrumentId` are mandatory inside of the request body. Price can be set to 0 for market orders.\n\nIf using a `stop` type of order, you must specify the `stopPrice`.\n\nValidity (also known as TimeInForce - TIF in some error messages) must be `IOC` for `market` orders and `GTC` for `limit` and `stop` orders.",
        "operationId": "placeOrder",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "description": "Account identifier.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "accNum",
            "in": "header",
            "description": "Account number",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "developer-api-key",
            "in": "header",
            "description": "developer-api-key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Post_Order"
              }
            }
          },
          "description": "Request body with parameters",
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostOrderResponse"
                },
                "examples": {
                  "OK": {
                    "summary": "OK",
                    "value": {
                      "d": {
                        "orderId": "123"
                      },
                      "s": "ok"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    }
  },
  "servers": [
    {
      "url": "https://demo.tradelocker.com/backend-api"
    },
    {
      "url": "https://live.tradelocker.com/backend-api"
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "PostOrderResponse": {
        "type": "object",
        "required": [
          "d",
          "s"
        ],
        "properties": {
          "d": {
            "$ref": "#/components/schemas/PostOrderResponseD"
          },
          "s": {
            "type": "string",
            "example": "ok",
            "description": "Status will always be `ok`."
          }
        },
        "title": "PostOrderResponse"
      },
      "PostOrderResponseD": {
        "type": "object",
        "properties": {
          "orderId": {
            "type": "string",
            "example": 1,
            "description": "New order identifier."
          }
        },
        "title": "PostOrderResponseD"
      },
      "Post_Order": {
        "type": "object",
        "required": [
          "qty",
          "side",
          "tradableInstrumentId",
          "type",
          "routeId",
          "validity"
        ],
        "properties": {
          "price": {
            "type": "number",
            "description": "Limit Price for Limit order."
          },
          "qty": {
            "type": "number",
            "description": "The number of units to open the buy or sell order."
          },
          "routeId": {
            "type": "number",
            "description": "Identifier of the trade connection. Find the corresponding INFO or TRADE routeId by querying the /trade/accounts/{accountId}/instruments endpoint."
          },
          "side": {
            "type": "string",
            "description": "Order side. If the creating order is a closing one for the position, then the side must\nbe opposite to the side of the position",
            "enum": [
              "buy",
              "sell"
            ]
          },
          "strategyId": {
            "type": "string",
            "description": "Arbitrary string (up to 31 chars) that can be attached to identify orders and positions placed through algorithmic trading.\nThis value will also be visible in `GET /orders`, `GET /ordersHistory`, and `GET /positions`."
          },
          "stopLoss": {
            "type": "number",
            "description": "Stop loss amount for the order. Must be specified in case of `absolute` or `offset` stop loss type."
          },
          "stopLossType": {
            "type": "string",
            "description": "Type of stop loss price for the order. Available types: absolute, offset, trailingOffset.",
            "enum": [
              "absolute",
              "offset",
              "trailingOffset"
            ]
          },
          "stopPrice": {
            "type": "number",
            "description": "Stop Price for Stop orders."
          },
          "takeProfit": {
            "type": "number",
            "description": "TakeProfit amount for the order. Must be specified together with the `takeProfitType` field. Specifies either the absolute price, or an offset in pips."
          },
          "takeProfitType": {
            "type": "string",
            "description": "Type of take profit for the order. Available types: [absolute, offset]. Must be specified together with the `takeProfit` field.",
            "enum": [
              "absolute",
              "offset"
            ]
          },
          "trStopOffset": {
            "type": "number",
            "description": "For the 'trailingOffset' stopLossType. The trailing offset in pips."
          },
          "tradableInstrumentId": {
            "type": "integer",
            "format": "int64",
            "description": "Identifier of the instrument that is used for trading purposes."
          },
          "type": {
            "type": "string",
            "description": "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.",
            "enum": [
              "limit",
              "market",
              "stop"
            ]
          },
          "validity": {
            "type": "string",
            "description": "Whether the order is Good Till Cancelled (GTC) or Immediate or Cancel (IOC). For `market` orders, use IOC, otherwise, use GTC.\nIn error messages, Validity is sometimes referred to as TimeInForce (TIF).",
            "enum": [
              "GTC",
              "IOC"
            ]
          }
        },
        "title": "Post Order"
      }
    }
  }
}
```