snaptrade 2.0.33 → 2.0.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/README.md +81 -54
- data/lib/snaptrade/api/account_information_api.rb +74 -56
- data/lib/snaptrade/api/authentication_api.rb +44 -46
- data/lib/snaptrade/api/connections_api.rb +8 -8
- data/lib/snaptrade/api/options_api.rb +16 -12
- data/lib/snaptrade/api/transactions_and_reporting_api.rb +36 -28
- data/lib/snaptrade/models/account.rb +11 -2
- data/lib/snaptrade/models/account_balance_total.rb +1 -8
- data/lib/snaptrade/models/account_holdings_account.rb +1 -1
- data/lib/snaptrade/models/account_order_record.rb +1 -1
- data/lib/snaptrade/models/account_order_record_universal_symbol.rb +2 -2
- data/lib/snaptrade/models/account_simple.rb +4 -1
- data/lib/snaptrade/models/account_sync_status.rb +1 -1
- data/lib/snaptrade/models/balance.rb +1 -1
- data/lib/snaptrade/models/{snap_trade_holdings_account_account_id_balance.rb → balance_currency.rb} +33 -12
- data/lib/snaptrade/models/delete_user_response.rb +12 -3
- data/lib/snaptrade/models/holdings_status.rb +4 -4
- data/lib/snaptrade/models/login_redirect_uri.rb +3 -2
- data/lib/snaptrade/models/snap_trade_login_user_request_body.rb +10 -6
- data/lib/snaptrade/models/symbol.rb +16 -10
- data/lib/snaptrade/models/{universal_symbol_currency.rb → symbol_currency.rb} +3 -3
- data/lib/snaptrade/models/{universal_symbol_exchange.rb → symbol_exchange.rb} +3 -3
- data/lib/snaptrade/models/transactions_status.rb +4 -5
- data/lib/snaptrade/models/underlying_symbol.rb +1 -1
- data/lib/snaptrade/models/universal_activity.rb +91 -81
- data/lib/snaptrade/models/{amount.rb → universal_activity_currency.rb} +36 -19
- data/lib/snaptrade/models/{snap_trade_holdings_account_account_id.rb → universal_activity_option_symbol.rb} +83 -82
- data/lib/snaptrade/models/universal_activity_symbol.rb +304 -0
- data/lib/snaptrade/models/universal_symbol.rb +2 -2
- data/lib/snaptrade/models/user_i_dand_secret.rb +1 -1
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +6 -5
- data/spec/api/account_information_api_spec.rb +13 -13
- data/spec/api/authentication_api_spec.rb +7 -7
- data/spec/api/connections_api_spec.rb +2 -2
- data/spec/api/options_api_spec.rb +3 -3
- data/spec/api/transactions_and_reporting_api_spec.rb +7 -7
- data/spec/models/{universal_symbol_currency_spec.rb → balance_currency_spec.rb} +6 -6
- data/spec/models/delete_user_response_spec.rb +6 -0
- data/spec/models/symbol_currency_spec.rb +41 -0
- data/spec/models/{universal_symbol_exchange_spec.rb → symbol_exchange_spec.rb} +6 -6
- data/spec/models/symbol_spec.rb +1 -1
- data/spec/models/universal_activity_currency_spec.rb +41 -0
- data/spec/models/universal_activity_option_symbol_spec.rb +65 -0
- data/spec/models/universal_activity_spec.rb +15 -15
- data/spec/models/{snap_trade_holdings_account_account_id_spec.rb → universal_activity_symbol_spec.rb} +14 -20
- metadata +20 -17
- data/spec/models/amount_spec.rb +0 -35
- data/spec/models/snap_trade_holdings_account_account_id_balance_spec.rb +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 412464fcddf65f80c586296c40db02443337c3b5c9b73ce2a2e8e4f81c891aeb
|
4
|
+
data.tar.gz: e7e919ba8ad6b10761c8a3e1b91533476505f4f07182d3a7537ebdcaef635103
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 538898f098a7968e48652fd208d7a1991957786d042babc3a90642ddf8a909b23329eb66bd10bdda24511314648a90ff9d3edb48a48e107d9f8afcf8ff7dba62
|
7
|
+
data.tar.gz: 1dd27dcf92043d041ef2f9e5bf915dcff7b9ecb504c29c8d458ce32017bc19e91febb42572a80ed4f0c9e1d1a6d0ba15486caf5aeaa16dcaf4406df4e07a3cad
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
snaptrade (2.0.
|
4
|
+
snaptrade (2.0.35)
|
5
5
|
faraday (>= 1.0.1, < 3.0)
|
6
6
|
faraday-multipart (~> 1.0, >= 1.0.4)
|
7
7
|
|
@@ -28,7 +28,7 @@ GEM
|
|
28
28
|
reline (>= 0.3.0)
|
29
29
|
method_source (1.1.0)
|
30
30
|
multipart-post (2.4.1)
|
31
|
-
parallel (1.26.
|
31
|
+
parallel (1.26.3)
|
32
32
|
parser (3.3.4.2)
|
33
33
|
ast (~> 2.4.1)
|
34
34
|
racc
|
@@ -68,7 +68,7 @@ GEM
|
|
68
68
|
rubocop-ast (>= 1.2.0, < 2.0)
|
69
69
|
ruby-progressbar (~> 1.7)
|
70
70
|
unicode-display_width (>= 1.4.0, < 3.0)
|
71
|
-
rubocop-ast (1.32.
|
71
|
+
rubocop-ast (1.32.1)
|
72
72
|
parser (>= 3.3.1.0)
|
73
73
|
ruby-progressbar (1.13.0)
|
74
74
|
ruby2_keywords (0.0.5)
|
data/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
|
-
[![npm](https://img.shields.io/badge/gem-v2.0.
|
9
|
+
[![npm](https://img.shields.io/badge/gem-v2.0.35-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.35)
|
10
10
|
[![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](https://snaptrade.com/)
|
11
11
|
|
12
12
|
</div>
|
@@ -70,7 +70,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
70
70
|
Add to Gemfile:
|
71
71
|
|
72
72
|
```ruby
|
73
|
-
gem 'snaptrade', '~> 2.0.
|
73
|
+
gem 'snaptrade', '~> 2.0.35'
|
74
74
|
```
|
75
75
|
|
76
76
|
## Getting Started<a id="getting-started"></a>
|
@@ -134,7 +134,7 @@ p result
|
|
134
134
|
##### user_id: `String`<a id="user_id-string"></a>
|
135
135
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
136
136
|
##### brokerage_authorizations: `String`<a id="brokerage_authorizations-string"></a>
|
137
|
-
Optional. Comma
|
137
|
+
Optional. Comma separated list of authorization IDs (only use if filtering is
|
138
138
|
needed on one or more authorizations).
|
139
139
|
|
140
140
|
#### 🔄 Return<a id="🔄-return"></a>
|
@@ -152,7 +152,10 @@ needed on one or more authorizations).
|
|
152
152
|
|
153
153
|
### `snaptrade.account_information.get_user_account_balance`<a id="snaptradeaccount_informationget_user_account_balance"></a>
|
154
154
|
|
155
|
-
|
155
|
+
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).
|
156
|
+
|
157
|
+
The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
158
|
+
|
156
159
|
|
157
160
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
158
161
|
|
@@ -170,8 +173,6 @@ p result
|
|
170
173
|
##### user_id: `String`<a id="user_id-string"></a>
|
171
174
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
172
175
|
##### account_id: `String`<a id="account_id-string"></a>
|
173
|
-
The ID of the account to get balances.
|
174
|
-
|
175
176
|
#### 🔄 Return<a id="🔄-return"></a>
|
176
177
|
|
177
178
|
[Balance](./lib/snaptrade/models/balance.rb)
|
@@ -187,8 +188,9 @@ The ID of the account to get balances.
|
|
187
188
|
|
188
189
|
### `snaptrade.account_information.get_user_account_details`<a id="snaptradeaccount_informationget_user_account_details"></a>
|
189
190
|
|
190
|
-
Returns
|
191
|
-
|
191
|
+
Returns account detail known to SnapTrade for the specified account.
|
192
|
+
|
193
|
+
The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
192
194
|
|
193
195
|
|
194
196
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
@@ -207,8 +209,6 @@ p result
|
|
207
209
|
##### user_id: `String`<a id="user_id-string"></a>
|
208
210
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
209
211
|
##### account_id: `String`<a id="account_id-string"></a>
|
210
|
-
The ID of the account to get detail of.
|
211
|
-
|
212
212
|
#### 🔄 Return<a id="🔄-return"></a>
|
213
213
|
|
214
214
|
[Account](./lib/snaptrade/models/account.rb)
|
@@ -224,7 +224,10 @@ The ID of the account to get detail of.
|
|
224
224
|
|
225
225
|
### `snaptrade.account_information.get_user_account_orders`<a id="snaptradeaccount_informationget_user_account_orders"></a>
|
226
226
|
|
227
|
-
|
227
|
+
Returns a list of recent orders in the specified account.
|
228
|
+
|
229
|
+
The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
230
|
+
|
228
231
|
|
229
232
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
230
233
|
|
@@ -244,8 +247,6 @@ p result
|
|
244
247
|
##### user_id: `String`<a id="user_id-string"></a>
|
245
248
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
246
249
|
##### account_id: `String`<a id="account_id-string"></a>
|
247
|
-
The ID of the account to get orders.
|
248
|
-
|
249
250
|
##### state: `String`<a id="state-string"></a>
|
250
251
|
defaults value is set to \"all\"
|
251
252
|
|
@@ -268,7 +269,10 @@ Number of days in the past to fetch the most recent orders. Defaults to the last
|
|
268
269
|
|
269
270
|
### `snaptrade.account_information.get_user_account_positions`<a id="snaptradeaccount_informationget_user_account_positions"></a>
|
270
271
|
|
271
|
-
Returns a list of positions in the specified account.
|
272
|
+
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).
|
273
|
+
|
274
|
+
The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
275
|
+
|
272
276
|
|
273
277
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
274
278
|
|
@@ -286,8 +290,6 @@ p result
|
|
286
290
|
##### user_id: `String`<a id="user_id-string"></a>
|
287
291
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
288
292
|
##### account_id: `String`<a id="account_id-string"></a>
|
289
|
-
The ID of the account to get positions.
|
290
|
-
|
291
293
|
#### 🔄 Return<a id="🔄-return"></a>
|
292
294
|
|
293
295
|
[Position](./lib/snaptrade/models/position.rb)
|
@@ -303,7 +305,7 @@ The ID of the account to get positions.
|
|
303
305
|
|
304
306
|
### `snaptrade.account_information.get_user_holdings`<a id="snaptradeaccount_informationget_user_holdings"></a>
|
305
307
|
|
306
|
-
|
308
|
+
Returns a list of balances, positions, and recent orders for the specified account. The data returned is similar to the data returned over the more fine-grained [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getUserAccountPositions) and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders) endpoints. __The finer-grained APIs are preferred. They are easier to work with, faster, and have better error handling than this coarse-grained API.__
|
307
309
|
|
308
310
|
The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
309
311
|
|
@@ -339,7 +341,10 @@ p result
|
|
339
341
|
|
340
342
|
### `snaptrade.account_information.list_user_accounts`<a id="snaptradeaccount_informationlist_user_accounts"></a>
|
341
343
|
|
342
|
-
|
344
|
+
Returns all brokerage accounts known to SnapTrade for the authenticated user.
|
345
|
+
|
346
|
+
The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
347
|
+
|
343
348
|
|
344
349
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
345
350
|
|
@@ -429,7 +434,7 @@ p result
|
|
429
434
|
|
430
435
|
### `snaptrade.authentication.delete_snap_trade_user`<a id="snaptradeauthenticationdelete_snap_trade_user"></a>
|
431
436
|
|
432
|
-
Deletes a user
|
437
|
+
Deletes a registered user and all associated data. This action is irreversible. This API is asynchronous and will return a 200 status code if the request is accepted. The user and all associated data will be queued for deletion. Once deleted, a `USER_DELETED` webhook will be sent.
|
433
438
|
|
434
439
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
435
440
|
|
@@ -458,7 +463,7 @@ p result
|
|
458
463
|
|
459
464
|
### `snaptrade.authentication.list_snap_trade_users`<a id="snaptradeauthenticationlist_snap_trade_users"></a>
|
460
465
|
|
461
|
-
Returns a list of
|
466
|
+
Returns a list of all registered user IDs.
|
462
467
|
|
463
468
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
464
469
|
|
@@ -491,7 +496,7 @@ result = snaptrade.authentication.login_snap_trade_user(
|
|
491
496
|
custom_redirect: "https://snaptrade.com",
|
492
497
|
reconnect: "8b5f262d-4bb9-365d-888a-202bd3b15fa1",
|
493
498
|
connection_type: "read",
|
494
|
-
connection_portal_version: "
|
499
|
+
connection_portal_version: "v3",
|
495
500
|
)
|
496
501
|
p result
|
497
502
|
```
|
@@ -501,27 +506,36 @@ p result
|
|
501
506
|
##### user_id: `String`<a id="user_id-string"></a>
|
502
507
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
503
508
|
##### broker: `String`<a id="broker-string"></a>
|
504
|
-
Slug of the brokerage to connect the user to. See [
|
505
|
-
|
509
|
+
Slug of the brokerage to connect the user to. See [the integrations
|
510
|
+
page](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=3cfea70ef4254afc89704e47275a7a9a&pvs=4)
|
506
511
|
for a list of supported brokerages and their slugs.
|
507
512
|
|
508
513
|
##### immediateRedirect: `Boolean`<a id="immediateredirect-boolean"></a>
|
509
|
-
When set to
|
510
|
-
the connection portal
|
514
|
+
When set to `true`, user will be redirected back to the partner's site instead
|
515
|
+
of the connection portal. This parameter is ignored if the connection portal is
|
516
|
+
loaded inside an iframe. See the [guide on ways to integrate the connection
|
517
|
+
portal](https://docs.snaptrade.com/docs/implement-connection-portal) for more
|
518
|
+
information.
|
511
519
|
|
512
520
|
##### customRedirect: `String`<a id="customredirect-string"></a>
|
513
|
-
URL to redirect the user to after the user connects their brokerage account
|
521
|
+
URL to redirect the user to after the user connects their brokerage account.
|
522
|
+
This parameter is ignored if the connection portal is loaded inside an iframe.
|
523
|
+
See the [guide on ways to integrate the connection
|
524
|
+
portal](https://docs.snaptrade.com/docs/implement-connection-portal) for more
|
525
|
+
information.
|
514
526
|
|
515
527
|
##### reconnect: `String`<a id="reconnect-string"></a>
|
516
528
|
The UUID of the brokerage connection to be reconnected. This parameter should be
|
517
|
-
left empty unless you are reconnecting a disabled connection. See
|
518
|
-
|
529
|
+
left empty unless you are reconnecting a disabled connection. See the [guide on
|
530
|
+
fixing broken
|
531
|
+
connections](https://docs.snaptrade.com/docs/fix-broken-connections) for more
|
532
|
+
information.
|
519
533
|
|
520
534
|
##### connectionType: [`ConnectionType`](./lib/snaptrade/models/connection_type.rb)<a id="connectiontype-connectiontypelibsnaptrademodelsconnection_typerb"></a>
|
521
|
-
Sets whether the connection should be read or trade
|
535
|
+
Sets whether the connection should be read-only or trade-enabled.
|
522
536
|
|
523
537
|
##### connectionPortalVersion: [`ConnectionPortalVersion`](./lib/snaptrade/models/connection_portal_version.rb)<a id="connectionportalversion-connectionportalversionlibsnaptrademodelsconnection_portal_versionrb"></a>
|
524
|
-
Sets the version of the connection portal to render
|
538
|
+
Sets the version of the connection portal to render.
|
525
539
|
|
526
540
|
#### 🔄 Return<a id="🔄-return"></a>
|
527
541
|
|
@@ -574,8 +588,7 @@ immutable.
|
|
574
588
|
|
575
589
|
### `snaptrade.authentication.reset_snap_trade_user_secret`<a id="snaptradeauthenticationreset_snap_trade_user_secret"></a>
|
576
590
|
|
577
|
-
|
578
|
-
is compromised. Please note that if you call this endpoint and fail to save the new secret, you'll no longer be able to access any data for this user, and your only option will be to delete and recreate the user, then ask them to reconnect.
|
591
|
+
Rotates the secret for a SnapTrade user. You might use this if `userSecret` is compromised. Please note that if you call this endpoint and fail to save the new secret, you'll no longer be able to access any data for this user, and your only option will be to delete and recreate the user, then ask them to reconnect.
|
579
592
|
|
580
593
|
|
581
594
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
@@ -598,7 +611,8 @@ immutable.
|
|
598
611
|
|
599
612
|
##### userSecret: `String`<a id="usersecret-string"></a>
|
600
613
|
SnapTrade User Secret randomly generated by SnapTrade. This is privileged
|
601
|
-
information and if compromised, should be rotated via the
|
614
|
+
information and if compromised, should be rotated via the [rotate user secret
|
615
|
+
endpoint](/reference/Authentication/Authentication_resetSnapTradeUserSecret)
|
602
616
|
|
603
617
|
#### 🔄 Return<a id="🔄-return"></a>
|
604
618
|
|
@@ -798,11 +812,11 @@ p result
|
|
798
812
|
|
799
813
|
##### partner_client_id: `String`<a id="partner_client_id-string"></a>
|
800
814
|
##### user_id: `String`<a id="user_id-string"></a>
|
801
|
-
Optional comma
|
815
|
+
Optional comma separated list of user IDs used to filter the request on specific
|
802
816
|
users
|
803
817
|
|
804
818
|
##### session_id: `String`<a id="session_id-string"></a>
|
805
|
-
Optional comma
|
819
|
+
Optional comma separated list of session IDs used to filter the request on
|
806
820
|
specific users
|
807
821
|
|
808
822
|
#### 🔄 Return<a id="🔄-return"></a>
|
@@ -947,7 +961,9 @@ Option strategy id obtained from response when creating option strategy object
|
|
947
961
|
|
948
962
|
### `snaptrade.options.list_option_holdings`<a id="snaptradeoptionslist_option_holdings"></a>
|
949
963
|
|
950
|
-
Returns a list of
|
964
|
+
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).
|
965
|
+
|
966
|
+
The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
951
967
|
|
952
968
|
|
953
969
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
@@ -956,7 +972,7 @@ Returns a list of Options Positions.
|
|
956
972
|
result = snaptrade.options.list_option_holdings(
|
957
973
|
user_id: "snaptrade-user-123",
|
958
974
|
user_secret: "USERSECRET123",
|
959
|
-
account_id: "
|
975
|
+
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
960
976
|
)
|
961
977
|
p result
|
962
978
|
```
|
@@ -966,8 +982,6 @@ p result
|
|
966
982
|
##### user_id: `String`<a id="user_id-string"></a>
|
967
983
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
968
984
|
##### account_id: `String`<a id="account_id-string"></a>
|
969
|
-
The ID of the account to fetch options holdings for.
|
970
|
-
|
971
985
|
#### 🔄 Return<a id="🔄-return"></a>
|
972
986
|
|
973
987
|
[OptionsPosition](./lib/snaptrade/models/options_position.rb)
|
@@ -1590,7 +1604,12 @@ responding to the request
|
|
1590
1604
|
|
1591
1605
|
### `snaptrade.transactions_and_reporting.get_activities`<a id="snaptradetransactions_and_reportingget_activities"></a>
|
1592
1606
|
|
1593
|
-
Returns
|
1607
|
+
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.
|
1608
|
+
|
1609
|
+
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.
|
1610
|
+
|
1611
|
+
The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
1612
|
+
|
1594
1613
|
|
1595
1614
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
1596
1615
|
|
@@ -1602,7 +1621,7 @@ result = snaptrade.transactions_and_reporting.get_activities(
|
|
1602
1621
|
end_date: "2022-01-24",
|
1603
1622
|
accounts: "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
|
1604
1623
|
brokerage_authorizations: "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
|
1605
|
-
type: "DIVIDEND",
|
1624
|
+
type: "BUY,SELL,DIVIDEND",
|
1606
1625
|
)
|
1607
1626
|
p result
|
1608
1627
|
```
|
@@ -1612,24 +1631,32 @@ p result
|
|
1612
1631
|
##### user_id: `String`<a id="user_id-string"></a>
|
1613
1632
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
1614
1633
|
##### start_date: `Date`<a id="start_date-date"></a>
|
1634
|
+
The start date (inclusive) of the transaction history to retrieve. If not
|
1635
|
+
provided, the default is the first transaction known to SnapTrade based on
|
1636
|
+
`trade_date`.
|
1637
|
+
|
1615
1638
|
##### end_date: `Date`<a id="end_date-date"></a>
|
1639
|
+
The end date (inclusive) of the transaction history to retrieve. If not
|
1640
|
+
provided, the default is the last transaction known to SnapTrade based on
|
1641
|
+
`trade_date`.
|
1642
|
+
|
1616
1643
|
##### accounts: `String`<a id="accounts-string"></a>
|
1617
|
-
Optional comma
|
1618
|
-
specific accounts
|
1644
|
+
Optional comma separated list of SnapTrade Account IDs used to filter the
|
1645
|
+
request to specific accounts. If not provided, the default is all known
|
1646
|
+
brokerage accounts for the user. The `brokerageAuthorizations` parameter takes
|
1647
|
+
precedence over this parameter.
|
1619
1648
|
|
1620
1649
|
##### brokerage_authorizations: `String`<a id="brokerage_authorizations-string"></a>
|
1621
|
-
Optional comma
|
1622
|
-
request
|
1650
|
+
Optional comma separated list of SnapTrade Connection (Brokerage Authorization)
|
1651
|
+
IDs used to filter the request to only accounts that belong to those
|
1652
|
+
connections. If not provided, the default is all connections for the user. This
|
1653
|
+
parameter takes precedence over the `accounts` parameter.
|
1623
1654
|
|
1624
1655
|
##### type: `String`<a id="type-string"></a>
|
1625
|
-
Optional comma
|
1626
|
-
|
1627
|
-
|
1628
|
-
|
1629
|
-
EXTERNAL_ASSET_TRANSFER_OUT - INTERNAL_CASH_TRANSFER_IN -
|
1630
|
-
INTERNAL_CASH_TRANSFER_OUT - INTERNAL_ASSET_TRANSFER_IN -
|
1631
|
-
INTERNAL_ASSET_TRANSFER_OUT - INTEREST - REBATE - GOV_GRANT - TAX - FEE - REI -
|
1632
|
-
FXT
|
1656
|
+
Optional comma separated list of transaction types to filter by. SnapTrade does
|
1657
|
+
a best effort to categorize brokerage transaction types into a common set of
|
1658
|
+
values. Here are some of the most popular values: - BUY - SELL - DIVIDEND -
|
1659
|
+
CONTRIBUTION - WITHDRAWAL - REI - INTEREST - FEE
|
1633
1660
|
|
1634
1661
|
#### 🔄 Return<a id="🔄-return"></a>
|
1635
1662
|
|
@@ -1671,7 +1698,7 @@ p result
|
|
1671
1698
|
##### user_id: `String`<a id="user_id-string"></a>
|
1672
1699
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
1673
1700
|
##### accounts: `String`<a id="accounts-string"></a>
|
1674
|
-
Optional comma
|
1701
|
+
Optional comma separated list of account IDs used to filter the request on
|
1675
1702
|
specific accounts
|
1676
1703
|
|
1677
1704
|
##### detailed: `Boolean`<a id="detailed-boolean"></a>
|