Options

Place an option strategy order

post
https://api.snaptrade.com/api/v1/accounts/{accountId}/optionStrategy/{optionStrategyId}/execute

Places the option strategy order and returns the order record received from the brokerage.

Execute an API Request

Path
accountIdstring (format: uuid)required

The ID of the account to execute the strategy in.

optionStrategyIdstring (format: uuid)required

Option strategy id obtained from response when creating option strategy object

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.

  • 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

Trade Price if limit or stop limit order

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

Response fields

object

Strategy order record

strategyobject
statusstring
filled_quantitynumber
open_quantitynumber
closed_quantitynumber
order_typestring or null

Order Type potential values include (but are not limited to) - Limit - Market - StopLimit - Stop

time_in_forcestring

Trade time in force examples:

  • FOK - Fill Or Kill
  • Day - Day
  • GTC - Good Til Canceled
  • GTD - Good Til Date
limit_pricenumber or null

Trade Price if limit or stop limit order

execution_pricenumber or null

Trade Price if limit or stop limit order

time_placedstring

Time

time_updatedstring

Time

1
{
2
"strategy": {
3
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
4
"underlying_symbol_id": {
5
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
6
"symbol": "VAB.TO",
7
"raw_symbol": "VAB",
8
"description": "VANGUARD CDN AGGREGATE BOND INDEX ETF",
9
"currency": {
10
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
11
"code": "USD",
12
"name": "US Dollar"
13
},
14
"exchange": {
15
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
16
"code": "TSX",
17
"mic_code": "XTSE",
18
"name": "Toronto Stock Exchange",
19
"timezone": "America/New_York",
20
"start_time": "09:30:00",
21
"close_time": "16:00:00",
22
"suffix": ".TO"
23
},
24
"type": {
25
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
26
"code": "cs",
27
"description": "Common Stock",
28
"is_supported": true
29
},
30
"figi_code": "BBG000B9XRY4",
31
"figi_instrument": {
32
"figi_code": "BBG000B9Y5X2",
33
"figi_share_class": "BBG001S5N8V8"
34
},
35
"currencies": [
36
{
37
"id": "87b24961-b51e-4db8-9226-f198f6518a89",
38
"code": "USD",
39
"name": "US Dollar"
40
}
41
]
42
},
43
"strategy_type": "BUTTERFLY",
44
"number_of_legs": 2,
45
"legs": [
46
{
47
"option_symbol_id": "AAPLC20221111",
48
"index": 1,
49
"action": "BUY_TO_OPEN",
50
"quantity": 10
51
}
52
]
53
},
54
"status": "PENDING",
55
"filled_quantity": 10,
56
"open_quantity": 10,
57
"closed_quantity": 10,
58
"order_type": "string",
59
"time_in_force": "string",
60
"limit_price": 31.33,
61
"execution_price": 31.33,
62
"time_placed": "2022-01-21T20:11:19.217Z",
63
"time_updated": "2022-01-21T20:11:19.217Z"
64
}