Place Stock Order
place_stock_orderPlace buy or sell orders for stocks and ETFs with configurable order type, quantity or notional amount, time-in-force, and advanced routing options.
Instructions
Place a stock or ETF order.
Args:
symbol: Stock ticker (e.g., "AAPL", "SPY").
side: "buy" or "sell".
qty: Number of shares. Mutually exclusive with notional.
notional: Dollar amount to trade. Mutually exclusive with qty.
Only valid for market orders with time_in_force="day".
type: Order type — "market", "limit", "stop", "stop_limit",
"trailing_stop".
time_in_force: "day", "gtc", "opg", "cls", "ioc", or "fok".
limit_price: Required for limit and stop_limit orders.
stop_price: Required for stop and stop_limit orders.
trail_price: Dollar trail amount for trailing_stop orders.
trail_percent: Percent trail for trailing_stop orders.
extended_hours: Allow execution in pre-market, after-hours, and
overnight sessions. Only works with type="limit"
and time_in_force="day" or "gtc".
client_order_id: Unique idempotency key. If the request times out,
you can safely retry with the same value — the API
will reject duplicates. Recommended for every order.
order_class: "simple", "bracket", "oco", or "oto". Automatically
set to "bracket" when take_profit or stop_loss params
are provided.
take_profit_limit_price: Limit price for bracket take-profit leg.
stop_loss_stop_price: Stop price for bracket stop-loss leg.
stop_loss_limit_price: Limit price for bracket stop-loss leg.
advanced_instructions: Alpaca Elite Smart Router routing/algo
payload. Stocks-only (the Elite docs explicitly note options
and crypto reject the payload). Requires the account to be
on Elite Smart Router routing; non-Elite accounts will see
the field ignored or rejected by Alpaca's API. Shapes:
DMA Gateway (direct routing):
{"algorithm": "DMA",
"destination": "NYSE"|"NASDAQ"|"ARCA",
"display_qty": "<round lot, optional>"}
Only with type="limit"|"market" and time_in_force="day";
not compatible with opg/cls/gtc or stop orders.
VWAP (Volume-Weighted Average Price):
{"algorithm": "VWAP",
"start_time": "<RFC3339, optional>",
"end_time": "<RFC3339, optional>",
"max_percentage": "<0<x<1, optional>"}
Does NOT participate in open/close auctions.
TWAP (Time-Weighted Average Price):
{"algorithm": "TWAP",
"start_time": "<RFC3339, optional>",
"end_time": "<RFC3339, optional>",
"max_percentage": "<0<x<1, optional>"}
Does NOT participate in open/close auctions.
NOTE: PATCH /v2/orders/{id} already documents
advanced_instructions in the OpenAPI spec
(PatchOrderRequest), and replace_order_by_id exposes
it through auto-generation — this patch only addresses
the POST-side asymmetry.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| qty | No | ||
| side | Yes | ||
| type | No | market | |
| symbol | Yes | ||
| notional | No | ||
| stop_price | No | ||
| limit_price | No | ||
| order_class | No | ||
| trail_price | No | ||
| time_in_force | No | day | |
| trail_percent | No | ||
| extended_hours | No | ||
| client_order_id | No | ||
| stop_loss_stop_price | No | ||
| advanced_instructions | No | ||
| stop_loss_limit_price | No | ||
| take_profit_limit_price | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||