Trading

Place multi-leg option order

post
https://api.snaptrade.com/api/v1/accounts/{accountId}/trading/options

Places a multi-leg option order. Only supported on certain option trading brokerages. https://snaptrade.notion.site/brokerages has information on brokerage trading support

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
order_typestringrequired

The type of order to place.

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.
  • IOC - Immediate Or Cancel. The order must be executed immediately. Any portion of the order that cannot be filled immediately will be canceled.
limit_pricestring (format: decimal) or null

The limit price. Required if the order type is LIMIT, STOP_LOSS_LIMIT.

stop_pricestring (format: decimal) or null

The stop price. Required if the order type is STOP_LOSS_MARKET, STOP_LOSS_LIMIT.

price_effectstring or null

The desired price_effect for LIMIT and STOP_LOSS_LIMIT orders. Only required for certain brokerages like ETrade. - CREDIT - DEBIT

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

Response fields

object
brokerage_order_idstring

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

ordersarray of objects
1
{
2
"brokerage_order_id": "66a033fa-da74-4fcf-b527-feefdec9257e",
3
"orders": [
4
{
5
"brokerage_order_id": "66a033fa-da74-4fcf-b527-feefdec9257e",
6
"status": "NONE",
7
"universal_symbol": {
8
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
9
"symbol": "VAB.TO",
10
"raw_symbol": "VAB",
11
"description": "VANGUARD CDN AGGREGATE BOND INDEX ETF",
12
"currency": {
13
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
14
"code": "USD",
15
"name": "US Dollar"
16
},
17
"exchange": {
18
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
19
"code": "TSX",
20
"mic_code": "XTSE",
21
"name": "Toronto Stock Exchange",
22
"timezone": "America/New_York",
23
"start_time": "09:30:00",
24
"close_time": "16:00:00",
25
"suffix": ".TO"
26
},
27
"type": {
28
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
29
"code": "cs",
30
"description": "Common Stock",
31
"is_supported": true
32
},
33
"figi_code": "BBG000B9XRY4",
34
"figi_instrument": {
35
"figi_code": "BBG000B9Y5X2",
36
"figi_share_class": "BBG001S5N8V8"
37
},
38
"currencies": [
39
{
40
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
41
"code": "USD",
42
"name": "US Dollar"
43
}
44
]
45
},
46
"option_symbol": {
47
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
48
"ticker": "AAPL 261218C00240000",
49
"option_type": "CALL",
50
"strike_price": 240,
51
"expiration_date": "2026-12-18",
52
"is_mini_option": false,
53
"underlying_symbol": {
54
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
55
"symbol": "SPY",
56
"raw_symbol": "VAB",
57
"description": "SPDR S&P 500 ETF Trust",
58
"currency": {
59
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
60
"code": "USD",
61
"name": "US Dollar"
62
},
63
"exchange": {
64
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
65
"code": "ARCX",
66
"mic_code": "ARCA",
67
"name": "NYSE ARCA",
68
"timezone": "America/New_York",
69
"start_time": "09:30:00",
70
"close_time": "16:00:00",
71
"suffix": "None",
72
"allows_cryptocurrency_symbols": false
73
},
74
"type": {
75
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
76
"code": "cs",
77
"description": "Common Stock",
78
"is_supported": true
79
},
80
"figi_code": "BBG000B9XRY4",
81
"figi_instrument": {
82
"figi_code": "BBG000B9Y5X2",
83
"figi_share_class": "BBG001S5N8V8"
84
},
85
"currencies": [
86
{
87
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
88
"code": "USD",
89
"name": "US Dollar"
90
}
91
]
92
}
93
},
94
"quote_universal_symbol": {
95
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
96
"symbol": "VAB.TO",
97
"raw_symbol": "VAB",
98
"description": "VANGUARD CDN AGGREGATE BOND INDEX ETF",
99
"currency": {
100
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
101
"code": "USD",
102
"name": "US Dollar"
103
},
104
"exchange": {
105
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
106
"code": "TSX",
107
"mic_code": "XTSE",
108
"name": "Toronto Stock Exchange",
109
"timezone": "America/New_York",
110
"start_time": "09:30:00",
111
"close_time": "16:00:00",
112
"suffix": ".TO"
113
},
114
"type": {
115
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
116
"code": "cs",
117
"description": "Common Stock",
118
"is_supported": true
119
},
120
"figi_code": "BBG000B9XRY4",
121
"figi_instrument": {
122
"figi_code": "BBG000B9Y5X2",
123
"figi_share_class": "BBG001S5N8V8"
124
},
125
"currencies": [
126
{
127
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
128
"code": "USD",
129
"name": "US Dollar"
130
}
131
]
132
},
133
"quote_currency": {
134
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
135
"code": "USD",
136
"name": "US Dollar"
137
},
138
"action": "string",
139
"total_quantity": 100,
140
"open_quantity": 10,
141
"canceled_quantity": 10,
142
"filled_quantity": 80,
143
"execution_price": 12.34,
144
"limit_price": 12.34,
145
"stop_price": 12.5,
146
"order_type": "Market",
147
"time_in_force": "string",
148
"time_placed": "2024-07-30T22:51:49.746Z",
149
"time_updated": "2024-08-05T00:05:57.409Z",
150
"time_executed": "2024-08-05T00:05:57.409Z",
151
"expiry_date": "2024-08-05T00:05:57.409Z",
152
"symbol": "2bcd7cc3-e922-4976-bce1-9858296801c3",
153
"child_brokerage_order_ids": {
154
"take_profit_order_id": "12345678",
155
"stop_loss_order_id": "12345678"
156
}
157
}
158
]
159
}