Place Stock Order
place_stock_orderPlace a stock or ETF order by ticker symbol and side, with optional order type, quantity, price, and time-in-force settings.
Instructions
Place a stock or ETF order.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| qty | No | Number of shares. Mutually exclusive with notional. | |
| side | Yes | "buy" or "sell". | |
| type | No | Order type — "market", "limit", "stop", "stop_limit", "trailing_stop". | market |
| symbol | Yes | Stock ticker (e.g., "AAPL", "SPY"). | |
| notional | No | Dollar amount to trade. Mutually exclusive with qty. Only valid for market orders with time_in_force="day". | |
| stop_price | No | Required for stop and stop_limit orders. | |
| limit_price | No | Required for limit and stop_limit orders. | |
| order_class | No | "simple", "bracket", "oco", or "oto". Automatically set to "bracket" when take_profit or stop_loss params are provided. | |
| trail_price | No | Dollar trail amount for trailing_stop orders. | |
| time_in_force | No | "day", "gtc", "opg", "cls", "ioc", or "fok". | day |
| trail_percent | No | Percent trail for trailing_stop orders. | |
| extended_hours | No | 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 | No | 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. | |
| stop_loss_stop_price | No | Stop price for bracket stop-loss leg. | |
| advanced_instructions | No | 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. | |
| stop_loss_limit_price | No | Limit price for bracket stop-loss leg. | |
| take_profit_limit_price | No | Limit price for bracket take-profit leg. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||