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.
Experimental endpoints

Get account order detail (V2)

BETA
get
https://api.snaptrade.com/accounts/{accountId}/orders/details/v2/{brokerageOrderId}

Returns the detail of a single order using the brokerage order ID provided as a path parameter.

The V2 order response format includes all legs of the order in the legs list field. If the order is single legged, legs will be a list of one leg.

This endpoint is always realtime and does not rely on cached data.

This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.

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.

brokerageOrderIdstringrequired

Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.

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.experimentalEndpoints.getUserAccountOrderDetailV2(
15
{
16
accountId:
17
"917c8734-8470-4a3e-a18f-57c3f2ee6631",
18
brokerageOrderId:
19
"66a033fa-da74-4fcf-b527-feefdec9257e",
20
userId: "USER_ID",
21
userSecret: "USER_SECRET",
22
},
23
);
24
console.log(response.data);

Response fields

object

Describes a single order in the standardized V2 format.

Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.

The brokerage-assigned identifier that links all orders within a complex order (OCO, OTO, OTOCO) together. Null for non-complex orders or when the brokerage does not return a group identifier.

order_rolestring or null

The role of this order within a complex order group (OCO, OTO, OTOCO). Null for non-complex orders.

statusstring

Indicates the status of an order. SnapTrade does a best effort to map brokerage statuses to statuses in this enum. Possible values include:

  • NONE
  • PENDING
  • ACCEPTED
  • FAILED
  • REJECTED
  • CANCELED
  • PARTIAL_CANCELED
  • CANCEL_PENDING
  • EXECUTED
  • PARTIAL
  • REPLACE_PENDING
  • REPLACED
  • EXPIRED
  • QUEUED
  • TRIGGERED
  • ACTIVATED
order_typestring or null

The type of order placed.

  • MARKET
  • LIMIT
  • STOP
  • STOP_LIMIT

The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. We try our best to map brokerage time in force values to the following. When mapping fails, we will return the brokerage's time in force value.

  • DAY - Day. The order is valid only for the trading day on which it is placed.
  • GTC - Good Til Canceled. The order is valid until it is executed or canceled.
  • FOK - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely.
  • IOC - Immediate Or Cancel. The order must be executed immediately. Any portion of the order that cannot be filled immediately will be canceled.
  • GTD - Good Til Date. The order is valid until the specified date.
  • MOO - Market On Open. The order is to be executed at the day's opening price.
  • EHP - Extended Hours P.M. The order is to be placed during extended hour trading, after markets close.
time_placedstring (format: date-time)

The time the order was placed. This is the time the order was submitted to the brokerage.

time_executedstring (format: date-time) or null

The time the order was executed in the brokerage system. This value is not always available from the brokerage.

Price currency code for the order.

Direction of the net order price. CREDIT means cash is received, DEBIT means cash is paid, EVEN means the net price is zero, and UNKNOWN means the direction could not be determined.

execution_pricestring (format: decimal) or null

The price at which the order was executed.

limit_pricestring (format: decimal) or null

The limit price is maximum price one is willing to pay for a buy order or the minimum price one is willing to accept for a sell order. Should only apply to Limit and StopLimit orders.

stop_pricestring (format: decimal) or null

The stop price is the price at which a stop order is triggered. Should only apply to Stop and StopLimit orders.

trailing_stopobject or null

For trailing stop orders, contains the trail configuration. Null for all other order types.

legsarray of objects

List of legs that make up the order.

1
{
2
"brokerage_order_id": "66a033fa-da74-4fcf-b527-feefdec9257e",
3
"brokerage_group_order_id": "1234567890",
4
"order_role": "TRIGGER",
5
"status": "NONE",
6
"order_type": "MARKET",
7
"time_in_force": "DAY",
8
"time_placed": "2024-07-30T22:51:49.746Z",
9
"time_executed": "2024-08-05T00:05:57.409Z",
10
"price_currency": "USD",
11
"price_effect": "CREDIT",
12
"execution_price": "12.34",
13
"limit_price": "12.34",
14
"stop_price": "12.50",
15
"trailing_stop": {
16
"amount": "0.60",
17
"type": "DOLLAR"
18
},
19
"legs": [
20
{
21
"leg_id": "string",
22
"instrument": {
23
"symbol": "AAPL",
24
"description": "Apple Inc.",
25
"asset_type": "EQUITY",
26
"exchange_mic_code": "XNAS",
27
"figi_code": "BBG000B9XRY4"
28
},
29
"action": "string",
30
"execution_price": "12.34",
31
"total_quantity": "10",
32
"canceled_quantity": "1",
33
"filled_quantity": "9",
34
"status": "PENDING"
35
}
36
]
37
}