Experimental endpoints

Get account order detail (V2)

post
https://api.snaptrade.com/api/v1/accounts/{accountId}/orders/details/v2

Returns the detail of a single order using the external order ID provided in the request body.

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

Path
accountIdstring (format: uuid)required

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

Query
userIdstringrequired

SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable.

userSecretstringrequired

SnapTrade User Secret. This is a randomly generated string and should be stored securely. If compromised, please rotate it via the rotate user secret endpoint.

Request Body
brokerage_order_idstringrequired

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

Authorization
Request
Installation
$
npm install snaptrade-typescript-sdk
1
Loading...

Response fields

object

Describes a single order in the standardized V2 format.

brokerage_order_idstring

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

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
time_in_forcestring

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.

quote_currencystring

Quote currency code for the order.

execution_pricenumber or null

The price at which the order was executed.

limit_pricenumber 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_pricenumber or null

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

legsarray of objects

List of legs that make up the order.

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