---
title: "POST /v2/user/accounts/{server}/{accountId}/orders"
method: POST
path: "/v2/user/accounts/{server}/{accountId}/orders"
tags: ["Trading (v2)"]
---

# POST /v2/user/accounts/{server}/{accountId}/orders

`POST /v2/user/accounts/{server}/{accountId}/orders`

## Request

- Base URL: `https://trading-api.oanda.com` (the document declares no server; this is the origin it was published from)
- URL: `https://trading-api.oanda.com/v2/user/accounts/{server}/{accountId}/orders`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/oanda/apis/up-gateway-v1/docs/v2/user/accounts/:server/:accountId/orders/post.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `server` 'oanda' | 'oanda-demo' | 'otms' | 'v20' | 'v20-demo' | 'oj' | 'oj-demo' | 'opt' | 'ftmo-1', required
- `accountId` string, required

## Request body

- object
  - `instrument` string, required
  - `orderType` 'MARKET' | 'MARKET_IF_TOUCHED' | 'STOP' | 'LIMIT', required
  - `executionMode` 'MARKET' | 'EXCHANGE': Exchange needs to be set for all mt5 symbols configured as exhange trade mode. It defaults to MARKET
  - `price` number
  - `quantity` number, required
  - `expiryTime` number: UTC timestamp in milliseconds
  - `expiryType` 'GTC' | 'SPECIFIED' | 'DAY' | 'SPECIFIED_DAY': - `GTC`: Good 'Til Canceled. The order remains active until canceled. Default value. - `DAY`: The order is active for the current trading day only. - `SPECIFIED`: The order expires at the time specified in `expiryTime`. The `expiryTime` field is required for this type. - `SPECIFIED_DAY`: The order expires at the specified day or the nearest trading time, as given in `expiryTime`. The `expiryTime` field is required for this type.
  - `stopLoss` number
  - `stopLossType` 'NORMAL' | 'GUARANTEED': Avaliable only for v20-* based accounts
  - `takeProfit` number
  - `direction` 'LONG' | 'SHORT', required
  - `trailingStop` number: Trailing Stop distance value
  - `priceBound` number: Avaliable only for v20-* based accounts
  - `fillType` 'FOK' | 'IOC' | 'RETURN', required: For v20-* based accounts FOK and IOC is used for MARKET orders, for STOP/LIMIT order only RETURN.
  - `trackingData` object
    - `instrumentCategory` string
    - `instrumentCategoryCountry` string
    - `isCFD` boolean

## Response `200`

OK

- object
  - `id` string, required
  - `transactionId` string, required

## Other responses

- `400`: FAIL

---

[API](https://skmtc.dev/oanda/apis/up-gateway-v1.md) - [All operations](https://skmtc.dev/oanda/apis/up-gateway-v1/llms.txt) - [OpenAPI document](https://skmtc.dev/oanda/apis/up-gateway-v1/revisions/395d645513bf?raw)
