Trading

Check order impact

post
https://api.snaptrade.com/api/v1/trade/impact

Simulates an order and its impact on the account. This endpoint does not place the order with the brokerage. If successful, it returns a Trade object and the ID of the object can be used to place the order with the brokerage using the place checked order endpoint. Please note that the Trade object returned expires after 5 minutes. Any order placed using an expired Trade will be rejected.

Execute an API Request

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
account_idstring (format: uuid)required

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

actionstringrequired

The action describes the intent or side of a trade. This is either BUY or SELL.

universal_symbol_idstring (format: uuid)required

Unique identifier for the symbol within SnapTrade. This is the ID used to reference the symbol in SnapTrade API calls.

order_typestringrequired

The type of order to place.

  • For Limit and StopLimit orders, the price field is required.
  • For Stop and StopLimit orders, the stop field is required.
time_in_forcestringrequired

The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values:

  • 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.
pricenumber or null

The limit price for Limit and StopLimit orders.

stopnumber or null

The price at which a stop order is triggered for Stop and StopLimit orders.

unitsnumber or null

Number of shares for the order. This can be a decimal for fractional orders. Must be null if notional_value is provided.

notional_value or null

Total notional amount for the order. Must be null if units is provided. Can only work with Market for order_type and Day for time_in_force. This is only available for certain brokerages. Please check the integrations doc for more information.

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

Response fields

object
tradeobject

Contains the details of a submitted order.

trade_impactsarray of objects

List of impacts of the trade on the account. The list always contains one value at the moment.

combined_remaining_balanceobject

Estimated remaining balance of the account after the trade is executed.

1
{
2
"trade": {
3
"id": "139e307a-82f7-4402-b39e-4da7baa87758",
4
"account": "917c8734-8470-4a3e-a18f-57c3f2ee6631",
5
"order_type": "Market",
6
"time_in_force": "FOK",
7
"symbol": {
8
"universal_symbol_id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
9
"currency": {
10
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
11
"code": "USD",
12
"name": "US Dollar"
13
},
14
"local_id": "1048101",
15
"description": "Metaverse Global ETF",
16
"symbol": "MVGP.U.TO",
17
"brokerage_symbol_id": "2bcd7cc3-e922-4976-bce1-9858296801c3"
18
},
19
"action": "BUY",
20
"units": 10.5,
21
"price": 31.33
22
},
23
"trade_impacts": [
24
{
25
"account": "917c8734-8470-4a3e-a18f-57c3f2ee6631",
26
"currency": "87b24961-b51e-4db8-9226-f198f6518a89",
27
"remaining_cash": 1.11,
28
"estimated_commission": 3.26,
29
"forex_fees": 5.26
30
}
31
],
32
"combined_remaining_balance": {
33
"account": {
34
"id": "917c8734-8470-4a3e-a18f-57c3f2ee6631",
35
"name": "Robinhood Individual",
36
"number": "Q6542138443",
37
"sync_status": {
38
"transactions": {
39
"initial_sync_completed": true,
40
"last_successful_sync": "2022-01-24",
41
"first_transaction_date": "2022-01-24"
42
},
43
"holdings": {
44
"initial_sync_completed": true,
45
"last_successful_sync": "2024-06-28 18:42:46.561408+00:00"
46
}
47
}
48
},
49
"currency": {
50
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
51
"code": "USD",
52
"name": "US Dollar"
53
},
54
"cash": 1.11
55
}
56
}