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.
action
Buy, Sell
Allowed values:
symbol
orderQty
orderType
Limit, MIT, Market, QTS, Stop, StopLimit, TrailingStop, TrailingStopLimit
accountSpec
accountId
clOrdId
price
stopPrice
maxShow
pegDifference
timeInForce
Day, FOK, GTC, GTD, IOC
Allowed values:
expireTime
text
activationTime
customTag50
isAutomated
Response
PlaceOrderResult
failureReason
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
failureText
orderId

