Orders

Place Order

Place an order.

Available to: All authenticated users

Environments: Demo, Live

Rate Limit: 1,500 requests per hour, 1-second back-off, counts all requests

Places an order on one of your accounts. Identify the account with either accountSpec (the account name) or accountId (the integer ID) — one is required — and set the action (Buy or Sell), the symbol, the orderQty, and the orderType. The price fields you must supply depend on the order type: a Limit or Stop order needs a price, and a StopLimit needs both price and stopPrice. On success, the response includes the new orderId.

// Demo environment; for Live use https://live.tradovateapi.com/v1
const URL = 'https://demo.tradovateapi.com/v1'

const body = {
    accountSpec: yourUserName,
    accountId: yourAccountId,
    action: "Buy",
    symbol: "MYMM1",
    orderQty: 1,
    orderType: "Market",
    isAutomated: true
}

const result = await fetch(`${URL}/order/placeorder`, {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${myAccessToken}`
    },
    body: JSON.stringify(body)
}).then(res => res.json()) // { orderId } on success
<Warning> Set `isAutomated` to `true` for any order placed by code or an automated process, and `false` only for an order a human places directly. Misreporting this can violate exchange policies. </Warning>

Order placement is subject to market, exchange, and risk-management rules, so a successful HTTP response doesn't guarantee acceptance. When an order is rejected, the response carries a failureReason and failureText explaining why; otherwise you receive an orderId.

Common Failure Scenarios

  • A risk limit blocks the order (for example, MaxPosLimitReached or MaxOrderQtyLimitReached).
  • The contract or price is invalid (InvalidContract, InvalidPrice).
  • The trading session is closed or trading is locked (SessionClosed, TradingLocked).
  • The market has no quote or insufficient liquidity (NoQuote, NotEnoughLiquidity).

Error Messages

failureReasonTrigger
MaxPosLimitReachedThe order would exceed the account's position limit.
MaxOrderQtyLimitReachedThe order quantity exceeds the account's maximum order size.
InvalidContractThe symbol doesn't resolve to a tradable contract.
InvalidPriceThe price is missing or invalid for the order type.
SessionClosedThe trading session is closed.
UnauthorizedThe user isn't permitted to trade this account or contract.

See the failureReason enum in the response schema for the complete list of values.

post/order/placeorder

Request

  • Base URL: https://demo.tradovateapi.com/v1
  • URL: https://demo.tradovateapi.com/v1/order/placeorder
  • Auth: HTTP bearer

Request body

accountSpecstring
accountIdinteger
clOrdIdstring
action'Buy' | 'Sell' required

Buy, Sell

symbolstring required
orderQtyinteger required
orderType'Limit' | 'LimitIfTouched' | 'MIT' | 'Market' | 'MarketLimit' | 'MarketStopWithProtection' | 'MarketWithProtection' | 'QTS' | 'Stop' | 'StopLimit' | 'TrailingStop' | 'TrailingStopLimit' required

Limit, LimitIfTouched, MIT, Market, MarketLimit, MarketStopWithProtection, MarketWithProtection, QTS, Stop, StopLimit, TrailingStop, TrailingStopLimit

pricenumber double
stopPricenumber double
limitIfTouchedPricenumber double
maxShowinteger
pegDifferencenumber double
timeInForce'Day' | 'FOK' | 'GTC' | 'GTD' | 'IOC'

Day, FOK, GTC, GTD, IOC

expireTimestring date-time
textstring
activationTimestring date-time
customTag50string
isAutomatedboolean

Response

PlaceOrderResult

failureReason'AccountClosed' | 'AdvancedTrailingStopUnsupported' | 'AnotherCommandPending' | 'BackMonthProhibited' | 'ExecutionProviderNotConfigured' | 'ExecutionProviderUnavailable' | 'HomeStateRestricted' | 'InvalidContract' | 'InvalidPrice' | 'KeyInformationDocumentRequired' | 'LiquidationOnly' | 'LiquidationOnlyBeforeExpiration' | 'MaxOrderQtyIsNotSpecified' | 'MaxOrderQtyLimitReached' | 'MaxPosLimitMisconfigured' | 'MaxPosLimitReached' | 'MaxTotalPosLimitReached' | 'MinTradeDurationNotElapsed' | 'MultipleAccountPlanRequired' | 'NoQuote' | 'NotEnoughLiquidity' | 'OtherExecutionRelated' | 'ParentRejected' | 'RiskCheckTimeout' | 'SSFNFAComplianceRequired' | 'SSFNFAComplianceRequiredJointOnly' | 'SSFRiskDisclosureAcknowledgmentRequired' | 'SessionClosed' | 'Success' | 'TooLate' | 'TradingLocked' | 'TrailingStopNonOrderQtyModify' | 'Unauthorized' | 'UnknownReason' | 'Unsupported'

AccountClosed, AdvancedTrailingStopUnsupported, AnotherCommandPending, BackMonthProhibited, ExecutionProviderNotConfigured, ExecutionProviderUnavailable, HomeStateRestricted, InvalidContract, InvalidPrice, KeyInformationDocumentRequired, LiquidationOnly, LiquidationOnlyBeforeExpiration, MaxOrderQtyIsNotSpecified, MaxOrderQtyLimitReached, MaxPosLimitMisconfigured, MaxPosLimitReached, MaxTotalPosLimitReached, MinTradeDurationNotElapsed, MultipleAccountPlanRequired, NoQuote, NotEnoughLiquidity, OtherExecutionRelated, ParentRejected, RiskCheckTimeout, SSFNFAComplianceRequired, SSFNFAComplianceRequiredJointOnly, SSFRiskDisclosureAcknowledgmentRequired, SessionClosed, Success, TooLate, TradingLocked, TrailingStopNonOrderQtyModify, Unauthorized, UnknownReason, Unsupported

failureTextstring
orderIdinteger

Changes

No recorded changes to this operation across all 1 revision of this API.