snaptrade-typescript-sdk 11.1.0 → 12.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 +1 -538
- package/dist/browser.umd.js +1 -1
- package/dist/index.cjs +158 -1784
- package/dist/index.d.cts +58 -898
- package/dist/index.d.mts +58 -898
- package/dist/index.d.ts +58 -898
- package/dist/index.mjs +97 -1710
- package/package.json +1 -1
- package/dist/chunk-e9Ob2GDo.mjs +0 -26
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/12.0.0)
|
|
10
10
|
[](https://snaptrade.com/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
@@ -21,12 +21,10 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
21
21
|
* [`snaptrade.accountInformation.getAccountActivities`](#snaptradeaccountinformationgetaccountactivities)
|
|
22
22
|
* [`snaptrade.accountInformation.getAccountBalanceHistory`](#snaptradeaccountinformationgetaccountbalancehistory)
|
|
23
23
|
* [`snaptrade.accountInformation.getAllAccountPositions`](#snaptradeaccountinformationgetallaccountpositions)
|
|
24
|
-
* [`snaptrade.accountInformation.getAllUserHoldings`](#snaptradeaccountinformationgetalluserholdings)
|
|
25
24
|
* [`snaptrade.accountInformation.getUserAccountBalance`](#snaptradeaccountinformationgetuseraccountbalance)
|
|
26
25
|
* [`snaptrade.accountInformation.getUserAccountDetails`](#snaptradeaccountinformationgetuseraccountdetails)
|
|
27
26
|
* [`snaptrade.accountInformation.getUserAccountOrderDetail`](#snaptradeaccountinformationgetuseraccountorderdetail)
|
|
28
27
|
* [`snaptrade.accountInformation.getUserAccountOrders`](#snaptradeaccountinformationgetuseraccountorders)
|
|
29
|
-
* [`snaptrade.accountInformation.getUserAccountPositions`](#snaptradeaccountinformationgetuseraccountpositions)
|
|
30
28
|
* [`snaptrade.accountInformation.getUserAccountRecentOrders`](#snaptradeaccountinformationgetuseraccountrecentorders)
|
|
31
29
|
* [`snaptrade.accountInformation.getUserAccountReturnRates`](#snaptradeaccountinformationgetuseraccountreturnrates)
|
|
32
30
|
* [`snaptrade.accountInformation.getUserHoldings`](#snaptradeaccountinformationgetuserholdings)
|
|
@@ -44,9 +42,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
44
42
|
* [`snaptrade.connections.listBrokerageAuthorizationAccounts`](#snaptradeconnectionslistbrokerageauthorizationaccounts)
|
|
45
43
|
* [`snaptrade.connections.listBrokerageAuthorizations`](#snaptradeconnectionslistbrokerageauthorizations)
|
|
46
44
|
* [`snaptrade.connections.refreshBrokerageAuthorization`](#snaptradeconnectionsrefreshbrokerageauthorization)
|
|
47
|
-
* [`snaptrade.connections.removeBrokerageAuthorization`](#snaptradeconnectionsremovebrokerageauthorization)
|
|
48
45
|
* [`snaptrade.connections.returnRates`](#snaptradeconnectionsreturnrates)
|
|
49
|
-
* [`snaptrade.connections.sessionEvents`](#snaptradeconnectionssessionevents)
|
|
50
46
|
* [`snaptrade.connections.syncBrokerageAuthorizationTransactions`](#snaptradeconnectionssyncbrokerageauthorizationtransactions)
|
|
51
47
|
* [`snaptrade.experimentalEndpoints.addSubscription`](#snaptradeexperimentalendpointsaddsubscription)
|
|
52
48
|
* [`snaptrade.experimentalEndpoints.cancelSubscription`](#snaptradeexperimentalendpointscancelsubscription)
|
|
@@ -55,27 +51,20 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
55
51
|
* [`snaptrade.experimentalEndpoints.getUserAccountRecentOrdersV2`](#snaptradeexperimentalendpointsgetuseraccountrecentordersv2)
|
|
56
52
|
* [`snaptrade.experimentalEndpoints.listConnectionAccounts`](#snaptradeexperimentalendpointslistconnectionaccounts)
|
|
57
53
|
* [`snaptrade.experimentalEndpoints.listSubscriptions`](#snaptradeexperimentalendpointslistsubscriptions)
|
|
58
|
-
* [`snaptrade.options.listOptionHoldings`](#snaptradeoptionslistoptionholdings)
|
|
59
|
-
* [`snaptrade.referenceData.getCurrencyExchangeRatePair`](#snaptradereferencedatagetcurrencyexchangeratepair)
|
|
60
54
|
* [`snaptrade.referenceData.getPartnerInfo`](#snaptradereferencedatagetpartnerinfo)
|
|
61
|
-
* [`snaptrade.referenceData.getSecurityTypes`](#snaptradereferencedatagetsecuritytypes)
|
|
62
55
|
* [`snaptrade.referenceData.getStockExchanges`](#snaptradereferencedatagetstockexchanges)
|
|
63
56
|
* [`snaptrade.referenceData.getSymbols`](#snaptradereferencedatagetsymbols)
|
|
64
57
|
* [`snaptrade.referenceData.getSymbolsByTicker`](#snaptradereferencedatagetsymbolsbyticker)
|
|
65
58
|
* [`snaptrade.referenceData.listAllBrokerageAuthorizationType`](#snaptradereferencedatalistallbrokerageauthorizationtype)
|
|
66
59
|
* [`snaptrade.referenceData.listAllBrokerageInstruments`](#snaptradereferencedatalistallbrokerageinstruments)
|
|
67
60
|
* [`snaptrade.referenceData.listAllBrokerages`](#snaptradereferencedatalistallbrokerages)
|
|
68
|
-
* [`snaptrade.referenceData.listAllCurrencies`](#snaptradereferencedatalistallcurrencies)
|
|
69
|
-
* [`snaptrade.referenceData.listAllCurrenciesRates`](#snaptradereferencedatalistallcurrenciesrates)
|
|
70
61
|
* [`snaptrade.referenceData.symbolSearchUserAccount`](#snaptradereferencedatasymbolsearchuseraccount)
|
|
71
62
|
* [`snaptrade.trading.cancelOrder`](#snaptradetradingcancelorder)
|
|
72
|
-
* [`snaptrade.trading.cancelUserAccountOrder`](#snaptradetradingcanceluseraccountorder)
|
|
73
63
|
* [`snaptrade.trading.getCryptocurrencyPairQuote`](#snaptradetradinggetcryptocurrencypairquote)
|
|
74
64
|
* [`snaptrade.trading.getOptionImpact`](#snaptradetradinggetoptionimpact)
|
|
75
65
|
* [`snaptrade.trading.getOrderImpact`](#snaptradetradinggetorderimpact)
|
|
76
66
|
* [`snaptrade.trading.getUserAccountOptionQuotes`](#snaptradetradinggetuseraccountoptionquotes)
|
|
77
67
|
* [`snaptrade.trading.getUserAccountQuotes`](#snaptradetradinggetuseraccountquotes)
|
|
78
|
-
* [`snaptrade.trading.placeBracketOrder`](#snaptradetradingplacebracketorder)
|
|
79
68
|
* [`snaptrade.trading.placeComplexOrder`](#snaptradetradingplacecomplexorder)
|
|
80
69
|
* [`snaptrade.trading.placeCryptoOrder`](#snaptradetradingplacecryptoorder)
|
|
81
70
|
* [`snaptrade.trading.placeForceOrder`](#snaptradetradingplaceforceorder)
|
|
@@ -84,8 +73,6 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
84
73
|
* [`snaptrade.trading.previewCryptoOrder`](#snaptradetradingpreviewcryptoorder)
|
|
85
74
|
* [`snaptrade.trading.replaceOrder`](#snaptradetradingreplaceorder)
|
|
86
75
|
* [`snaptrade.trading.searchCryptocurrencyPairInstruments`](#snaptradetradingsearchcryptocurrencypairinstruments)
|
|
87
|
-
* [`snaptrade.transactionsAndReporting.getActivities`](#snaptradetransactionsandreportinggetactivities)
|
|
88
|
-
* [`snaptrade.transactionsAndReporting.getReportingCustomRange`](#snaptradetransactionsandreportinggetreportingcustomrange)
|
|
89
76
|
|
|
90
77
|
<!-- tocstop -->
|
|
91
78
|
|
|
@@ -349,45 +336,6 @@ const getAllAccountPositionsResponse =
|
|
|
349
336
|
---
|
|
350
337
|
|
|
351
338
|
|
|
352
|
-
### `snaptrade.accountInformation.getAllUserHoldings`<a id="snaptradeaccountinformationgetalluserholdings"></a>
|
|
353
|
-

|
|
354
|
-
|
|
355
|
-
**Deprecated.** Use the account-specific holdings endpoint instead.
|
|
356
|
-
|
|
357
|
-
This endpoint will return HTTP 410 Gone for all customers that sign up after April 25, 2026.
|
|
358
|
-
|
|
359
|
-
List all accounts for the user, plus balances, positions, and orders for each
|
|
360
|
-
account.
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
364
|
-
|
|
365
|
-
```typescript
|
|
366
|
-
const getAllUserHoldingsResponse =
|
|
367
|
-
await snaptrade.accountInformation.getAllUserHoldings({
|
|
368
|
-
brokerageAuthorizations: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
369
|
-
});
|
|
370
|
-
```
|
|
371
|
-
|
|
372
|
-
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
373
|
-
|
|
374
|
-
##### brokerageAuthorizations: `string`<a id="brokerageauthorizations-string"></a>
|
|
375
|
-
|
|
376
|
-
Optional. Comma separated list of authorization IDs (only use if filtering is needed on one or more authorizations).
|
|
377
|
-
|
|
378
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
379
|
-
|
|
380
|
-
[AccountHoldings](./models/account-holdings.ts)
|
|
381
|
-
|
|
382
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
383
|
-
|
|
384
|
-
`/holdings` `GET`
|
|
385
|
-
|
|
386
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
387
|
-
|
|
388
|
-
---
|
|
389
|
-
|
|
390
|
-
|
|
391
339
|
### `snaptrade.accountInformation.getUserAccountBalance`<a id="snaptradeaccountinformationgetuseraccountbalance"></a>
|
|
392
340
|
|
|
393
341
|
Returns a list of balances for the account. Each element of the list has a distinct currency. Some brokerages like Questrade [allows holding multiple currencies in the same account](https://www.questrade.com/learning/questrade-basics/balances-and-reports/understanding-your-account-balances).
|
|
@@ -551,46 +499,6 @@ Number of days in the past to fetch the most recent orders. Defaults to the last
|
|
|
551
499
|
---
|
|
552
500
|
|
|
553
501
|
|
|
554
|
-
### `snaptrade.accountInformation.getUserAccountPositions`<a id="snaptradeaccountinformationgetuseraccountpositions"></a>
|
|
555
|
-

|
|
556
|
-
|
|
557
|
-
**Deprecated.** Use the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions) instead. This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures.
|
|
558
|
-
|
|
559
|
-
Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the [options endpoint](/reference/Options/Options_listOptionHoldings).
|
|
560
|
-
|
|
561
|
-
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:
|
|
562
|
-
- If you do, this endpoint returns real-time data.
|
|
563
|
-
- If you don't, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
|
|
564
|
-
|
|
565
|
-
If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
569
|
-
|
|
570
|
-
```typescript
|
|
571
|
-
const getUserAccountPositionsResponse =
|
|
572
|
-
await snaptrade.accountInformation.getUserAccountPositions({
|
|
573
|
-
accountId: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
574
|
-
});
|
|
575
|
-
```
|
|
576
|
-
|
|
577
|
-
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
578
|
-
|
|
579
|
-
##### accountId: `string`<a id="accountid-string"></a>
|
|
580
|
-
|
|
581
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
582
|
-
|
|
583
|
-
[Position](./models/position.ts)
|
|
584
|
-
|
|
585
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
586
|
-
|
|
587
|
-
`/accounts/{accountId}/positions` `GET`
|
|
588
|
-
|
|
589
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
590
|
-
|
|
591
|
-
---
|
|
592
|
-
|
|
593
|
-
|
|
594
502
|
### `snaptrade.accountInformation.getUserAccountRecentOrders`<a id="snaptradeaccountinformationgetuseraccountrecentorders"></a>
|
|
595
503
|
|
|
596
504
|
A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders.
|
|
@@ -1169,32 +1077,6 @@ const refreshBrokerageAuthorizationResponse =
|
|
|
1169
1077
|
---
|
|
1170
1078
|
|
|
1171
1079
|
|
|
1172
|
-
### `snaptrade.connections.removeBrokerageAuthorization`<a id="snaptradeconnectionsremovebrokerageauthorization"></a>
|
|
1173
|
-
|
|
1174
|
-
Deletes the SnapTrade connection specified by the ID. This will also remove the accounts and holdings data associated with the connection from SnapTrade. This action is irreversible. This endpoint is synchronous, a 204 response indicates that the data has been successfully deleted.
|
|
1175
|
-
|
|
1176
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1177
|
-
|
|
1178
|
-
```typescript
|
|
1179
|
-
const removeBrokerageAuthorizationResponse =
|
|
1180
|
-
await snaptrade.connections.removeBrokerageAuthorization({
|
|
1181
|
-
authorizationId: "87b24961-b51e-4db8-9226-f198f6518a89",
|
|
1182
|
-
});
|
|
1183
|
-
```
|
|
1184
|
-
|
|
1185
|
-
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1186
|
-
|
|
1187
|
-
##### authorizationId: `string`<a id="authorizationid-string"></a>
|
|
1188
|
-
|
|
1189
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1190
|
-
|
|
1191
|
-
`/authorizations/{authorizationId}` `DELETE`
|
|
1192
|
-
|
|
1193
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1194
|
-
|
|
1195
|
-
---
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
1080
|
### `snaptrade.connections.returnRates`<a id="snaptradeconnectionsreturnrates"></a>
|
|
1199
1081
|
|
|
1200
1082
|
Returns a list of rate of return percents for a given connection.
|
|
@@ -1230,47 +1112,6 @@ Optional comma separated list of rate-of-return timeframes to return. Supported
|
|
|
1230
1112
|
---
|
|
1231
1113
|
|
|
1232
1114
|
|
|
1233
|
-
### `snaptrade.connections.sessionEvents`<a id="snaptradeconnectionssessionevents"></a>
|
|
1234
|
-
|
|
1235
|
-
Returns a list of session events associated with a user.
|
|
1236
|
-
|
|
1237
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1238
|
-
|
|
1239
|
-
```typescript
|
|
1240
|
-
const sessionEventsResponse = await snaptrade.connections.sessionEvents({
|
|
1241
|
-
partnerClientId: "SNAPTRADETEST",
|
|
1242
|
-
userId:
|
|
1243
|
-
"917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
|
|
1244
|
-
sessionId:
|
|
1245
|
-
"917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
|
|
1246
|
-
});
|
|
1247
|
-
```
|
|
1248
|
-
|
|
1249
|
-
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1250
|
-
|
|
1251
|
-
##### partnerClientId: `string`<a id="partnerclientid-string"></a>
|
|
1252
|
-
|
|
1253
|
-
##### userId: `string`<a id="userid-string"></a>
|
|
1254
|
-
|
|
1255
|
-
Optional comma separated list of user IDs used to filter the request on specific users
|
|
1256
|
-
|
|
1257
|
-
##### sessionId: `string`<a id="sessionid-string"></a>
|
|
1258
|
-
|
|
1259
|
-
Optional comma separated list of session IDs used to filter the request on specific users
|
|
1260
|
-
|
|
1261
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
1262
|
-
|
|
1263
|
-
[ConnectionsSessionEvents200ResponseInner](./models/connections-session-events200-response-inner.ts)
|
|
1264
|
-
|
|
1265
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1266
|
-
|
|
1267
|
-
`/sessionEvents` `GET`
|
|
1268
|
-
|
|
1269
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1270
|
-
|
|
1271
|
-
---
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
1115
|
### `snaptrade.connections.syncBrokerageAuthorizationTransactions`<a id="snaptradeconnectionssyncbrokerageauthorizationtransactions"></a>
|
|
1275
1116
|
|
|
1276
1117
|
Trigger a transactions sync for all accounts under this connection. Updates will be queued asynchronously. Transactions are not updated intra-day, but calling this endpoint can ensure that the previous day's transactions have been synced. For more information on sync behaviour, see: https://docs.snaptrade.com/docs/syncing
|
|
@@ -1565,75 +1406,6 @@ const listSubscriptionsResponse =
|
|
|
1565
1406
|
---
|
|
1566
1407
|
|
|
1567
1408
|
|
|
1568
|
-
### `snaptrade.options.listOptionHoldings`<a id="snaptradeoptionslistoptionholdings"></a>
|
|
1569
|
-

|
|
1570
|
-
|
|
1571
|
-
**Deprecated.** Use the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions) instead. This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures.
|
|
1572
|
-
|
|
1573
|
-
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).
|
|
1574
|
-
|
|
1575
|
-
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:
|
|
1576
|
-
- If you do, this endpoint returns real-time data.
|
|
1577
|
-
- If you don't, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1581
|
-
|
|
1582
|
-
```typescript
|
|
1583
|
-
const listOptionHoldingsResponse = await snaptrade.options.listOptionHoldings({
|
|
1584
|
-
accountId: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
1585
|
-
});
|
|
1586
|
-
```
|
|
1587
|
-
|
|
1588
|
-
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1589
|
-
|
|
1590
|
-
##### accountId: `string`<a id="accountid-string"></a>
|
|
1591
|
-
|
|
1592
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
1593
|
-
|
|
1594
|
-
[OptionsPosition](./models/options-position.ts)
|
|
1595
|
-
|
|
1596
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1597
|
-
|
|
1598
|
-
`/accounts/{accountId}/options` `GET`
|
|
1599
|
-
|
|
1600
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1601
|
-
|
|
1602
|
-
---
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
### `snaptrade.referenceData.getCurrencyExchangeRatePair`<a id="snaptradereferencedatagetcurrencyexchangeratepair"></a>
|
|
1606
|
-
|
|
1607
|
-
Returns an Exchange Rate Pair object for the specified Currency Pair.
|
|
1608
|
-
|
|
1609
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1610
|
-
|
|
1611
|
-
```typescript
|
|
1612
|
-
const getCurrencyExchangeRatePairResponse =
|
|
1613
|
-
await snaptrade.referenceData.getCurrencyExchangeRatePair({
|
|
1614
|
-
currencyPair: "currencyPair_example",
|
|
1615
|
-
});
|
|
1616
|
-
```
|
|
1617
|
-
|
|
1618
|
-
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1619
|
-
|
|
1620
|
-
##### currencyPair: `string`<a id="currencypair-string"></a>
|
|
1621
|
-
|
|
1622
|
-
A currency pair based on currency code for example, {CAD-USD}
|
|
1623
|
-
|
|
1624
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
1625
|
-
|
|
1626
|
-
[ExchangeRatePairs](./models/exchange-rate-pairs.ts)
|
|
1627
|
-
|
|
1628
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1629
|
-
|
|
1630
|
-
`/currencies/rates/{currencyPair}` `GET`
|
|
1631
|
-
|
|
1632
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1633
|
-
|
|
1634
|
-
---
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
1409
|
### `snaptrade.referenceData.getPartnerInfo`<a id="snaptradereferencedatagetpartnerinfo"></a>
|
|
1638
1410
|
|
|
1639
1411
|
Returns configurations for your SnapTrade Client ID, including allowed brokerages and data access.
|
|
@@ -1657,30 +1429,6 @@ const getPartnerInfoResponse = await snaptrade.referenceData.getPartnerInfo();
|
|
|
1657
1429
|
---
|
|
1658
1430
|
|
|
1659
1431
|
|
|
1660
|
-
### `snaptrade.referenceData.getSecurityTypes`<a id="snaptradereferencedatagetsecuritytypes"></a>
|
|
1661
|
-
|
|
1662
|
-
Return all available security types supported by SnapTrade.
|
|
1663
|
-
|
|
1664
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1665
|
-
|
|
1666
|
-
```typescript
|
|
1667
|
-
const getSecurityTypesResponse =
|
|
1668
|
-
await snaptrade.referenceData.getSecurityTypes();
|
|
1669
|
-
```
|
|
1670
|
-
|
|
1671
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
1672
|
-
|
|
1673
|
-
[SecurityType](./models/security-type.ts)
|
|
1674
|
-
|
|
1675
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1676
|
-
|
|
1677
|
-
`/securityTypes` `GET`
|
|
1678
|
-
|
|
1679
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1680
|
-
|
|
1681
|
-
---
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
1432
|
### `snaptrade.referenceData.getStockExchanges`<a id="snaptradereferencedatagetstockexchanges"></a>
|
|
1685
1433
|
|
|
1686
1434
|
Returns a list of all supported Exchanges.
|
|
@@ -1858,54 +1606,6 @@ const listAllBrokeragesResponse =
|
|
|
1858
1606
|
---
|
|
1859
1607
|
|
|
1860
1608
|
|
|
1861
|
-
### `snaptrade.referenceData.listAllCurrencies`<a id="snaptradereferencedatalistallcurrencies"></a>
|
|
1862
|
-
|
|
1863
|
-
Returns a list of all defined Currency objects.
|
|
1864
|
-
|
|
1865
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1866
|
-
|
|
1867
|
-
```typescript
|
|
1868
|
-
const listAllCurrenciesResponse =
|
|
1869
|
-
await snaptrade.referenceData.listAllCurrencies();
|
|
1870
|
-
```
|
|
1871
|
-
|
|
1872
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
1873
|
-
|
|
1874
|
-
[Currency](./models/currency.ts)
|
|
1875
|
-
|
|
1876
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1877
|
-
|
|
1878
|
-
`/currencies` `GET`
|
|
1879
|
-
|
|
1880
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1881
|
-
|
|
1882
|
-
---
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
### `snaptrade.referenceData.listAllCurrenciesRates`<a id="snaptradereferencedatalistallcurrenciesrates"></a>
|
|
1886
|
-
|
|
1887
|
-
Returns a list of all Exchange Rate Pairs for all supported Currencies.
|
|
1888
|
-
|
|
1889
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1890
|
-
|
|
1891
|
-
```typescript
|
|
1892
|
-
const listAllCurrenciesRatesResponse =
|
|
1893
|
-
await snaptrade.referenceData.listAllCurrenciesRates();
|
|
1894
|
-
```
|
|
1895
|
-
|
|
1896
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
1897
|
-
|
|
1898
|
-
[ExchangeRatePairs](./models/exchange-rate-pairs.ts)
|
|
1899
|
-
|
|
1900
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1901
|
-
|
|
1902
|
-
`/currencies/rates` `GET`
|
|
1903
|
-
|
|
1904
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1905
|
-
|
|
1906
|
-
---
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
1609
|
### `snaptrade.referenceData.symbolSearchUserAccount`<a id="snaptradereferencedatasymbolsearchuseraccount"></a>
|
|
1910
1610
|
|
|
1911
1611
|
Returns a list of Universal Symbol objects that match the given query. The matching takes into consideration both the ticker and the name of the symbol. Only the first 20 results are returned.
|
|
@@ -1979,45 +1679,6 @@ Order ID returned by brokerage. This is the unique identifier for the order in t
|
|
|
1979
1679
|
---
|
|
1980
1680
|
|
|
1981
1681
|
|
|
1982
|
-
### `snaptrade.trading.cancelUserAccountOrder`<a id="snaptradetradingcanceluseraccountorder"></a>
|
|
1983
|
-

|
|
1984
|
-
|
|
1985
|
-
**Deprecated.** Use [the new cancel order endpoint](/reference/Trading/Trading_cancelOrder) instead.
|
|
1986
|
-
|
|
1987
|
-
Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected.
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1991
|
-
|
|
1992
|
-
```typescript
|
|
1993
|
-
const cancelUserAccountOrderResponse =
|
|
1994
|
-
await snaptrade.trading.cancelUserAccountOrder({
|
|
1995
|
-
accountId: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
1996
|
-
brokerage_order_id: "66a033fa-da74-4fcf-b527-feefdec9257e",
|
|
1997
|
-
});
|
|
1998
|
-
```
|
|
1999
|
-
|
|
2000
|
-
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
2001
|
-
|
|
2002
|
-
##### brokerage_order_id: `string`<a id="brokerage_order_id-string"></a>
|
|
2003
|
-
|
|
2004
|
-
Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.
|
|
2005
|
-
|
|
2006
|
-
##### accountId: `string`<a id="accountid-string"></a>
|
|
2007
|
-
|
|
2008
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
2009
|
-
|
|
2010
|
-
[AccountOrderRecord](./models/account-order-record.ts)
|
|
2011
|
-
|
|
2012
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
2013
|
-
|
|
2014
|
-
`/accounts/{accountId}/orders/cancel` `POST`
|
|
2015
|
-
|
|
2016
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
2017
|
-
|
|
2018
|
-
---
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
1682
|
### `snaptrade.trading.getCryptocurrencyPairQuote`<a id="snaptradetradinggetcryptocurrencypairquote"></a>
|
|
2022
1683
|
|
|
2023
1684
|
Gets a quote for the specified account.
|
|
@@ -2267,89 +1928,6 @@ Should be set to `True` if `symbols` are comprised of tickers. Defaults to `Fals
|
|
|
2267
1928
|
---
|
|
2268
1929
|
|
|
2269
1930
|
|
|
2270
|
-
### `snaptrade.trading.placeBracketOrder`<a id="snaptradetradingplacebracketorder"></a>
|
|
2271
|
-

|
|
2272
|
-
|
|
2273
|
-
**Deprecated.** Use [the new complex order endpoint](/reference/Trading/Trading_placeComplexOrder) instead.
|
|
2274
|
-
|
|
2275
|
-
Places a bracket order (entry order + OCO of stop loss and take profit). Disabled by default please contact support for
|
|
2276
|
-
use. Only supported on certain brokerages
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
2280
|
-
|
|
2281
|
-
```typescript
|
|
2282
|
-
const placeBracketOrderResponse = await snaptrade.trading.placeBracketOrder({
|
|
2283
|
-
accountId: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
2284
|
-
action: "BUY",
|
|
2285
|
-
instrument: {
|
|
2286
|
-
symbol: "AAPL",
|
|
2287
|
-
type: "EQUITY",
|
|
2288
|
-
},
|
|
2289
|
-
order_type: "Market",
|
|
2290
|
-
time_in_force: "Day",
|
|
2291
|
-
price: 31.33,
|
|
2292
|
-
stop: 31.33,
|
|
2293
|
-
units: 10.5,
|
|
2294
|
-
stop_loss: {
|
|
2295
|
-
stop_price: "48.55",
|
|
2296
|
-
limit_price: "48.50",
|
|
2297
|
-
},
|
|
2298
|
-
take_profit: {
|
|
2299
|
-
limit_price: "49.95",
|
|
2300
|
-
},
|
|
2301
|
-
});
|
|
2302
|
-
```
|
|
2303
|
-
|
|
2304
|
-
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
2305
|
-
|
|
2306
|
-
##### action: [`ActionStrictWithOptions`](./models/action-strict-with-options.ts)<a id="action-actionstrictwithoptionsmodelsaction-strict-with-optionsts"></a>
|
|
2307
|
-
|
|
2308
|
-
The action describes the intent or side of a trade. This is either `BUY` or `SELL` for Equity symbols or `BUY_TO_OPEN`, `BUY_TO_CLOSE`, `SELL_TO_OPEN` or `SELL_TO_CLOSE` for Options.
|
|
2309
|
-
|
|
2310
|
-
##### instrument: [`TradingInstrument`](./models/trading-instrument.ts)<a id="instrument-tradinginstrumentmodelstrading-instrumentts"></a>
|
|
2311
|
-
|
|
2312
|
-
##### order_type: [`OrderTypeStrict`](./models/order-type-strict.ts)<a id="order_type-ordertypestrictmodelsorder-type-strictts"></a>
|
|
2313
|
-
|
|
2314
|
-
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.
|
|
2315
|
-
|
|
2316
|
-
##### time_in_force: [`TimeInForceStrict`](./models/time-in-force-strict.ts)<a id="time_in_force-timeinforcestrictmodelstime-in-force-strictts"></a>
|
|
2317
|
-
|
|
2318
|
-
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.
|
|
2319
|
-
|
|
2320
|
-
##### stop_loss: [`StopLoss`](./models/stop-loss.ts)<a id="stop_loss-stoplossmodelsstop-lossts"></a>
|
|
2321
|
-
|
|
2322
|
-
##### take_profit: [`TakeProfit`](./models/take-profit.ts)<a id="take_profit-takeprofitmodelstake-profitts"></a>
|
|
2323
|
-
|
|
2324
|
-
##### accountId: `string`<a id="accountid-string"></a>
|
|
2325
|
-
|
|
2326
|
-
The ID of the account to execute the trade on.
|
|
2327
|
-
|
|
2328
|
-
##### price: `number`<a id="price-number"></a>
|
|
2329
|
-
|
|
2330
|
-
The limit price for `Limit` and `StopLimit` orders.
|
|
2331
|
-
|
|
2332
|
-
##### stop: `number`<a id="stop-number"></a>
|
|
2333
|
-
|
|
2334
|
-
The price at which a stop order is triggered for `Stop` and `StopLimit` orders.
|
|
2335
|
-
|
|
2336
|
-
##### units: `number`<a id="units-number"></a>
|
|
2337
|
-
|
|
2338
|
-
Number of shares for the order. This can be a decimal for fractional orders. Must be `null` if `notional_value` is provided.
|
|
2339
|
-
|
|
2340
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
2341
|
-
|
|
2342
|
-
[AccountOrderRecord](./models/account-order-record.ts)
|
|
2343
|
-
|
|
2344
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
2345
|
-
|
|
2346
|
-
`/accounts/{accountId}/trading/bracket` `POST`
|
|
2347
|
-
|
|
2348
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
2349
|
-
|
|
2350
|
-
---
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
1931
|
### `snaptrade.trading.placeComplexOrder`<a id="snaptradetradingplacecomplexorder"></a>
|
|
2354
1932
|
|
|
2355
1933
|
Places a complex conditional order (OCO, OTO, or OTOCO).
|
|
@@ -2872,120 +2450,5 @@ const searchCryptocurrencyPairInstrumentsResponse =
|
|
|
2872
2450
|
---
|
|
2873
2451
|
|
|
2874
2452
|
|
|
2875
|
-
### `snaptrade.transactionsAndReporting.getActivities`<a id="snaptradetransactionsandreportinggetactivities"></a>
|
|
2876
|
-

|
|
2877
|
-
|
|
2878
|
-
**Deprecated.** Use [the account level endpoint](/reference/Account%20Information/AccountInformation_getAccountActivities) instead, if possible.
|
|
2879
|
-
|
|
2880
|
-
This endpoint will return HTTP 410 Gone for all customers that sign up after April 25, 2026.
|
|
2881
|
-
|
|
2882
|
-
Returns all historical transactions for the specified user and filtering criteria. It's recommended to use `startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There's a max number of 10000 transactions returned per request.
|
|
2883
|
-
|
|
2884
|
-
There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order.
|
|
2885
|
-
|
|
2886
|
-
This endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage.
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
2890
|
-
|
|
2891
|
-
```typescript
|
|
2892
|
-
const getActivitiesResponse =
|
|
2893
|
-
await snaptrade.transactionsAndReporting.getActivities({
|
|
2894
|
-
startDate: "2022-01-24T00:00:00.000Z",
|
|
2895
|
-
endDate: "2022-01-24T00:00:00.000Z",
|
|
2896
|
-
accounts:
|
|
2897
|
-
"917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
|
|
2898
|
-
brokerageAuthorizations:
|
|
2899
|
-
"917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
|
|
2900
|
-
type: "BUY,SELL,DIVIDEND",
|
|
2901
|
-
});
|
|
2902
|
-
```
|
|
2903
|
-
|
|
2904
|
-
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
2905
|
-
|
|
2906
|
-
##### startDate: `string | Date`<a id="startdate-string--date"></a>
|
|
2907
|
-
|
|
2908
|
-
The start date (inclusive) of the transaction history to retrieve. If not provided, the default is the first transaction known to SnapTrade based on `trade_date`.
|
|
2909
|
-
|
|
2910
|
-
##### endDate: `string | Date`<a id="enddate-string--date"></a>
|
|
2911
|
-
|
|
2912
|
-
The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on `trade_date`.
|
|
2913
|
-
|
|
2914
|
-
##### accounts: `string`<a id="accounts-string"></a>
|
|
2915
|
-
|
|
2916
|
-
Optional comma separated list of SnapTrade Account IDs used to filter the request to specific accounts. If not provided, the default is all known brokerage accounts for the user. The `brokerageAuthorizations` parameter takes precedence over this parameter.
|
|
2917
|
-
|
|
2918
|
-
##### brokerageAuthorizations: `string`<a id="brokerageauthorizations-string"></a>
|
|
2919
|
-
|
|
2920
|
-
Optional comma separated list of SnapTrade Connection (Brokerage Authorization) IDs used to filter the request to only accounts that belong to those connections. If not provided, the default is all connections for the user. This parameter takes precedence over the `accounts` parameter.
|
|
2921
|
-
|
|
2922
|
-
##### type: `string`<a id="type-string"></a>
|
|
2923
|
-
|
|
2924
|
-
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. - `SUBSTITUTE_DIVIDEND` - Payment in lieu of a dividend. - `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
|
|
2925
|
-
|
|
2926
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
2927
|
-
|
|
2928
|
-
[UniversalActivity](./models/universal-activity.ts)
|
|
2929
|
-
|
|
2930
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
2931
|
-
|
|
2932
|
-
`/activities` `GET`
|
|
2933
|
-
|
|
2934
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
2935
|
-
|
|
2936
|
-
---
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
### `snaptrade.transactionsAndReporting.getReportingCustomRange`<a id="snaptradetransactionsandreportinggetreportingcustomrange"></a>
|
|
2940
|
-

|
|
2941
|
-
|
|
2942
|
-
**Deprecated.** Returns performance information (contributions, dividends, rate of return, etc) for a specific timeframe. Please note that Total Equity Timeframe and Rate of Returns are experimental features. Please contact support@snaptrade.com if you notice any inconsistencies.
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
2946
|
-
|
|
2947
|
-
```typescript
|
|
2948
|
-
const getReportingCustomRangeResponse =
|
|
2949
|
-
await snaptrade.transactionsAndReporting.getReportingCustomRange({
|
|
2950
|
-
startDate: "2022-01-24T00:00:00.000Z",
|
|
2951
|
-
endDate: "2022-01-24T00:00:00.000Z",
|
|
2952
|
-
accounts:
|
|
2953
|
-
"917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
|
|
2954
|
-
detailed: true,
|
|
2955
|
-
frequency: "monthly",
|
|
2956
|
-
});
|
|
2957
|
-
```
|
|
2958
|
-
|
|
2959
|
-
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
2960
|
-
|
|
2961
|
-
##### startDate: `string | Date`<a id="startdate-string--date"></a>
|
|
2962
|
-
|
|
2963
|
-
##### endDate: `string | Date`<a id="enddate-string--date"></a>
|
|
2964
|
-
|
|
2965
|
-
##### accounts: `string`<a id="accounts-string"></a>
|
|
2966
|
-
|
|
2967
|
-
Optional comma separated list of account IDs used to filter the request on specific accounts
|
|
2968
|
-
|
|
2969
|
-
##### detailed: `boolean`<a id="detailed-boolean"></a>
|
|
2970
|
-
|
|
2971
|
-
Optional, increases frequency of data points for the total value and contribution charts if set to true
|
|
2972
|
-
|
|
2973
|
-
##### frequency: `string`<a id="frequency-string"></a>
|
|
2974
|
-
|
|
2975
|
-
Optional frequency for the rate of return chart (defaults to monthly). Possible values are daily, weekly, monthly, quarterly, yearly.
|
|
2976
|
-
|
|
2977
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
2978
|
-
|
|
2979
|
-
[PerformanceCustom](./models/performance-custom.ts)
|
|
2980
|
-
|
|
2981
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
2982
|
-
|
|
2983
|
-
`/performance/custom` `GET`
|
|
2984
|
-
|
|
2985
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
2986
|
-
|
|
2987
|
-
---
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
2453
|
## Author<a id="author"></a>
|
|
2991
2454
|
This TypeScript package is automatically generated by [Konfig](https://konfigthis.com)
|