Trading

Cancel an order.

post
https://api.snaptrade.com/api/v1/accounts/{accountId}/trading/simple/{brokerageOrderId}/cancel

Cancels an order in the specified account.

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.

brokerageOrderIdstringrequired

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

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.

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.

orderobject

Describes a single recent order in an account. Each record here represents a single order leg. For multi-leg orders, there will be multiple records.

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