Place Order

### 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 } ```

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:
expireTimestringOptionalformat: "date-time"
textstringOptional<=64 characters
activationTimestringOptionalformat: "date-time"
customTag50stringOptional<=64 characters
isAutomatedbooleanOptional

Response

PlaceOrderResult
failureReasonenum or null
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 or null<=8192 characters
orderIdlong or null