For AI agents: the documentation index is available at https://docs.snaptrade.com/llms.txt, and the comprehensive documentation index is available at https://docs.snaptrade.com/llms-full.txt. The complete public OpenAPI specification is available at https://docs.snaptrade.com/openapi.yaml. Complete public OpenAPI specification with all documented operations, schemas, servers, and authentication requirements. Use it for SDK generation and API tooling; beta operations are marked x-beta. Markdown versions of documentation pages are available by appending .md to the URL path.
Account Information

List all account orders

BETA
get
https://api.snaptrade.com/accounts/{accountId}/orders/all

Returns a list of recent orders in the specified account, in the same kind-discriminated format as /accounts/{accountId}/positions/all.

Every order carries a legs list with at least one leg. Each leg's instrument uses the same Instrument union as positions; switch on instrument.kind to know which fields are present. Multi-leg orders (spreads, strangles, covered calls) are a single order with multiple legs. Orders that belong to a complex order group (OCO, OTO, OTOCO) share a group.id.

order_type is an object discriminated by kind. Each kind declares the price fields it requires (limit_price on limit, stop_price on stop, both on stop_limit, trail on trailing_stop), so a consumer never has to null-check a price that cannot exist for that kind. When the brokerage reports an order type we cannot normalize, kind is other and the brokerage's own label is in raw_type.

Beta: this endpoint and its response schema may change.

If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see this guide on how to fix a disabled connection.

Execute an API Request

Authentication Method

Use commercial authentication when acting on behalf of your application and passing end-user credentials with requests that require them.

Credentials
Path
accountIdstring (format: uuid)required

Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.

Query
statestring

defaults to "all"

daysinteger (format: int32)

Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in. Values greater than 90 will be capped at 90.

Request
Installation
$
npm install snaptrade-typescript-sdk
1
import {
2
Snaptrade,
3
SnaptradeAuth,
4
} from "snaptrade-typescript-sdk";
5
6
const snaptrade = new Snaptrade({
7
auth: SnaptradeAuth.commercialApiKey({
8
consumerKey: "CONSUMER_KEY",
9
clientId: "CLIENT_ID",
10
}),
11
});
12
13
const response =
14
await snaptrade.accountInformation.getAllAccountOrders(
15
{
16
accountId:
17
"917c8734-8470-4a3e-a18f-57c3f2ee6631",
18
days: 30,
19
userId: "USER_ID",
20
userSecret: "USER_SECRET",
21
},
22
);
23
console.log(response.data);

Response fields

object

A list of account orders together with the freshness of the returned data.

resultsarray of objects

Orders returned for the request.

Metadata describing freshness of the returned orders data.

1
{
2
"results": [
3
{
4
"brokerage_order_id": "66a033fa-da74-4fcf-b527-feefdec9257e",
5
"status": "PENDING",
6
"order_type": {
7
"kind": "market"
8
},
9
"time_in_force": "DAY",
10
"expiry_date": "2026-07-30T22:51:49Z",
11
"priced_in": {
12
"kind": "cash",
13
"code": "EUR"
14
},
15
"price_effect": "CREDIT",
16
"total_quantity": "10",
17
"filled_quantity": "9",
18
"canceled_quantity": "1",
19
"open_quantity": "0",
20
"execution_price": "12.34",
21
"time_placed": "2026-07-30T22:51:49Z",
22
"time_updated": "2026-07-30T22:52:10Z",
23
"time_executed": "2026-08-05T00:05:57Z",
24
"group": {
25
"id": "1234567890",
26
"role": "TRIGGER"
27
},
28
"legs": [
29
{
30
"leg_id": "string",
31
"instrument": {
32
"kind": "stock",
33
"id": "1ef3a5d3-4a9b-40b2-b8d1-cc35f74d6324",
34
"symbol": "AAPL",
35
"raw_symbol": "AAPL",
36
"description": "Apple Inc.",
37
"currency": "USD",
38
"exchange": "XNAS",
39
"figi_instrument": {
40
"figi_code": "BBG000B9Y5X2",
41
"figi_share_class": "BBG001S5N8V8"
42
}
43
},
44
"action": "string",
45
"total_quantity": "10",
46
"filled_quantity": "9",
47
"canceled_quantity": "1",
48
"execution_price": "12.34",
49
"status": "PENDING"
50
}
51
]
52
}
53
],
54
"data_freshness": {
55
"as_of": "2026-06-02T14:30:00Z"
56
}
57
}