The Orders API allows a user to monitor, place and cancel their orders with Alpaca.
Each order has a unique identifier provided by the client. This client-side unique order ID will be automatically generated by the system if not provided by the client, and will be returned as part of the order object along with the rest of the fields described below. Once an order is placed, it can be queried using the client-side order ID to check the status. Updates on open orders at Alpaca will also be sent over the streaming interface, which is the recommended method of maintaining order state.
For further details on order functionality, please see the Trading On Alpaca - Orders page.
Please note that body parameters should be passed using a JSON encoded body.
Sample Order Object
{
"id": "61e69015-8549-4bfd-b9c3-01e75843f47d",
"client_order_id": "eb9e2aaa-f71a-4f51-b5b4-52a6c565dad4",
"created_at": "2021-03-16T18:38:01.942282Z",
"updated_at": "2021-03-16T18:38:01.942282Z",
"submitted_at": "2021-03-16T18:38:01.937734Z",
"filled_at": null,
"expired_at": null,
"canceled_at": null,
"failed_at": null,
"replaced_at": null,
"replaced_by": null,
"replaces": null,
"asset_id": "b0b6dd9d-8b9b-48a9-ba46-b9d54906e415",
"symbol": "AAPL",
"asset_class": "us_equity",
"notional": "500",
"qty": null,
"filled_qty": "0",
"filled_avg_price": null,
"order_class": "",
"order_type": "market",
"type": "market",
"side": "buy",
"time_in_force": "day",
"limit_price": null,
"stop_price": null,
"status": "accepted",
"extended_hours": false,
"legs": null,
"trail_percent": null,
"trail_price": null,
"hwm": null
}
Properties
Attribute | Type | Description |
---|---|---|
id | string | The order_id |
client_order_id | string | Each order has a unique identifier provided by you, otherwise automatically generated by the system if not provided. client_order_id will be returned as part of the order object along with the rest of the fields described below. |
created_at | string (Nullable) | Timestamp when the order was created |
updated_at | string (Nullable) | Timestamp when the order was updated, if updated |
submitted_at | string (Nullable) | Timestamp when the order was submitted |
filled_at | string (Nullable) | Timestamp when the order was filled |
expired_at | string (Nullable) | Timestamp when the order was expired, if expired |
canceled_at | string (Nullable) | Timestamp when the order was canceled, if canceled |
failed_at | string (Nullable) | Timestamp when the order failed, if failed |
replaced_at | string (Nullable) | Timestamp when the order was replaced, if replaced |
replaced_by | string (Nullable) | The order_id that this order was replaced by |
replaces | string (Nullable) | The order_id that this order replaces |
asset_id | string | The asset_id for the asset traded |
symbol | string | The symbol for the asset traded |
asset_class | string | The asset_class for the asset traded. Can either be us_equity or crypto |
notional | string | Ordered notional amount. If entered, qty will be null. Can take up to 9 decimal points |
qty | string | Ordered quantity. If entered, notional will be null. Can take up to 9 decimal points |
filled_qty | string | Filled quantity. Filled orders will always have a filled_quantity populated |
filled_avg_price | string (Nullable) | The average price per share at which the order was filled |
order_class | string | Valid values are simple , bracket , oco or oto . For details of non-simple order classes, please see Bracket Order Overview |
order_type | string | DEPRECATED and replaced by type below |
type | string | Valid values are market , limit , stop , stop_limit , trailing_stop |
side | string | Valid values are either buy or sell |
time_in_force | string | Valid values are day , gtc , ... |
limit_price | string (Nullable) | Limit price |
stop_price | string (Nullable) | Stop price |
status | string | Order status |
extended_hours | boolean | If true , eligible for execution outside regular trading hours. |
legs | array | When querying non-simple order_class orders in a nested style, an array of Order entities associated with this order. Otherwise, null. |
trail_percent | string | The percent value away from the high water mark for trailing stop orders. |
trail_price | string | The dollar value away from the high water mark for trailing stop orders. |
hwm | string | The highest (lowest) market price seen since the trailing stop order was submitted. |