account-onboarding
Open and manage brokerage accounts via the Alpaca Broker API — account creation, KYC/CIP, identity & disclosures, agreements,…
Place and manage orders on behalf of accounts via the Alpaca Broker API — order creation (qty vs notional, fractional shares, order types/TIF/classes), order status lifecycle, replace/cancel, positions, and trading-account buying power. Use when building trading,
$ npx -y skills add alpacahq/alpaca-skills --skill trading-orders --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/trading-ordersContext preview
The summary Claude sees to decide when to auto-load this skill.
Place and manage orders on behalf of accounts via the Alpaca Broker API — order creation (qty vs notional, fractional shares, order types/TIF/classes), order status lifecycle, replace/cancel, positions, and trading-account buying power. Use when building trading,
name: alpaca-broker-trading-orders description: Place and manage orders on behalf of accounts via the Alpaca Broker API — order creation (qty vs notional, fractional shares, order types/TIF/classes), order status lifecycle, replace/cancel, positions, and trading-account buying power. Use when building trading, recurring-invest, or portfolio flows on Alpaca in any language.
Place, modify, cancel, and track orders for an end-user account, and read positions & buying power. The defining feature of Broker API trading: **`account_id` is in the path** — you act *for* a user account, not your own.
> Read `alpaca-broker-integration` first for base URLs and auth (client-credentials Bearer token; legacy Basic still works). (The standalone Trading API uses `/v2/orders` with no account in the path; everything else here transfers.)
| Method | Path | Purpose | |--------|------|---------| | POST | `/v1/trading/accounts/{id}/orders` | Create order | | GET | `/v1/trading/accounts/{id}/orders` | List orders (filter by `status`, `symbols`, `after`…) | | GET | `/v1/trading/accounts/{id}/orders/{order_id}` | Get order by ID | | GET | `/v1/trading/accounts/{id}/orders:by_client_order_id?client_order_id=…` | Get by your client ID | | PATCH | `/v1/trading/accounts/{id}/orders/{order_id}` | Replace (modify) order | | DELETE | `/v1/trading/accounts/{id}/orders/{order_id}` | Cancel one order (204) | | DELETE | `/v1/trading/accounts/{id}/orders` | Cancel all (207 Multi-Status) | | POST | `/v1/trading/accounts/{id}/orders/estimation` | Cost-estimate an order | | GET / DELETE | `/v1/trading/accounts/{id}/positions[/{symbol_or_asset_id}]` | List / close positions | | GET | `/v1/trading/accounts/{id}/account` | Trading-account details (buying power etc.) |
Schema-required: `type` and `time_in_force`. Conditionally required: `symbol`, `side`, and exactly one of `qty`/`notional`.
// notional market buy (dollar-based, fractional)
{ "symbol": "AAPL", "notional": "25.00", "side": "buy", "type": "market", "time_in_force": "day",
"client_order_id": "your-own-uuid" }
// limit qty sell
{ "symbol": "AAPL", "qty": "3", "side": "sell", "type": "limit", "limit_price": "190.00", "time_in_force": "gtc" }| Field | Values / notes | |-------|----------------| | `symbol` | required (except `mleg` multi-leg options) | | `qty` | decimal **string**, up to **9 dp**; fractionable only for `market`+`day` per the order schema | | `notional` | decimal **string**, up to **2 dp**. **Mutually exclusive with `qty`** | | `side` | `buy`, `sell` (plus advanced: `sell_short`, …) | | `type` | `market`, `limit`, `stop`, `stop_limit`, `trailing_stop` | | `time_in_force` | `day`, `gtc`, `opg`, `cls`, `ioc`, `fok` | | `limit_price` / `stop_price` | required for limit/stop variants | | `trail_price` / `trail_percent` | one required for `trailing_stop` | | `extended_hours` | bool; only with `type=limit` and TIF `day`/`gtc` | | `client_order_id` | ≤128 chars; **your idempotency key** (auto-generated if omitted) | | `order_class` | `simple` (default), `bracket`, `oco`, `oto`, `mleg` | | `take_profit` / `stop_loss` | `{limit_price}` / `{stop_price, limit_price?}` for bracket/oco/oto | | `position_intent` | `buy_to_open`, `sell_to_close`, … |
**qty XOR notional (verbatim rule):** pass one or the other — supplying both → `400`. In the response, whichever you didn't use comes back `null`.
`OrderStatus` (the order object's `status`): `new`, `partially_filled`, `filled`, `done_for_day`, `canceled`, `expired`, `replaced`, `pending_cancel`, `pending_replace`, `accepted`, `pending_new`, `accepted_for_bidding`, `stopped`, `rejected`, `suspended`, `calculated`.
> **Order `status` ≠ trade-event `event`.** The order object's `status` is the enum above. The **SSE trade-update stream** reports a *richer* `event` enum that adds operational events with no Broker order status — `trade_bust`, `trade_correct`, `restated`, `order_cancel_rejected`, `order_replace_rejected`. `held` is both: a trade event, and an `OrderStatus` in the **Trading API** enum though not in the Broker one, so don't assume the two enums match. See `alpaca-broker-sse-events`.
**Terminal:** `filled`, `canceled`, `expired`, `rejected` (and `replaced` for the original order). **Everything else is in-flight.**
**Early-state distinctions (these trip people up):**
An order usually reaches `new` directly; `accepted`/`pending_new` are rare intermediates. **Lesson:** treat `new`/`accepted`/`pend
Open agent skills for Alpaca's Trading API and Broker API. Each skill is a SKILL.md file with step-by-step instructions your AI coding assistant follows when you ask it to complete a task, such as running a historical backtest, onboarding Broker API accounts,
Open and manage brokerage accounts via the Alpaca Broker API — account creation, KYC/CIP, identity & disclosures, agreements,…
Move money between an Alpaca brokerage account and the EXTERNAL banking world via the Broker API — ACH relationships, wire…
Entry point for integrating with the Alpaca Broker API (plus Market Data and Trading APIs) in any programming language. Use when…
Move cash (JNLC) and securities (JNLS) BETWEEN accounts inside your own Alpaca omnibus via the Broker API — single, batch, and…
Pull and stream US stock market data from Alpaca — REST snapshots/bars/trades/quotes, historical bars with timeframes and feeds…
Handle money and numeric precision correctly with the Alpaca API — numbers-as-strings on the wire, decimals vs floats,…