snaptrade-typescript-sdk 11.0.0-canary.1 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -52
- package/dist/browser.umd.js +2 -2
- package/dist/index.cjs +531 -605
- package/dist/index.d.cts +22 -28
- package/dist/index.d.mts +22 -28
- package/dist/index.d.ts +22 -28
- package/dist/index.mjs +531 -605
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
Connect brokerage accounts to your app for live positions and trading
|
|
8
8
|
|
|
9
|
-
[](https://www.npmjs.com/package/snaptrade-typescript-sdk/v/11.0.0)
|
|
10
10
|
[](https://snaptrade.com/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
@@ -124,7 +124,10 @@ yarn add snaptrade-typescript-sdk
|
|
|
124
124
|
## Getting Started<a id="getting-started"></a>
|
|
125
125
|
|
|
126
126
|
```typescript
|
|
127
|
+
// Commercial API key example: registers a SnapTrade user and uses userId/userSecret.
|
|
127
128
|
const { Snaptrade, SnaptradeAuth } = require("snaptrade-typescript-sdk");
|
|
129
|
+
const { randomUUID } = require("crypto");
|
|
130
|
+
const readline = require("readline");
|
|
128
131
|
|
|
129
132
|
async function main() {
|
|
130
133
|
// 1) Initialize a client with your clientID and consumerKey.
|
|
@@ -140,32 +143,51 @@ async function main() {
|
|
|
140
143
|
console.log("status:", status.data);
|
|
141
144
|
|
|
142
145
|
// 3) Create a new user on SnapTrade
|
|
143
|
-
const userId =
|
|
144
|
-
const
|
|
146
|
+
const userId = randomUUID();
|
|
147
|
+
const registerResponse = (
|
|
145
148
|
await snaptrade.authentication.registerSnapTradeUser({
|
|
146
149
|
userId,
|
|
147
150
|
})
|
|
148
151
|
).data;
|
|
152
|
+
console.log("registerResponse:", registerResponse);
|
|
149
153
|
|
|
150
154
|
// Note: A user secret is only generated once. It's required to access
|
|
151
155
|
// resources for certain endpoints.
|
|
152
|
-
|
|
156
|
+
const userSecret = registerResponse.userSecret;
|
|
153
157
|
|
|
154
158
|
// 4) Get a redirect URI. Users will need this to connect
|
|
155
|
-
|
|
159
|
+
// their brokerage to the SnapTrade server.
|
|
160
|
+
const redirectURI = (
|
|
156
161
|
await snaptrade.authentication.loginSnapTradeUser({ userId, userSecret })
|
|
157
162
|
).data;
|
|
158
|
-
|
|
159
|
-
console.log("redirectURI:", data.redirectURI);
|
|
163
|
+
console.log("redirectURI:", redirectURI);
|
|
160
164
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
165
|
+
await waitForEnter(
|
|
166
|
+
"Open the link in your browser. When done logging in, press Enter to continue..."
|
|
167
|
+
);
|
|
168
|
+
|
|
169
|
+
// 5) Get a list of connections
|
|
170
|
+
const connections = (
|
|
171
|
+
await snaptrade.connections.listBrokerageAuthorizations({
|
|
164
172
|
userId,
|
|
165
173
|
userSecret,
|
|
166
174
|
})
|
|
167
175
|
).data;
|
|
168
|
-
console.log("
|
|
176
|
+
console.log("connections:", connections);
|
|
177
|
+
|
|
178
|
+
// 6) Get a list of accounts for the first connection, if available
|
|
179
|
+
if (!Array.isArray(connections) || connections.length === 0) {
|
|
180
|
+
console.log("No brokerage connections found for the user.");
|
|
181
|
+
} else {
|
|
182
|
+
const accounts = (
|
|
183
|
+
await snaptrade.connections.listBrokerageAuthorizationAccounts({
|
|
184
|
+
authorizationId: connections[0].id,
|
|
185
|
+
userId,
|
|
186
|
+
userSecret,
|
|
187
|
+
})
|
|
188
|
+
).data;
|
|
189
|
+
console.log("accounts:", accounts);
|
|
190
|
+
}
|
|
169
191
|
|
|
170
192
|
// 6) Deleting a user
|
|
171
193
|
const deleteResponse = (
|
|
@@ -174,26 +196,17 @@ async function main() {
|
|
|
174
196
|
console.log("deleteResponse:", deleteResponse);
|
|
175
197
|
}
|
|
176
198
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
//Use timestamp until depleted
|
|
189
|
-
r = (d + r) % 16 | 0;
|
|
190
|
-
d = Math.floor(d / 16);
|
|
191
|
-
} else {
|
|
192
|
-
//Use microseconds since page-load if supported
|
|
193
|
-
r = (d2 + r) % 16 | 0;
|
|
194
|
-
d2 = Math.floor(d2 / 16);
|
|
195
|
-
}
|
|
196
|
-
return (c === "x" ? r : (r & 0x3) | 0x8).toString(16);
|
|
199
|
+
function waitForEnter(prompt) {
|
|
200
|
+
const rl = readline.createInterface({
|
|
201
|
+
input: process.stdin,
|
|
202
|
+
output: process.stdout,
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
return new Promise((resolve) => {
|
|
206
|
+
rl.question(prompt, () => {
|
|
207
|
+
rl.close();
|
|
208
|
+
resolve();
|
|
209
|
+
});
|
|
197
210
|
});
|
|
198
211
|
}
|
|
199
212
|
|
|
@@ -250,7 +263,7 @@ An integer that specifies the maximum number of transactions to return. Default
|
|
|
250
263
|
|
|
251
264
|
##### type: `string`<a id="type-string"></a>
|
|
252
265
|
|
|
253
|
-
Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `STOCK_DIVIDEND` - A type of dividend where a company distributes shares instead of cash - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `TAX` - A tax related fee. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event. - `TRANSFER` - Transfer of assets from one account to another. - `SPLIT` - A stock share split.
|
|
266
|
+
Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `STOCK_DIVIDEND` - A type of dividend where a company distributes shares instead of cash - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `TAX` - A tax related fee. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event. - `TRANSFER` - Transfer of assets from one account to another. - `SPLIT` - A stock share split.
|
|
254
267
|
|
|
255
268
|
#### 🔄 Return<a id="🔄-return"></a>
|
|
256
269
|
|
|
@@ -857,7 +870,7 @@ The UUID of the brokerage connection to be reconnected. This parameter should be
|
|
|
857
870
|
|
|
858
871
|
##### connectionType: `string`<a id="connectiontype-string"></a>
|
|
859
872
|
|
|
860
|
-
Determines connection permissions (default: read) - `read`: Data access only. - `trade`: Data and trading access. - `trade-if-available`: Attempts to establish a trading connection if the brokerage supports it, otherwise falls back to read-only access automatically.
|
|
873
|
+
Determines connection permissions (default: read) - `read`: Data access only. - `trade`: Data and trading access. - `trade-if-available`: Attempts to establish a trading connection if the brokerage supports it, otherwise falls back to read-only access automatically.
|
|
861
874
|
|
|
862
875
|
##### showCloseButton: `boolean`<a id="showclosebutton-boolean"></a>
|
|
863
876
|
|
|
@@ -1220,6 +1233,8 @@ Returns a list of session events associated with a user.
|
|
|
1220
1233
|
```typescript
|
|
1221
1234
|
const sessionEventsResponse = await snaptrade.connections.sessionEvents({
|
|
1222
1235
|
partnerClientId: "SNAPTRADETEST",
|
|
1236
|
+
userId:
|
|
1237
|
+
"917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
|
|
1223
1238
|
sessionId:
|
|
1224
1239
|
"917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
|
|
1225
1240
|
});
|
|
@@ -1229,6 +1244,10 @@ const sessionEventsResponse = await snaptrade.connections.sessionEvents({
|
|
|
1229
1244
|
|
|
1230
1245
|
##### partnerClientId: `string`<a id="partnerclientid-string"></a>
|
|
1231
1246
|
|
|
1247
|
+
##### userId: `string`<a id="userid-string"></a>
|
|
1248
|
+
|
|
1249
|
+
Optional comma separated list of user IDs used to filter the request on specific users
|
|
1250
|
+
|
|
1232
1251
|
##### sessionId: `string`<a id="sessionid-string"></a>
|
|
1233
1252
|
|
|
1234
1253
|
Optional comma separated list of session IDs used to filter the request on specific users
|
|
@@ -1504,7 +1523,7 @@ const listSubscriptionsResponse =
|
|
|
1504
1523
|
|
|
1505
1524
|
Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions).
|
|
1506
1525
|
|
|
1507
|
-
This endpoint is
|
|
1526
|
+
This endpoint is deprecated. Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures.
|
|
1508
1527
|
|
|
1509
1528
|
Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access:
|
|
1510
1529
|
- If you do, this endpoint returns real-time data.
|
|
@@ -2022,7 +2041,7 @@ The type of order to place.
|
|
|
2022
2041
|
|
|
2023
2042
|
##### time_in_force: [`TimeInForceStrict`](./models/time-in-force-strict.ts)<a id="time_in_force-timeinforcestrictmodelstime-in-force-strictts"></a>
|
|
2024
2043
|
|
|
2025
|
-
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.
|
|
2044
|
+
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.
|
|
2026
2045
|
|
|
2027
2046
|
##### legs: [`MlegLeg`](./models/mleg-leg.ts)[]<a id="legs-mleglegmodelsmleg-legts"></a>
|
|
2028
2047
|
|
|
@@ -2086,11 +2105,11 @@ Unique identifier for the symbol within SnapTrade. This is the ID used to refere
|
|
|
2086
2105
|
|
|
2087
2106
|
##### order_type: [`OrderTypeStrict`](./models/order-type-strict.ts)<a id="order_type-ordertypestrictmodelsorder-type-strictts"></a>
|
|
2088
2107
|
|
|
2089
|
-
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.
|
|
2108
|
+
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.
|
|
2090
2109
|
|
|
2091
2110
|
##### time_in_force: [`TimeInForceStrict`](./models/time-in-force-strict.ts)<a id="time_in_force-timeinforcestrictmodelstime-in-force-strictts"></a>
|
|
2092
2111
|
|
|
2093
|
-
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.
|
|
2112
|
+
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.
|
|
2094
2113
|
|
|
2095
2114
|
##### price: `number`<a id="price-number"></a>
|
|
2096
2115
|
|
|
@@ -2245,11 +2264,11 @@ The action describes the intent or side of a trade. This is either `BUY` or `SEL
|
|
|
2245
2264
|
|
|
2246
2265
|
##### order_type: [`OrderTypeStrict`](./models/order-type-strict.ts)<a id="order_type-ordertypestrictmodelsorder-type-strictts"></a>
|
|
2247
2266
|
|
|
2248
|
-
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.
|
|
2267
|
+
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.
|
|
2249
2268
|
|
|
2250
2269
|
##### time_in_force: [`TimeInForceStrict`](./models/time-in-force-strict.ts)<a id="time_in_force-timeinforcestrictmodelstime-in-force-strictts"></a>
|
|
2251
2270
|
|
|
2252
|
-
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.
|
|
2271
|
+
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.
|
|
2253
2272
|
|
|
2254
2273
|
##### stop_loss: [`StopLoss`](./models/stop-loss.ts)<a id="stop_loss-stoplossmodelsstop-lossts"></a>
|
|
2255
2274
|
|
|
@@ -2324,11 +2343,11 @@ const placeComplexOrderResponse = await snaptrade.trading.placeComplexOrder({
|
|
|
2324
2343
|
|
|
2325
2344
|
##### type: `string`<a id="type-string"></a>
|
|
2326
2345
|
|
|
2327
|
-
The complex order type. - `OCO`: One Cancels the Other — two peer orders. - `OTO`: One Triggers the Other — a trigger order and a conditional order. - `OTOCO`: One Triggers a One Cancels the Other — a trigger order and two peer orders.
|
|
2346
|
+
The complex order type. - `OCO`: One Cancels the Other — two peer orders. - `OTO`: One Triggers the Other — a trigger order and a conditional order. - `OTOCO`: One Triggers a One Cancels the Other — a trigger order and two peer orders.
|
|
2328
2347
|
|
|
2329
2348
|
##### orders: [`ComplexOrderLeg`](./models/complex-order-leg.ts)[]<a id="orders-complexorderlegmodelscomplex-order-legts"></a>
|
|
2330
2349
|
|
|
2331
|
-
The orders that make up the complex order. Required counts and roles per type: - `OCO`: exactly 2 orders, both `PEER` - `OTO`: exactly 2 orders, one `TRIGGER` and one `CONDITIONAL` - `OTOCO`: exactly 3 orders, one `TRIGGER` and two `PEER`
|
|
2350
|
+
The orders that make up the complex order. Required counts and roles per type: - `OCO`: exactly 2 orders, both `PEER` - `OTO`: exactly 2 orders, one `TRIGGER` and one `CONDITIONAL` - `OTOCO`: exactly 3 orders, one `TRIGGER` and two `PEER`
|
|
2332
2351
|
|
|
2333
2352
|
##### accountId: `string`<a id="accountid-string"></a>
|
|
2334
2353
|
|
|
@@ -2389,7 +2408,7 @@ The type of order to place.
|
|
|
2389
2408
|
|
|
2390
2409
|
##### time_in_force: `string`<a id="time_in_force-string"></a>
|
|
2391
2410
|
|
|
2392
|
-
The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. - `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.
|
|
2411
|
+
The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. - `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.
|
|
2393
2412
|
|
|
2394
2413
|
##### amount: `string`<a id="amount-string"></a>
|
|
2395
2414
|
|
|
@@ -2407,7 +2426,7 @@ The stop price. Required if the order type is `STOP_LOSS_MARKET`, `STOP_LOSS_LIM
|
|
|
2407
2426
|
|
|
2408
2427
|
##### post_only: `boolean`<a id="post_only-boolean"></a>
|
|
2409
2428
|
|
|
2410
|
-
Valid and required only for order type `LIMIT`. If true orders that would be filled immediately are rejected to avoid incurring TAKER fees.
|
|
2429
|
+
Valid and required only for order type `LIMIT`. If true orders that would be filled immediately are rejected to avoid incurring TAKER fees.
|
|
2411
2430
|
|
|
2412
2431
|
##### expiration_date: `string`<a id="expiration_date-string"></a>
|
|
2413
2432
|
|
|
@@ -2466,11 +2485,11 @@ The action describes the intent or side of a trade. This is either `BUY` or `SEL
|
|
|
2466
2485
|
|
|
2467
2486
|
##### order_type: [`OrderTypeStrict`](./models/order-type-strict.ts)<a id="order_type-ordertypestrictmodelsorder-type-strictts"></a>
|
|
2468
2487
|
|
|
2469
|
-
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.
|
|
2488
|
+
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.
|
|
2470
2489
|
|
|
2471
2490
|
##### time_in_force: [`ManualTradePlaceTimeInForceStrict`](./models/manual-trade-place-time-in-force-strict.ts)<a id="time_in_force-manualtradeplacetimeinforcestrictmodelsmanual-trade-place-time-in-force-strictts"></a>
|
|
2472
2491
|
|
|
2473
|
-
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. - `GTD` - Good Til Date. The order is valid until `expiry_date`, which is required. Not available for market orders. GTD orders are only available on certain brokerages. Visit https://support.snaptrade.com/brokerages for brokerage support.
|
|
2492
|
+
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. - `GTD` - Good Til Date. The order is valid until `expiry_date`, which is required. Not available for market orders. GTD orders are only available on certain brokerages. Visit https://support.snaptrade.com/brokerages for brokerage support.
|
|
2474
2493
|
|
|
2475
2494
|
##### universal_symbol_id: [`string`](./models/model-string.ts)<a id="universal_symbol_id-stringmodelsmodel-stringts"></a>
|
|
2476
2495
|
|
|
@@ -2482,7 +2501,7 @@ The security\\\'s trading ticker symbol. If \\\'symbol\\\' is provided, then \\\
|
|
|
2482
2501
|
|
|
2483
2502
|
##### trading_session: [`TradingSession`](./models/trading-session.ts)<a id="trading_session-tradingsessionmodelstrading-sessionts"></a>
|
|
2484
2503
|
|
|
2485
|
-
The trading session for the order. This field indicates which market session the order will be placed in. This is only available for certain brokerages. Defaults to REGULAR. Here are the supported values: - `REGULAR` - Regular trading hours. - `EXTENDED` - Extended trading hours.
|
|
2504
|
+
The trading session for the order. This field indicates which market session the order will be placed in. This is only available for certain brokerages. Defaults to REGULAR. Here are the supported values: - `REGULAR` - Regular trading hours. - `EXTENDED` - Extended trading hours.
|
|
2486
2505
|
|
|
2487
2506
|
##### expiry_date: `string`<a id="expiry_date-string"></a>
|
|
2488
2507
|
|
|
@@ -2553,7 +2572,7 @@ The type of order to place.
|
|
|
2553
2572
|
|
|
2554
2573
|
##### time_in_force: [`TimeInForceStrict`](./models/time-in-force-strict.ts)<a id="time_in_force-timeinforcestrictmodelstime-in-force-strictts"></a>
|
|
2555
2574
|
|
|
2556
|
-
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.
|
|
2575
|
+
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.
|
|
2557
2576
|
|
|
2558
2577
|
##### legs: [`MlegLeg`](./models/mleg-leg.ts)[]<a id="legs-mleglegmodelsmleg-legts"></a>
|
|
2559
2578
|
|
|
@@ -2660,7 +2679,7 @@ The type of order to place.
|
|
|
2660
2679
|
|
|
2661
2680
|
##### time_in_force: `string`<a id="time_in_force-string"></a>
|
|
2662
2681
|
|
|
2663
|
-
The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. - `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.
|
|
2682
|
+
The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. - `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.
|
|
2664
2683
|
|
|
2665
2684
|
##### amount: `string`<a id="amount-string"></a>
|
|
2666
2685
|
|
|
@@ -2678,7 +2697,7 @@ The stop price. Required if the order type is `STOP_LOSS_MARKET`, `STOP_LOSS_LIM
|
|
|
2678
2697
|
|
|
2679
2698
|
##### post_only: `boolean`<a id="post_only-boolean"></a>
|
|
2680
2699
|
|
|
2681
|
-
Valid and required only for order type `LIMIT`. If true orders that would be filled immediately are rejected to avoid incurring TAKER fees.
|
|
2700
|
+
Valid and required only for order type `LIMIT`. If true orders that would be filled immediately are rejected to avoid incurring TAKER fees.
|
|
2682
2701
|
|
|
2683
2702
|
##### expiration_date: `string`<a id="expiration_date-string"></a>
|
|
2684
2703
|
|
|
@@ -2732,11 +2751,11 @@ The action describes the intent or side of a trade. This is either `BUY` or `SEL
|
|
|
2732
2751
|
|
|
2733
2752
|
##### order_type: [`OrderTypeStrict`](./models/order-type-strict.ts)<a id="order_type-ordertypestrictmodelsorder-type-strictts"></a>
|
|
2734
2753
|
|
|
2735
|
-
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.
|
|
2754
|
+
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.
|
|
2736
2755
|
|
|
2737
2756
|
##### time_in_force: [`TimeInForceStrict`](./models/time-in-force-strict.ts)<a id="time_in_force-timeinforcestrictmodelstime-in-force-strictts"></a>
|
|
2738
2757
|
|
|
2739
|
-
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.
|
|
2758
|
+
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.
|
|
2740
2759
|
|
|
2741
2760
|
##### accountId: `string`<a id="accountid-string"></a>
|
|
2742
2761
|
|
|
@@ -2855,7 +2874,7 @@ Optional comma separated list of SnapTrade Connection (Brokerage Authorization)
|
|
|
2855
2874
|
|
|
2856
2875
|
##### type: `string`<a id="type-string"></a>
|
|
2857
2876
|
|
|
2858
|
-
Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event. - `TRANSFER` - Transfer of assets from one account to another
|
|
2877
|
+
Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event. - `TRANSFER` - Transfer of assets from one account to another
|
|
2859
2878
|
|
|
2860
2879
|
#### 🔄 Return<a id="🔄-return"></a>
|
|
2861
2880
|
|