For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Support Center
OverviewAPIResources
OverviewAPIResources
  • REST API Endpoints
      • GETCommand Dependents
      • GETCommand Item
      • GETCommand Items
      • GETCommand L Dependents
      • GETCommand List
      • GETCommand Report Dependents
      • GETCommand Report Item
      • GETCommand Report Items
      • GETCommand Report L Dependents
      • GETCommand Report List
      • GETExecution Report Dependents
      • GETExecution Report Find
      • GETExecution Report Item
      • GETExecution Report Items
      • GETExecution Report L Dependents
      • GETExecution Report List
      • GETFill Dependents
      • GETFill Item
      • GETFill Items
      • GETFill L Dependents
      • GETFill List
      • GETFill Fee Dependents
      • GETFill Fee Item
      • GETFill Fee Items
      • GETFill Fee L Dependents
      • GETFill Fee List
      • POSTCancel Order
      • GETOrder Dependents
      • GETOrder Item
      • GETOrder Items
      • GETOrder L Dependents
      • POSTLiquidate Position
      • POSTLiquidate Positions
      • GETOrder List
      • POSTModify Order
      • POSTPlace OCO
      • POSTPlace Order
      • POSTPlace OSO
      • GETOrder Strategy Dependents
      • POSTInterrupt Order Strategy
      • GETOrder Strategy Item
      • GETOrder Strategy Items
      • GETOrder Strategy L Dependents
      • GETOrder Strategy List
      • POSTModify Order Strategy
      • POSTStart Order Strategy
      • GETOrder Strategy Link Dependents
      • GETOrder Strategy Link Item
      • GETOrder Strategy Link Items
      • GETOrder Strategy Link L Dependents
      • GETOrder Strategy Link List
      • GETOrder Version Dependents
      • GETOrder Version Item
      • GETOrder Version Items
      • GETOrder Version L Dependents
      • GETOrder Version List
Support Center
LogoLogo
REST API EndpointsOrders

Place Order

POST
https://demo.tradovateapi.com/v1/order/placeorder
POST
/v1/order/placeorder
1const url = 'https://demo.tradovateapi.com/v1/order/placeorder';
2const options = {
3 method: 'POST',
4 headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
5 body: '{"action":"Buy","symbol":"string","orderQty":1,"orderType":"Limit"}'
6};
7
8try {
9 const response = await fetch(url, options);
10 const data = await response.json();
11 console.log(data);
12} catch (error) {
13 console.error(error);
14}
200Successful
1{
2 "failureReason": "AccountClosed",
3 "failureText": "string",
4 "orderId": 1
5}
### Make a request to place an order. Depending on the order type, the parameters vary. In the Trader application, you can see the details of placing a standard order ticket by adding the Order Ticket module to your workspace. #### *Market Order* ```js const URL = 'demo.tradovateapi.com/v1' const body = { accountSpec: yourUserName, accountId: yourAcctId, action: "Buy", symbol: "MYMM1", orderQty: 1, orderType: "Market", isAutomated: true //must be true if this isn't an order made directly by a human } const response = await fetch(URL + '/order/placeorder', { method: 'POST', headers: { 'Accept': 'application/json', 'Authorization': `Bearer ${myAccessToken}`, }, body: JSON.stringify(body) }) const json = await response.json() // { orderId: 0000000 } ``` #### *Sell Limit* ```js const URL = 'demo.tradovateapi.com/v1' const body = { accountSpec: yourUserName, accountId: yourAcctId, action: "Sell", symbol: "MYMM1", orderQty: 1, orderType: "Limit", price: 35000, //use for single value like limit or stop isAutomated: true //must be true if this isn't an order made directly by a human } const response = await fetch(URL + '/order/placeorder', { method: 'POST', headers: { 'Accept': 'application/json', 'Authorization': `Bearer ${myAccessToken}`, }, body: JSON.stringify(body) }) const json = await response.json() // { orderId: 0000000 } ```
Was this page helpful?
Previous

Place OSO

Next
Built with

Make a request to place an order.

Depending on the order type, the parameters vary. In the Trader application, you can see the details of placing a standard order ticket by adding the Order Ticket module to your workspace.

Market Order

1const URL = 'demo.tradovateapi.com/v1'
2const body = {
3 accountSpec: yourUserName,
4 accountId: yourAcctId,
5 action: "Buy",
6 symbol: "MYMM1",
7 orderQty: 1,
8 orderType: "Market",
9 isAutomated: true //must be true if this isn't an order made directly by a human
10}
11
12const response = await fetch(URL + '/order/placeorder', {
13 method: 'POST',
14 headers: {
15 'Accept': 'application/json',
16 'Authorization': `Bearer ${myAccessToken}`,
17 },
18 body: JSON.stringify(body)
19})
20
21const json = await response.json() // { orderId: 0000000 }

Sell Limit

1const URL = 'demo.tradovateapi.com/v1'
2const body = {
3 accountSpec: yourUserName,
4 accountId: yourAcctId,
5 action: "Sell",
6 symbol: "MYMM1",
7 orderQty: 1,
8 orderType: "Limit",
9 price: 35000, //use for single value like limit or stop
10 isAutomated: true //must be true if this isn't an order made directly by a human
11}
12
13const response = await fetch(URL + '/order/placeorder', {
14 method: 'POST',
15 headers: {
16 'Accept': 'application/json',
17 'Authorization': `Bearer ${myAccessToken}`,
18 },
19 body: JSON.stringify(body)
20})
21
22const json = await response.json() // { orderId: 0000000 }

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
actionenumRequired
Buy, Sell
Allowed values:
symbolstringRequired<=64 characters
orderQtyintegerRequired>=0
orderTypeenumRequired
Limit, MIT, Market, QTS, Stop, StopLimit, TrailingStop, TrailingStopLimit
accountSpecstringOptional<=64 characters
accountIdlongOptional
clOrdIdstringOptional<=64 characters
pricedoubleOptional
stopPricedoubleOptional
maxShowintegerOptional>=0
pegDifferencedoubleOptional
timeInForceenumOptional
Day, FOK, GTC, GTD, IOC
Allowed values:
expireTimedatetimeOptional
textstringOptional<=64 characters
activationTimedatetimeOptional
customTag50stringOptional<=64 characters
isAutomatedbooleanOptional

Response

PlaceOrderResult
failureReasonenum
AccountClosed, AdvancedTrailingStopUnsupported, AnotherCommandPending, BackMonthProhibited, ExecutionProviderNotConfigured, ExecutionProviderUnavailable, InvalidContract, InvalidPrice, LiquidationOnly, LiquidationOnlyBeforeExpiration, MaxOrderQtyIsNotSpecified, MaxOrderQtyLimitReached, MaxPosLimitMisconfigured, MaxPosLimitReached, MaxTotalPosLimitReached, MultipleAccountPlanRequired, NoQuote, NotEnoughLiquidity, OtherExecutionRelated, ParentRejected, RiskCheckTimeout, SessionClosed, Success, TooLate, TradingLocked, TrailingStopNonOrderQtyModify, Unauthorized, UnknownReason, Unsupported
failureTextstring<=8192 characters
orderIdlong