snaptrade-typescript-sdk 13.2.3 → 13.2.5
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 +72 -6
- package/dist/browser.umd.js +1 -1
- package/dist/index.cjs +140 -21
- package/dist/index.d.cts +244 -31
- package/dist/index.d.mts +244 -31
- package/dist/index.d.ts +244 -31
- package/dist/index.mjs +140 -21
- 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/13.2.5)
|
|
67
67
|
[](https://snaptrade.com/)
|
|
68
68
|
|
|
69
69
|
</div>
|
|
@@ -111,6 +111,7 @@ See https://docs.snaptrade.com/docs/ratelimiting.
|
|
|
111
111
|
* [`snaptrade.connections.syncBrokerageAuthorizationTransactions`](#snaptradeconnectionssyncbrokerageauthorizationtransactions)
|
|
112
112
|
* [`snaptrade.experimentalEndpoints.addSubscription`](#snaptradeexperimentalendpointsaddsubscription)
|
|
113
113
|
* [`snaptrade.experimentalEndpoints.cancelSubscription`](#snaptradeexperimentalendpointscancelsubscription)
|
|
114
|
+
* [`snaptrade.experimentalEndpoints.getAccountOrder`](#snaptradeexperimentalendpointsgetaccountorder)
|
|
114
115
|
* [`snaptrade.experimentalEndpoints.getAllAccountOrders`](#snaptradeexperimentalendpointsgetallaccountorders)
|
|
115
116
|
* [`snaptrade.experimentalEndpoints.getAllAccountRecentOrders`](#snaptradeexperimentalendpointsgetallaccountrecentorders)
|
|
116
117
|
* [`snaptrade.experimentalEndpoints.getUserAccountOrderDetailV2`](#snaptradeexperimentalendpointsgetuseraccountorderdetailv2)
|
|
@@ -559,7 +560,7 @@ The client identifies the user in this mode. Do not pass `userId` `userSecret` t
|
|
|
559
560
|
|
|
560
561
|
### `snaptrade.accountInformation.getAccountDetails`<a id="snaptradeaccountinformationgetaccountdetails"></a>
|
|
561
562
|
|
|
562
|
-
Returns the specified account for the authenticated user. The account can be an investment, deposit, line of credit, or
|
|
563
|
+
Returns the specified account for the authenticated user. The account can be an investment, deposit, line of credit, annuity, or mortgage account. Use the `kind` discriminator to determine the schema for the account.
|
|
563
564
|
|
|
564
565
|
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.
|
|
565
566
|
|
|
@@ -774,7 +775,7 @@ The client identifies the user in this mode. Do not pass `userId` `userSecret` t
|
|
|
774
775
|
### `snaptrade.accountInformation.getUserAccountDetails`<a id="snaptradeaccountinformationgetuseraccountdetails"></a>
|
|
775
776
|

|
|
776
777
|
|
|
777
|
-
**Deprecated.** Use the [get account details](/reference/Account%20Information/AccountInformation_getAccountDetails) endpoint instead, which supports all account types, including investment, deposit, line of credit, and
|
|
778
|
+
**Deprecated.** Use the [get account details](/reference/Account%20Information/AccountInformation_getAccountDetails) endpoint instead, which supports all account types, including investment, deposit, line of credit, annuity, and mortgage accounts.
|
|
778
779
|
|
|
779
780
|
Returns account detail known to SnapTrade for the specified account.
|
|
780
781
|
|
|
@@ -1219,7 +1220,7 @@ The client identifies the user in this mode. Do not pass `userId` `userSecret` t
|
|
|
1219
1220
|
|
|
1220
1221
|
Returns all accounts across all connections known to SnapTrade for the authenticated user.
|
|
1221
1222
|
|
|
1222
|
-
The `results` list can contain multiple account types in the same response, including investment, deposit, line of credit, and
|
|
1223
|
+
The `results` list can contain multiple account types in the same response, including investment, deposit, line of credit, annuity, and mortgage accounts. Use the `kind` discriminator to determine the schema for each account.
|
|
1223
1224
|
|
|
1224
1225
|
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).
|
|
1225
1226
|
|
|
@@ -1277,7 +1278,7 @@ The client identifies the user in this mode. Do not pass `userId` `userSecret` t
|
|
|
1277
1278
|
### `snaptrade.accountInformation.listUserAccounts`<a id="snaptradeaccountinformationlistuseraccounts"></a>
|
|
1278
1279
|

|
|
1279
1280
|
|
|
1280
|
-
**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, line of credit, and
|
|
1281
|
+
**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, line of credit, annuity, and mortgage accounts.
|
|
1281
1282
|
|
|
1282
1283
|
Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user.
|
|
1283
1284
|
|
|
@@ -1999,7 +2000,7 @@ The client identifies the user in this mode. Do not pass `userId` `userSecret` t
|
|
|
1999
2000
|
|
|
2000
2001
|
Returns all accounts that belong to the specified connection for the authenticated user.
|
|
2001
2002
|
|
|
2002
|
-
The `results` list can contain multiple account types in the same response, including investment, deposit, line of credit, and
|
|
2003
|
+
The `results` list can contain multiple account types in the same response, including investment, deposit, line of credit, annuity, and mortgage accounts. Use the `kind` discriminator to determine the schema for each account.
|
|
2003
2004
|
|
|
2004
2005
|
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.
|
|
2005
2006
|
|
|
@@ -2369,6 +2370,71 @@ Unique identifier for the connected brokerage account. This is the UUID used to
|
|
|
2369
2370
|
---
|
|
2370
2371
|
|
|
2371
2372
|
|
|
2373
|
+
### `snaptrade.experimentalEndpoints.getAccountOrder`<a id="snaptradeexperimentalendpointsgetaccountorder"></a>
|
|
2374
|
+
|
|
2375
|
+
Returns the detail of a single order, identified by the brokerage order ID in the path, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`.
|
|
2376
|
+
|
|
2377
|
+
The order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. Multi-leg orders are a single order with multiple legs.
|
|
2378
|
+
|
|
2379
|
+
This endpoint is always realtime and does not rely on cached data, except that an order in a terminal state (executed, canceled, rejected, failed, expired, replaced) may be served from a short-lived cache since it can no longer change.
|
|
2380
|
+
|
|
2381
|
+
This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
2382
|
+
|
|
2383
|
+
**Experimental:** this endpoint may change without notice.
|
|
2384
|
+
|
|
2385
|
+
|
|
2386
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
2387
|
+
|
|
2388
|
+
##### Commercial API Key Auth<a id="commercial-api-key-auth"></a>
|
|
2389
|
+
|
|
2390
|
+
```typescript
|
|
2391
|
+
const getAccountOrderResponse =
|
|
2392
|
+
await commercialApiKeyClient.experimentalEndpoints.getAccountOrder({
|
|
2393
|
+
accountId: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
2394
|
+
brokerageOrderId: "66a033fa-da74-4fcf-b527-feefdec9257e",
|
|
2395
|
+
userId: "snaptrade-user-123",
|
|
2396
|
+
userSecret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
2397
|
+
});
|
|
2398
|
+
```
|
|
2399
|
+
|
|
2400
|
+
Required credentials for this mode:
|
|
2401
|
+
|
|
2402
|
+
- `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.
|
|
2403
|
+
|
|
2404
|
+
- `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).
|
|
2405
|
+
|
|
2406
|
+
##### Personal API Key Auth<a id="personal-api-key-auth"></a>
|
|
2407
|
+
|
|
2408
|
+
```typescript
|
|
2409
|
+
const getAccountOrderResponse =
|
|
2410
|
+
await personalApiKeyClient.experimentalEndpoints.getAccountOrder({
|
|
2411
|
+
accountId: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
2412
|
+
brokerageOrderId: "66a033fa-da74-4fcf-b527-feefdec9257e",
|
|
2413
|
+
});
|
|
2414
|
+
```
|
|
2415
|
+
|
|
2416
|
+
The client identifies the user in this mode. Do not pass `userId` `userSecret` to this method.
|
|
2417
|
+
|
|
2418
|
+
|
|
2419
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
2420
|
+
|
|
2421
|
+
##### accountId: `string`<a id="accountid-string"></a>
|
|
2422
|
+
|
|
2423
|
+
##### brokerageOrderId: `string`<a id="brokerageorderid-string"></a>
|
|
2424
|
+
|
|
2425
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
2426
|
+
|
|
2427
|
+
[AccountOrder](./models/account-order.ts)
|
|
2428
|
+
|
|
2429
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
2430
|
+
|
|
2431
|
+
`/accounts/{accountId}/orders/{brokerageOrderId}` `GET`
|
|
2432
|
+
|
|
2433
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
2434
|
+
|
|
2435
|
+
---
|
|
2436
|
+
|
|
2437
|
+
|
|
2372
2438
|
### `snaptrade.experimentalEndpoints.getAllAccountOrders`<a id="snaptradeexperimentalendpointsgetallaccountorders"></a>
|
|
2373
2439
|
|
|
2374
2440
|
Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`.
|