snaptrade-typescript-sdk 12.2.21 → 12.2.22
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 +121 -119
- package/dist/browser.umd.js +1 -1
- package/dist/index.cjs +253 -245
- package/dist/index.d.cts +143 -129
- package/dist/index.d.mts +143 -129
- package/dist/index.d.ts +143 -129
- package/dist/index.mjs +253 -245
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -63,7 +63,7 @@ backoff with jitter rather than from the headers.
|
|
|
63
63
|
See https://docs.snaptrade.com/docs/ratelimiting.
|
|
64
64
|
|
|
65
65
|
|
|
66
|
-
[](https://www.npmjs.com/package/snaptrade-typescript-sdk/v/12.2.22)
|
|
67
67
|
[](https://snaptrade.com/)
|
|
68
68
|
|
|
69
69
|
</div>
|
|
@@ -80,6 +80,7 @@ See https://docs.snaptrade.com/docs/ratelimiting.
|
|
|
80
80
|
- [Reference](#reference)
|
|
81
81
|
* [`snaptrade.accountInformation.getAccountActivities`](#snaptradeaccountinformationgetaccountactivities)
|
|
82
82
|
* [`snaptrade.accountInformation.getAccountBalanceHistory`](#snaptradeaccountinformationgetaccountbalancehistory)
|
|
83
|
+
* [`snaptrade.accountInformation.getAccountDetails`](#snaptradeaccountinformationgetaccountdetails)
|
|
83
84
|
* [`snaptrade.accountInformation.getAllAccountPositions`](#snaptradeaccountinformationgetallaccountpositions)
|
|
84
85
|
* [`snaptrade.accountInformation.getUserAccountBalance`](#snaptradeaccountinformationgetuseraccountbalance)
|
|
85
86
|
* [`snaptrade.accountInformation.getUserAccountDetails`](#snaptradeaccountinformationgetuseraccountdetails)
|
|
@@ -88,6 +89,7 @@ See https://docs.snaptrade.com/docs/ratelimiting.
|
|
|
88
89
|
* [`snaptrade.accountInformation.getUserAccountRecentOrders`](#snaptradeaccountinformationgetuseraccountrecentorders)
|
|
89
90
|
* [`snaptrade.accountInformation.getUserAccountReturnRates`](#snaptradeaccountinformationgetuseraccountreturnrates)
|
|
90
91
|
* [`snaptrade.accountInformation.getUserHoldings`](#snaptradeaccountinformationgetuserholdings)
|
|
92
|
+
* [`snaptrade.accountInformation.listAllUserAccounts`](#snaptradeaccountinformationlistalluseraccounts)
|
|
91
93
|
* [`snaptrade.accountInformation.listUserAccounts`](#snaptradeaccountinformationlistuseraccounts)
|
|
92
94
|
* [`snaptrade.accountInformation.updateUserAccount`](#snaptradeaccountinformationupdateuseraccount)
|
|
93
95
|
* [`snaptrade.apiStatus.check`](#snaptradeapistatuscheck)
|
|
@@ -107,11 +109,9 @@ See https://docs.snaptrade.com/docs/ratelimiting.
|
|
|
107
109
|
* [`snaptrade.connections.syncBrokerageAuthorizationTransactions`](#snaptradeconnectionssyncbrokerageauthorizationtransactions)
|
|
108
110
|
* [`snaptrade.experimentalEndpoints.addSubscription`](#snaptradeexperimentalendpointsaddsubscription)
|
|
109
111
|
* [`snaptrade.experimentalEndpoints.cancelSubscription`](#snaptradeexperimentalendpointscancelsubscription)
|
|
110
|
-
* [`snaptrade.experimentalEndpoints.getAccountDetails`](#snaptradeexperimentalendpointsgetaccountdetails)
|
|
111
112
|
* [`snaptrade.experimentalEndpoints.getUserAccountOrderDetailV2`](#snaptradeexperimentalendpointsgetuseraccountorderdetailv2)
|
|
112
113
|
* [`snaptrade.experimentalEndpoints.getUserAccountOrdersV2`](#snaptradeexperimentalendpointsgetuseraccountordersv2)
|
|
113
114
|
* [`snaptrade.experimentalEndpoints.getUserAccountRecentOrdersV2`](#snaptradeexperimentalendpointsgetuseraccountrecentordersv2)
|
|
114
|
-
* [`snaptrade.experimentalEndpoints.listAllUserAccounts`](#snaptradeexperimentalendpointslistalluseraccounts)
|
|
115
115
|
* [`snaptrade.experimentalEndpoints.listSubscriptions`](#snaptradeexperimentalendpointslistsubscriptions)
|
|
116
116
|
* [`snaptrade.experimentalEndpoints.placeSimpleOrder`](#snaptradeexperimentalendpointsplacesimpleorder)
|
|
117
117
|
* [`snaptrade.referenceData.getPartnerInfo`](#snaptradereferencedatagetpartnerinfo)
|
|
@@ -447,6 +447,67 @@ The client identifies the user in this mode. Do not pass `userId` `userSecret` t
|
|
|
447
447
|
---
|
|
448
448
|
|
|
449
449
|
|
|
450
|
+
### `snaptrade.accountInformation.getAccountDetails`<a id="snaptradeaccountinformationgetaccountdetails"></a>
|
|
451
|
+
|
|
452
|
+
Returns the specified account for the authenticated user. The account can be an investment, deposit, or line of credit account. Use the `kind` discriminator to determine the schema for the account.
|
|
453
|
+
|
|
454
|
+
On Pay as you Go / Real-time, this endpoint refreshes the account's opening date and total net value (`net_value`) live from the institution on each call, along with funding date for `investment` accounts.
|
|
455
|
+
|
|
456
|
+
On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by institution. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
457
|
+
|
|
458
|
+
Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.
|
|
459
|
+
|
|
460
|
+
If the connection has become disabled, it can no longer access the latest data from the institution, 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.
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
464
|
+
|
|
465
|
+
##### Commercial API Key Auth<a id="commercial-api-key-auth"></a>
|
|
466
|
+
|
|
467
|
+
```typescript
|
|
468
|
+
const getAccountDetailsResponse =
|
|
469
|
+
await commercialApiKeyClient.accountInformation.getAccountDetails({
|
|
470
|
+
accountId: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
471
|
+
userId: "snaptrade-user-123",
|
|
472
|
+
userSecret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
473
|
+
});
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
Required credentials for this mode:
|
|
477
|
+
|
|
478
|
+
- `userId` (string, required): 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.
|
|
479
|
+
|
|
480
|
+
- `userSecret` (string, required): 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](/reference/Authentication/Authentication_resetSnapTradeUserSecret).
|
|
481
|
+
|
|
482
|
+
##### Personal API Key Auth<a id="personal-api-key-auth"></a>
|
|
483
|
+
|
|
484
|
+
```typescript
|
|
485
|
+
const getAccountDetailsResponse =
|
|
486
|
+
await personalApiKeyClient.accountInformation.getAccountDetails({
|
|
487
|
+
accountId: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
488
|
+
});
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
The client identifies the user in this mode. Do not pass `userId` `userSecret` to this method.
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
495
|
+
|
|
496
|
+
##### accountId: `string`<a id="accountid-string"></a>
|
|
497
|
+
|
|
498
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
499
|
+
|
|
500
|
+
[ConnectionAccount](./models/connection-account.ts)
|
|
501
|
+
|
|
502
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
503
|
+
|
|
504
|
+
`/accounts/{accountId}/details` `GET`
|
|
505
|
+
|
|
506
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
507
|
+
|
|
508
|
+
---
|
|
509
|
+
|
|
510
|
+
|
|
450
511
|
### `snaptrade.accountInformation.getAllAccountPositions`<a id="snaptradeaccountinformationgetallaccountpositions"></a>
|
|
451
512
|
|
|
452
513
|
Returns a list of all positions in the specified account.
|
|
@@ -568,6 +629,9 @@ The client identifies the user in this mode. Do not pass `userId` `userSecret` t
|
|
|
568
629
|
|
|
569
630
|
|
|
570
631
|
### `snaptrade.accountInformation.getUserAccountDetails`<a id="snaptradeaccountinformationgetuseraccountdetails"></a>
|
|
632
|
+

|
|
633
|
+
|
|
634
|
+
**Deprecated.** Use the [get account details](/reference/Account%20Information/AccountInformation_getAccountDetails) endpoint instead, which supports all account types, including investment, deposit, and line of credit accounts.
|
|
571
635
|
|
|
572
636
|
Returns account detail known to SnapTrade for the specified account.
|
|
573
637
|
|
|
@@ -949,7 +1013,60 @@ The client identifies the user in this mode. Do not pass `userId` `userSecret` t
|
|
|
949
1013
|
---
|
|
950
1014
|
|
|
951
1015
|
|
|
1016
|
+
### `snaptrade.accountInformation.listAllUserAccounts`<a id="snaptradeaccountinformationlistalluseraccounts"></a>
|
|
1017
|
+
|
|
1018
|
+
Returns all accounts across all connections known to SnapTrade for the authenticated user.
|
|
1019
|
+
|
|
1020
|
+
The `results` list can contain multiple account types in the same response, including investment, deposit, and line of credit accounts. Use the `kind` discriminator to determine the schema for each account.
|
|
1021
|
+
|
|
1022
|
+
This endpoint returns Daily data regardless of the customer's plan. Daily data is cached and refreshed once a day, which makes this endpoint fast and well-suited to listing accounts across all of a user's connections in a single call. Exact refresh timing may vary by institution. To get real-time data on Pay as you Go / Real-time, use the [list accounts for a connection endpoint](/reference/Connections/Connections_listConnectionAccounts). Customers on Pay as you Go / Daily can force a refresh with the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
1023
|
+
|
|
1024
|
+
|
|
1025
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1026
|
+
|
|
1027
|
+
##### Commercial API Key Auth<a id="commercial-api-key-auth"></a>
|
|
1028
|
+
|
|
1029
|
+
```typescript
|
|
1030
|
+
const listAllUserAccountsResponse =
|
|
1031
|
+
await commercialApiKeyClient.accountInformation.listAllUserAccounts({
|
|
1032
|
+
userId: "snaptrade-user-123",
|
|
1033
|
+
userSecret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1034
|
+
});
|
|
1035
|
+
```
|
|
1036
|
+
|
|
1037
|
+
Required credentials for this mode:
|
|
1038
|
+
|
|
1039
|
+
- `userId` (string, required): 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.
|
|
1040
|
+
|
|
1041
|
+
- `userSecret` (string, required): 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](/reference/Authentication/Authentication_resetSnapTradeUserSecret).
|
|
1042
|
+
|
|
1043
|
+
##### Personal API Key Auth<a id="personal-api-key-auth"></a>
|
|
1044
|
+
|
|
1045
|
+
```typescript
|
|
1046
|
+
const listAllUserAccountsResponse =
|
|
1047
|
+
await personalApiKeyClient.accountInformation.listAllUserAccounts();
|
|
1048
|
+
```
|
|
1049
|
+
|
|
1050
|
+
The client identifies the user in this mode. Do not pass `userId` `userSecret` to this method.
|
|
1051
|
+
|
|
1052
|
+
|
|
1053
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
1054
|
+
|
|
1055
|
+
[AllUserAccountsResponse](./models/all-user-accounts-response.ts)
|
|
1056
|
+
|
|
1057
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1058
|
+
|
|
1059
|
+
`/accounts/all` `GET`
|
|
1060
|
+
|
|
1061
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1062
|
+
|
|
1063
|
+
---
|
|
1064
|
+
|
|
1065
|
+
|
|
952
1066
|
### `snaptrade.accountInformation.listUserAccounts`<a id="snaptradeaccountinformationlistuseraccounts"></a>
|
|
1067
|
+

|
|
1068
|
+
|
|
1069
|
+
**Deprecated.** Use the [list all user accounts](/reference/Account%20Information/AccountInformation_listAllUserAccounts) endpoint instead, which returns all account types in a single response, including investment, deposit, and line of credit accounts.
|
|
953
1070
|
|
|
954
1071
|
Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user.
|
|
955
1072
|
|
|
@@ -1590,7 +1707,7 @@ The client identifies the user in this mode. Do not pass `userId` `userSecret` t
|
|
|
1590
1707
|
|
|
1591
1708
|
Returns all accounts that belong to the specified connection for the authenticated user.
|
|
1592
1709
|
|
|
1593
|
-
The `results` list can contain multiple account
|
|
1710
|
+
The `results` list can contain multiple account types in the same response, including investment, deposit, and line of credit accounts. Use the `kind` discriminator to determine the schema for each account.
|
|
1594
1711
|
|
|
1595
1712
|
On Pay as you Go / Real-time, this endpoint refreshes each account's opening date and total net value (`net_value`) live from the institution on each call, along with funding date for `investment` accounts.
|
|
1596
1713
|
|
|
@@ -1927,69 +2044,6 @@ Unique identifier for the connected brokerage account. This is the UUID used to
|
|
|
1927
2044
|
---
|
|
1928
2045
|
|
|
1929
2046
|
|
|
1930
|
-
### `snaptrade.experimentalEndpoints.getAccountDetails`<a id="snaptradeexperimentalendpointsgetaccountdetails"></a>
|
|
1931
|
-
|
|
1932
|
-
Experimental and subject to change without notice.
|
|
1933
|
-
|
|
1934
|
-
Returns the specified account for the authenticated user, using the `kind`-discriminated account shape. Use the `kind` discriminator to determine the shape of the account, which can be an investment, deposit, or line of credit account.
|
|
1935
|
-
|
|
1936
|
-
On Pay as you Go / Real-time, this endpoint refreshes the account's opening date and total net value (`net_value`) live from the institution on each call, along with funding date for `investment` accounts.
|
|
1937
|
-
|
|
1938
|
-
On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by institution. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
1939
|
-
|
|
1940
|
-
Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.
|
|
1941
|
-
|
|
1942
|
-
If the connection has become disabled, it can no longer access the latest data from the institution, 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.
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1946
|
-
|
|
1947
|
-
##### Commercial API Key Auth<a id="commercial-api-key-auth"></a>
|
|
1948
|
-
|
|
1949
|
-
```typescript
|
|
1950
|
-
const getAccountDetailsResponse =
|
|
1951
|
-
await commercialApiKeyClient.experimentalEndpoints.getAccountDetails({
|
|
1952
|
-
accountId: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
1953
|
-
userId: "snaptrade-user-123",
|
|
1954
|
-
userSecret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1955
|
-
});
|
|
1956
|
-
```
|
|
1957
|
-
|
|
1958
|
-
Required credentials for this mode:
|
|
1959
|
-
|
|
1960
|
-
- `userId` (string, required): 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.
|
|
1961
|
-
|
|
1962
|
-
- `userSecret` (string, required): 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](/reference/Authentication/Authentication_resetSnapTradeUserSecret).
|
|
1963
|
-
|
|
1964
|
-
##### Personal API Key Auth<a id="personal-api-key-auth"></a>
|
|
1965
|
-
|
|
1966
|
-
```typescript
|
|
1967
|
-
const getAccountDetailsResponse =
|
|
1968
|
-
await personalApiKeyClient.experimentalEndpoints.getAccountDetails({
|
|
1969
|
-
accountId: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
1970
|
-
});
|
|
1971
|
-
```
|
|
1972
|
-
|
|
1973
|
-
The client identifies the user in this mode. Do not pass `userId` `userSecret` to this method.
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1977
|
-
|
|
1978
|
-
##### accountId: `string`<a id="accountid-string"></a>
|
|
1979
|
-
|
|
1980
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
1981
|
-
|
|
1982
|
-
[ConnectionAccount](./models/connection-account.ts)
|
|
1983
|
-
|
|
1984
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1985
|
-
|
|
1986
|
-
`/accounts/{accountId}/details` `GET`
|
|
1987
|
-
|
|
1988
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1989
|
-
|
|
1990
|
-
---
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
2047
|
### `snaptrade.experimentalEndpoints.getUserAccountOrderDetailV2`<a id="snaptradeexperimentalendpointsgetuseraccountorderdetailv2"></a>
|
|
1994
2048
|
|
|
1995
2049
|
Returns the detail of a single order using the brokerage order ID provided as a path parameter.
|
|
@@ -2192,58 +2246,6 @@ Defaults to true. Indicates if request should fetch only executed orders. Set to
|
|
|
2192
2246
|
---
|
|
2193
2247
|
|
|
2194
2248
|
|
|
2195
|
-
### `snaptrade.experimentalEndpoints.listAllUserAccounts`<a id="snaptradeexperimentalendpointslistalluseraccounts"></a>
|
|
2196
|
-
|
|
2197
|
-
Experimental and subject to change without notice.
|
|
2198
|
-
|
|
2199
|
-
Returns all accounts across all connections known to SnapTrade for the authenticated user.
|
|
2200
|
-
|
|
2201
|
-
The `results` list can contain multiple account kinds in the same response, including investment, deposit, and line of credit accounts. Use the `kind` discriminator to determine the shape for each account.
|
|
2202
|
-
|
|
2203
|
-
This endpoint returns Daily data regardless of the customer's plan. Daily data is cached and refreshed once a day, which makes this endpoint fast and well-suited to listing accounts across all of a user's connections in a single call. Exact refresh timing may vary by institution. To get real-time data on Pay as you Go / Real-time, use the [list accounts for a connection endpoint](/reference/Connections/Connections_listConnectionAccounts). Customers on Pay as you Go / Daily can force a refresh with the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
2207
|
-
|
|
2208
|
-
##### Commercial API Key Auth<a id="commercial-api-key-auth"></a>
|
|
2209
|
-
|
|
2210
|
-
```typescript
|
|
2211
|
-
const listAllUserAccountsResponse =
|
|
2212
|
-
await commercialApiKeyClient.experimentalEndpoints.listAllUserAccounts({
|
|
2213
|
-
userId: "snaptrade-user-123",
|
|
2214
|
-
userSecret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
2215
|
-
});
|
|
2216
|
-
```
|
|
2217
|
-
|
|
2218
|
-
Required credentials for this mode:
|
|
2219
|
-
|
|
2220
|
-
- `userId` (string, required): 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.
|
|
2221
|
-
|
|
2222
|
-
- `userSecret` (string, required): 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](/reference/Authentication/Authentication_resetSnapTradeUserSecret).
|
|
2223
|
-
|
|
2224
|
-
##### Personal API Key Auth<a id="personal-api-key-auth"></a>
|
|
2225
|
-
|
|
2226
|
-
```typescript
|
|
2227
|
-
const listAllUserAccountsResponse =
|
|
2228
|
-
await personalApiKeyClient.experimentalEndpoints.listAllUserAccounts();
|
|
2229
|
-
```
|
|
2230
|
-
|
|
2231
|
-
The client identifies the user in this mode. Do not pass `userId` `userSecret` to this method.
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
2235
|
-
|
|
2236
|
-
[AllUserAccountsResponse](./models/all-user-accounts-response.ts)
|
|
2237
|
-
|
|
2238
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
2239
|
-
|
|
2240
|
-
`/accounts/all` `GET`
|
|
2241
|
-
|
|
2242
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
2243
|
-
|
|
2244
|
-
---
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
2249
|
### `snaptrade.experimentalEndpoints.listSubscriptions`<a id="snaptradeexperimentalendpointslistsubscriptions"></a>
|
|
2248
2250
|
|
|
2249
2251
|
Returns active Trade Detection subscriptions for your Client ID. Cancelled subscriptions are not returned.
|