Preview Order
/accounts/{accountId}/previewOrderPreview an order before submission. Returns a confirmId and structured confirmation details. Use this to validate the order, check for sufficient buying power, calculate fees and show the validation results to the human. The human can then decline or proceed with order placement, in this case pass confirmId to Place Order to submit.
Path Parameters
The account identifier.
Body Parameters
Security symbol. Example: AAPL.
Order direction. Enum: buy — buy; sell — sell.
Order type. Enum: limit — limit order; market — market order; stop — stop market order; stopLimit — stop limit order.
Whether the order size is specified by quantity or notional amount. Enum: qty — order by quantity; amount — order by notional amount.
Asset class. Enum: stock; etf; crypto; option; future; arbitrage; others.
Order time-in-force. Enum: day — day order; gtc — good till cancelled.
Trading session. Enum: reg — regular hours only; all — pre-market + regular + after-hours.
Order quantity. Required when quantityType is qty.
Order notional amount. Required when quantityType is amount.
Limit price. Required for limit and stopLimit order types.
Stop trigger price. Required for stop and stopLimit order types.
Position direction. Enum: open — open position; close — close position.
Take-profit leg. Contains price (string, required) — take-profit limit price; type (string, optional, default limit).
Stop-loss leg. Contains stopPrice (string, required) — stop trigger price; price (string, optional) — limit price for stopLimit type; type (string, optional, default stop): stop or stopLimit.
Request Example
{
"instrument": "BAC",
"side": "buy",
"type": "limit",
"quantityType": "qty",
"qty": "100",
"limitPrice": "30.0",
"category": "stock",
"durationType": "day",
"extendHours": "reg"
}Response
Preview generated successfully.
Status indicator. ok on success.
Error message if the preview could not be generated. Example: invalid param.
Confirmation token to pass back as confirmId when calling Place Order.
Array of informational sections to display to the user before order submission.
Section heading. Example: Estimated.
Rows of key-value detail within the section.
Warning messages for the section. Example: Estimated money impact is for main order only.
Error messages for the section. Example: Failed to build order confirmation.
Response Example
{
"s": "ok",
"d": {
"confirmId": "0000001",
"sections": [
{
"header": "Estimated",
"rows": [
{
"label": "Estimated Cost",
"value": "$1,000.00"
}
],
"warnings": [
"A warning is some message that should be shown to the user, but not necessarily preventing from executing the order."
],
"errors": [
"The order can not be executed right now because of errors specified here."
]
}
]
}
}