Place Order

POST/accounts/{accountId}/orders

Place a new order for the specified account. Call Preview Order first to pre-validate and show the results to the user, and then use confirmId in this request.

Path Parameters

accountIdstringrequired

The account identifier.

Body Parameters

instrumentstringrequired

Security symbol. Example: AAPL.

sidestringrequired

Order direction. Enum: buy — buy; sell — sell.

typestringrequired

Order type. Enum: limit — limit order; market — market order; stop — stop market order; stopLimit — stop limit order.

quantityTypestringrequired

Whether the order size is specified by quantity or notional amount. Enum: qty — order by quantity; amount — order by notional amount.

categorystringrequired

Asset class. Enum: stock; etf; crypto; option; future; arbitrage; others.

durationTypestringrequired

Order time-in-force. Enum: day — day order; gtc — good till cancelled.

extendHoursstringrequired

Trading session. Enum: reg — regular hours only; all — pre-market + regular + after-hours.

qtystringoptional

Order quantity. Required when quantityType is qty.

amountstringoptional

Order notional amount. Required when quantityType is amount.

limitPricestringoptional

Limit price. Required for limit and stopLimit order types.

stopPricestringoptional

Stop trigger price. Required for stop and stopLimit order types.

openClosestringoptional

Position direction. Enum: open — open position; close — close position.

takeProfitobjectoptional

Take-profit leg. Contains price (string, required) — take-profit limit price; type (string, optional, default limit) — order type, only limit supported.

stopLossobjectoptional

Stop-loss leg. Contains stopPrice (string, required) — stop trigger price; price (string, optional) — limit price for stopLimit type; type (string, optional, default stop) — order type: stop or stopLimit.

confirmIdstringoptional

The confirmId returned from a prior preview request.

Request Example

Place Order
JSON
{
  "instrument": "BAC",
  "side": "buy",
  "type": "limit",
  "quantityType": "qty",
  "qty": "100",
  "limitPrice": "30.0",
  "category": "stock",
  "durationType": "day",
  "extendHours": "reg",
  "confirmId": "0000001"
}

Response

200application/json

Order accepted.

sstring

Status indicator. ok on success.

d.orderIdstring

The identifier of the newly created order.

Response

errorapplication/json

Request rejected.

sstring

Error code string, e.g. invalid_grant.

errmsgstring

Human-readable error message.

Response Example

{
  "s": "ok",
  "d": {
    "orderId": "112358"
  }
}