snaptrade 2.0.218 → 3.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.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/README.md +20 -549
- data/lib/snaptrade/api/account_information_api.rb +0 -231
- data/lib/snaptrade/api/connections_api.rb +0 -201
- data/lib/snaptrade/api/experimental_endpoints_api.rb +123 -0
- data/lib/snaptrade/api/reference_data_api.rb +0 -316
- data/lib/snaptrade/api/trading_api.rb +0 -290
- data/lib/snaptrade/models/connection_account.rb +51 -0
- data/lib/snaptrade/models/{connections_session_events200_response_inner.rb → connection_account_sync_status.rb} +35 -77
- data/lib/snaptrade/models/investment_account.rb +372 -0
- data/lib/snaptrade/models/investment_account_market_value.rb +228 -0
- data/lib/snaptrade/models/kind.rb +2 -2
- data/lib/snaptrade/models/stock_instrument.rb +1 -1
- data/lib/snaptrade/models/stock_instrument_kind.rb +36 -0
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +5 -7
- data/spec/api/account_information_api_spec.rb +0 -28
- data/spec/api/connections_api_spec.rb +0 -28
- data/spec/api/experimental_endpoints_api_spec.rb +14 -0
- data/spec/api/reference_data_api_spec.rb +0 -45
- data/spec/api/trading_api_spec.rb +0 -30
- data/spec/getting_started_spec.rb +6 -6
- data/spec/models/connection_account_spec.rb +38 -0
- data/spec/models/connection_account_sync_status_spec.rb +47 -0
- data/spec/models/investment_account_market_value_spec.rb +35 -0
- data/spec/models/investment_account_spec.rb +101 -0
- data/spec/models/stock_instrument_kind_spec.rb +23 -0
- metadata +212 -206
- data/lib/snaptrade/api/options_api.rb +0 -137
- data/lib/snaptrade/api/transactions_and_reporting_api.rb +0 -302
- data/spec/api/options_api_spec.rb +0 -44
- data/spec/api/transactions_and_reporting_api_spec.rb +0 -66
- data/spec/models/connections_session_events200_response_inner_spec.rb +0 -65
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
|
-
[](https://rubygems.org/gems/snaptrade/versions/3.0.0)
|
|
10
10
|
[](https://snaptrade.com/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
@@ -22,12 +22,10 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
22
22
|
* [`snaptrade.account_information.get_account_activities`](#snaptradeaccount_informationget_account_activities)
|
|
23
23
|
* [`snaptrade.account_information.get_account_balance_history`](#snaptradeaccount_informationget_account_balance_history)
|
|
24
24
|
* [`snaptrade.account_information.get_all_account_positions`](#snaptradeaccount_informationget_all_account_positions)
|
|
25
|
-
* [`snaptrade.account_information.get_all_user_holdings`](#snaptradeaccount_informationget_all_user_holdings)
|
|
26
25
|
* [`snaptrade.account_information.get_user_account_balance`](#snaptradeaccount_informationget_user_account_balance)
|
|
27
26
|
* [`snaptrade.account_information.get_user_account_details`](#snaptradeaccount_informationget_user_account_details)
|
|
28
27
|
* [`snaptrade.account_information.get_user_account_order_detail`](#snaptradeaccount_informationget_user_account_order_detail)
|
|
29
28
|
* [`snaptrade.account_information.get_user_account_orders`](#snaptradeaccount_informationget_user_account_orders)
|
|
30
|
-
* [`snaptrade.account_information.get_user_account_positions`](#snaptradeaccount_informationget_user_account_positions)
|
|
31
29
|
* [`snaptrade.account_information.get_user_account_recent_orders`](#snaptradeaccount_informationget_user_account_recent_orders)
|
|
32
30
|
* [`snaptrade.account_information.get_user_account_return_rates`](#snaptradeaccount_informationget_user_account_return_rates)
|
|
33
31
|
* [`snaptrade.account_information.get_user_holdings`](#snaptradeaccount_informationget_user_holdings)
|
|
@@ -45,37 +43,29 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
45
43
|
* [`snaptrade.connections.list_brokerage_authorization_accounts`](#snaptradeconnectionslist_brokerage_authorization_accounts)
|
|
46
44
|
* [`snaptrade.connections.list_brokerage_authorizations`](#snaptradeconnectionslist_brokerage_authorizations)
|
|
47
45
|
* [`snaptrade.connections.refresh_brokerage_authorization`](#snaptradeconnectionsrefresh_brokerage_authorization)
|
|
48
|
-
* [`snaptrade.connections.remove_brokerage_authorization`](#snaptradeconnectionsremove_brokerage_authorization)
|
|
49
46
|
* [`snaptrade.connections.return_rates`](#snaptradeconnectionsreturn_rates)
|
|
50
|
-
* [`snaptrade.connections.session_events`](#snaptradeconnectionssession_events)
|
|
51
47
|
* [`snaptrade.connections.sync_brokerage_authorization_transactions`](#snaptradeconnectionssync_brokerage_authorization_transactions)
|
|
52
48
|
* [`snaptrade.experimental_endpoints.add_subscription`](#snaptradeexperimental_endpointsadd_subscription)
|
|
53
49
|
* [`snaptrade.experimental_endpoints.cancel_subscription`](#snaptradeexperimental_endpointscancel_subscription)
|
|
54
50
|
* [`snaptrade.experimental_endpoints.get_user_account_order_detail_v2`](#snaptradeexperimental_endpointsget_user_account_order_detail_v2)
|
|
55
51
|
* [`snaptrade.experimental_endpoints.get_user_account_orders_v2`](#snaptradeexperimental_endpointsget_user_account_orders_v2)
|
|
56
52
|
* [`snaptrade.experimental_endpoints.get_user_account_recent_orders_v2`](#snaptradeexperimental_endpointsget_user_account_recent_orders_v2)
|
|
53
|
+
* [`snaptrade.experimental_endpoints.list_connection_accounts`](#snaptradeexperimental_endpointslist_connection_accounts)
|
|
57
54
|
* [`snaptrade.experimental_endpoints.list_subscriptions`](#snaptradeexperimental_endpointslist_subscriptions)
|
|
58
|
-
* [`snaptrade.options.list_option_holdings`](#snaptradeoptionslist_option_holdings)
|
|
59
|
-
* [`snaptrade.reference_data.get_currency_exchange_rate_pair`](#snaptradereference_dataget_currency_exchange_rate_pair)
|
|
60
55
|
* [`snaptrade.reference_data.get_partner_info`](#snaptradereference_dataget_partner_info)
|
|
61
|
-
* [`snaptrade.reference_data.get_security_types`](#snaptradereference_dataget_security_types)
|
|
62
56
|
* [`snaptrade.reference_data.get_stock_exchanges`](#snaptradereference_dataget_stock_exchanges)
|
|
63
57
|
* [`snaptrade.reference_data.get_symbols`](#snaptradereference_dataget_symbols)
|
|
64
58
|
* [`snaptrade.reference_data.get_symbols_by_ticker`](#snaptradereference_dataget_symbols_by_ticker)
|
|
65
59
|
* [`snaptrade.reference_data.list_all_brokerage_authorization_type`](#snaptradereference_datalist_all_brokerage_authorization_type)
|
|
66
60
|
* [`snaptrade.reference_data.list_all_brokerage_instruments`](#snaptradereference_datalist_all_brokerage_instruments)
|
|
67
61
|
* [`snaptrade.reference_data.list_all_brokerages`](#snaptradereference_datalist_all_brokerages)
|
|
68
|
-
* [`snaptrade.reference_data.list_all_currencies`](#snaptradereference_datalist_all_currencies)
|
|
69
|
-
* [`snaptrade.reference_data.list_all_currencies_rates`](#snaptradereference_datalist_all_currencies_rates)
|
|
70
62
|
* [`snaptrade.reference_data.symbol_search_user_account`](#snaptradereference_datasymbol_search_user_account)
|
|
71
63
|
* [`snaptrade.trading.cancel_order`](#snaptradetradingcancel_order)
|
|
72
|
-
* [`snaptrade.trading.cancel_user_account_order`](#snaptradetradingcancel_user_account_order)
|
|
73
64
|
* [`snaptrade.trading.get_cryptocurrency_pair_quote`](#snaptradetradingget_cryptocurrency_pair_quote)
|
|
74
65
|
* [`snaptrade.trading.get_option_impact`](#snaptradetradingget_option_impact)
|
|
75
66
|
* [`snaptrade.trading.get_order_impact`](#snaptradetradingget_order_impact)
|
|
76
67
|
* [`snaptrade.trading.get_user_account_option_quotes`](#snaptradetradingget_user_account_option_quotes)
|
|
77
68
|
* [`snaptrade.trading.get_user_account_quotes`](#snaptradetradingget_user_account_quotes)
|
|
78
|
-
* [`snaptrade.trading.place_bracket_order`](#snaptradetradingplace_bracket_order)
|
|
79
69
|
* [`snaptrade.trading.place_complex_order`](#snaptradetradingplace_complex_order)
|
|
80
70
|
* [`snaptrade.trading.place_crypto_order`](#snaptradetradingplace_crypto_order)
|
|
81
71
|
* [`snaptrade.trading.place_force_order`](#snaptradetradingplace_force_order)
|
|
@@ -84,8 +74,6 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
84
74
|
* [`snaptrade.trading.preview_crypto_order`](#snaptradetradingpreview_crypto_order)
|
|
85
75
|
* [`snaptrade.trading.replace_order`](#snaptradetradingreplace_order)
|
|
86
76
|
* [`snaptrade.trading.search_cryptocurrency_pair_instruments`](#snaptradetradingsearch_cryptocurrency_pair_instruments)
|
|
87
|
-
* [`snaptrade.transactions_and_reporting.get_activities`](#snaptradetransactions_and_reportingget_activities)
|
|
88
|
-
* [`snaptrade.transactions_and_reporting.get_reporting_custom_range`](#snaptradetransactions_and_reportingget_reporting_custom_range)
|
|
89
77
|
|
|
90
78
|
<!-- tocstop -->
|
|
91
79
|
|
|
@@ -94,7 +82,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
94
82
|
Add to Gemfile:
|
|
95
83
|
|
|
96
84
|
```ruby
|
|
97
|
-
gem 'snaptrade', '~>
|
|
85
|
+
gem 'snaptrade', '~> 3.0.0'
|
|
98
86
|
```
|
|
99
87
|
|
|
100
88
|
## Getting Started<a id="getting-started"></a>
|
|
@@ -298,49 +286,6 @@ p result
|
|
|
298
286
|
---
|
|
299
287
|
|
|
300
288
|
|
|
301
|
-
### `snaptrade.account_information.get_all_user_holdings`<a id="snaptradeaccount_informationget_all_user_holdings"></a>
|
|
302
|
-

|
|
303
|
-
|
|
304
|
-
**Deprecated.** Use the account-specific holdings endpoint instead.
|
|
305
|
-
|
|
306
|
-
This endpoint will return HTTP 410 Gone for all customers that sign up after April 25, 2026.
|
|
307
|
-
|
|
308
|
-
List all accounts for the user, plus balances, positions, and orders for each
|
|
309
|
-
account.
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
313
|
-
|
|
314
|
-
```ruby
|
|
315
|
-
result = snaptrade.account_information.get_all_user_holdings(
|
|
316
|
-
user_id: "snaptrade-user-123",
|
|
317
|
-
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
318
|
-
brokerage_authorizations: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
319
|
-
)
|
|
320
|
-
p result
|
|
321
|
-
```
|
|
322
|
-
|
|
323
|
-
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
324
|
-
|
|
325
|
-
##### user_id: `String`<a id="user_id-string"></a>
|
|
326
|
-
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
327
|
-
##### brokerage_authorizations: `String`<a id="brokerage_authorizations-string"></a>
|
|
328
|
-
Optional. Comma separated list of authorization IDs (only use if filtering is
|
|
329
|
-
needed on one or more authorizations).
|
|
330
|
-
|
|
331
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
332
|
-
|
|
333
|
-
[AccountHoldings](./lib/snaptrade/models/account_holdings.rb)
|
|
334
|
-
|
|
335
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
336
|
-
|
|
337
|
-
`/holdings` `GET`
|
|
338
|
-
|
|
339
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
340
|
-
|
|
341
|
-
---
|
|
342
|
-
|
|
343
|
-
|
|
344
289
|
### `snaptrade.account_information.get_user_account_balance`<a id="snaptradeaccount_informationget_user_account_balance"></a>
|
|
345
290
|
|
|
346
291
|
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).
|
|
@@ -515,49 +460,6 @@ Number of days in the past to fetch the most recent orders. Defaults to the last
|
|
|
515
460
|
---
|
|
516
461
|
|
|
517
462
|
|
|
518
|
-
### `snaptrade.account_information.get_user_account_positions`<a id="snaptradeaccount_informationget_user_account_positions"></a>
|
|
519
|
-

|
|
520
|
-
|
|
521
|
-
**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.
|
|
522
|
-
|
|
523
|
-
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).
|
|
524
|
-
|
|
525
|
-
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:
|
|
526
|
-
- If you do, this endpoint returns real-time data.
|
|
527
|
-
- 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.
|
|
528
|
-
|
|
529
|
-
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.
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
533
|
-
|
|
534
|
-
```ruby
|
|
535
|
-
result = snaptrade.account_information.get_user_account_positions(
|
|
536
|
-
user_id: "snaptrade-user-123",
|
|
537
|
-
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
538
|
-
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
539
|
-
)
|
|
540
|
-
p result
|
|
541
|
-
```
|
|
542
|
-
|
|
543
|
-
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
544
|
-
|
|
545
|
-
##### user_id: `String`<a id="user_id-string"></a>
|
|
546
|
-
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
547
|
-
##### account_id: `String`<a id="account_id-string"></a>
|
|
548
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
549
|
-
|
|
550
|
-
[Position](./lib/snaptrade/models/position.rb)
|
|
551
|
-
|
|
552
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
553
|
-
|
|
554
|
-
`/accounts/{accountId}/positions` `GET`
|
|
555
|
-
|
|
556
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
557
|
-
|
|
558
|
-
---
|
|
559
|
-
|
|
560
|
-
|
|
561
463
|
### `snaptrade.account_information.get_user_account_recent_orders`<a id="snaptradeaccount_informationget_user_account_recent_orders"></a>
|
|
562
464
|
|
|
563
465
|
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.
|
|
@@ -1203,34 +1105,6 @@ p result
|
|
|
1203
1105
|
---
|
|
1204
1106
|
|
|
1205
1107
|
|
|
1206
|
-
### `snaptrade.connections.remove_brokerage_authorization`<a id="snaptradeconnectionsremove_brokerage_authorization"></a>
|
|
1207
|
-
|
|
1208
|
-
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.
|
|
1209
|
-
|
|
1210
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1211
|
-
|
|
1212
|
-
```ruby
|
|
1213
|
-
snaptrade.connections.remove_brokerage_authorization(
|
|
1214
|
-
authorization_id: "87b24961-b51e-4db8-9226-f198f6518a89",
|
|
1215
|
-
user_id: "snaptrade-user-123",
|
|
1216
|
-
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1217
|
-
)
|
|
1218
|
-
```
|
|
1219
|
-
|
|
1220
|
-
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1221
|
-
|
|
1222
|
-
##### authorization_id: `String`<a id="authorization_id-string"></a>
|
|
1223
|
-
##### user_id: `String`<a id="user_id-string"></a>
|
|
1224
|
-
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
1225
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1226
|
-
|
|
1227
|
-
`/authorizations/{authorizationId}` `DELETE`
|
|
1228
|
-
|
|
1229
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1230
|
-
|
|
1231
|
-
---
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
1108
|
### `snaptrade.connections.return_rates`<a id="snaptradeconnectionsreturn_rates"></a>
|
|
1235
1109
|
|
|
1236
1110
|
Returns a list of rate of return percents for a given connection.
|
|
@@ -1271,45 +1145,6 @@ returns all six supported timeframes.
|
|
|
1271
1145
|
---
|
|
1272
1146
|
|
|
1273
1147
|
|
|
1274
|
-
### `snaptrade.connections.session_events`<a id="snaptradeconnectionssession_events"></a>
|
|
1275
|
-
|
|
1276
|
-
Returns a list of session events associated with a user.
|
|
1277
|
-
|
|
1278
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1279
|
-
|
|
1280
|
-
```ruby
|
|
1281
|
-
result = snaptrade.connections.session_events(
|
|
1282
|
-
partner_client_id: "SNAPTRADETEST",
|
|
1283
|
-
user_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
|
|
1284
|
-
session_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
|
|
1285
|
-
)
|
|
1286
|
-
p result
|
|
1287
|
-
```
|
|
1288
|
-
|
|
1289
|
-
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1290
|
-
|
|
1291
|
-
##### partner_client_id: `String`<a id="partner_client_id-string"></a>
|
|
1292
|
-
##### user_id: `String`<a id="user_id-string"></a>
|
|
1293
|
-
Optional comma separated list of user IDs used to filter the request on specific
|
|
1294
|
-
users
|
|
1295
|
-
|
|
1296
|
-
##### session_id: `String`<a id="session_id-string"></a>
|
|
1297
|
-
Optional comma separated list of session IDs used to filter the request on
|
|
1298
|
-
specific users
|
|
1299
|
-
|
|
1300
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
1301
|
-
|
|
1302
|
-
[ConnectionsSessionEvents200ResponseInner](./lib/snaptrade/models/connections_session_events200_response_inner.rb)
|
|
1303
|
-
|
|
1304
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1305
|
-
|
|
1306
|
-
`/sessionEvents` `GET`
|
|
1307
|
-
|
|
1308
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1309
|
-
|
|
1310
|
-
---
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
1148
|
### `snaptrade.connections.sync_brokerage_authorization_transactions`<a id="snaptradeconnectionssync_brokerage_authorization_transactions"></a>
|
|
1314
1149
|
|
|
1315
1150
|
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
|
|
@@ -1554,96 +1389,68 @@ false to retrieve non executed orders as well
|
|
|
1554
1389
|
---
|
|
1555
1390
|
|
|
1556
1391
|
|
|
1557
|
-
### `snaptrade.experimental_endpoints.
|
|
1558
|
-
|
|
1559
|
-
Returns active Trade Detection subscriptions for your Client ID. Cancelled subscriptions are not returned.
|
|
1560
|
-
|
|
1561
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1562
|
-
|
|
1563
|
-
```ruby
|
|
1564
|
-
result = snaptrade.experimental_endpoints.list_subscriptions
|
|
1565
|
-
p result
|
|
1566
|
-
```
|
|
1567
|
-
|
|
1568
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
1569
|
-
|
|
1570
|
-
[TradeDetectionSubscription](./lib/snaptrade/models/trade_detection_subscription.rb)
|
|
1392
|
+
### `snaptrade.experimental_endpoints.list_connection_accounts`<a id="snaptradeexperimental_endpointslist_connection_accounts"></a>
|
|
1571
1393
|
|
|
1572
|
-
|
|
1394
|
+
Experimental and subject to change without notice.
|
|
1573
1395
|
|
|
1574
|
-
|
|
1396
|
+
Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape.
|
|
1575
1397
|
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
---
|
|
1398
|
+
Each item in the response carries a `kind` field (currently only `investment` is implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema.
|
|
1579
1399
|
|
|
1400
|
+
On Pay as you Go / Real-time, this endpoint refreshes each account's opening date, funding date, and market value live from the brokerage on each call.
|
|
1580
1401
|
|
|
1581
|
-
|
|
1582
|
-

|
|
1583
|
-
|
|
1584
|
-
**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.
|
|
1585
|
-
|
|
1586
|
-
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).
|
|
1402
|
+
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 brokerage. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
1587
1403
|
|
|
1588
|
-
Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see
|
|
1589
|
-
- If you do, this endpoint returns real-time data.
|
|
1590
|
-
- 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.
|
|
1404
|
+
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.
|
|
1591
1405
|
|
|
1592
1406
|
|
|
1593
1407
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1594
1408
|
|
|
1595
1409
|
```ruby
|
|
1596
|
-
result = snaptrade.
|
|
1410
|
+
result = snaptrade.experimental_endpoints.list_connection_accounts(
|
|
1411
|
+
authorization_id: "87b24961-b51e-4db8-9226-f198f6518a89",
|
|
1597
1412
|
user_id: "snaptrade-user-123",
|
|
1598
1413
|
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1599
|
-
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
1600
1414
|
)
|
|
1601
1415
|
p result
|
|
1602
1416
|
```
|
|
1603
1417
|
|
|
1604
1418
|
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1605
1419
|
|
|
1420
|
+
##### authorization_id: `String`<a id="authorization_id-string"></a>
|
|
1606
1421
|
##### user_id: `String`<a id="user_id-string"></a>
|
|
1607
1422
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
1608
|
-
##### account_id: `String`<a id="account_id-string"></a>
|
|
1609
1423
|
#### 🔄 Return<a id="🔄-return"></a>
|
|
1610
1424
|
|
|
1611
|
-
[
|
|
1425
|
+
[ConnectionAccount](./lib/snaptrade/models/connection_account.rb)
|
|
1612
1426
|
|
|
1613
1427
|
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1614
1428
|
|
|
1615
|
-
`/
|
|
1429
|
+
`/connections/{authorizationId}/accounts` `GET`
|
|
1616
1430
|
|
|
1617
1431
|
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1618
1432
|
|
|
1619
1433
|
---
|
|
1620
1434
|
|
|
1621
1435
|
|
|
1622
|
-
### `snaptrade.
|
|
1436
|
+
### `snaptrade.experimental_endpoints.list_subscriptions`<a id="snaptradeexperimental_endpointslist_subscriptions"></a>
|
|
1623
1437
|
|
|
1624
|
-
Returns
|
|
1438
|
+
Returns active Trade Detection subscriptions for your Client ID. Cancelled subscriptions are not returned.
|
|
1625
1439
|
|
|
1626
1440
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1627
1441
|
|
|
1628
1442
|
```ruby
|
|
1629
|
-
result = snaptrade.
|
|
1630
|
-
currency_pair: "currencyPair_example",
|
|
1631
|
-
)
|
|
1443
|
+
result = snaptrade.experimental_endpoints.list_subscriptions
|
|
1632
1444
|
p result
|
|
1633
1445
|
```
|
|
1634
1446
|
|
|
1635
|
-
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1636
|
-
|
|
1637
|
-
##### currency_pair: `String`<a id="currency_pair-string"></a>
|
|
1638
|
-
A currency pair based on currency code for example, {CAD-USD}
|
|
1639
|
-
|
|
1640
1447
|
#### 🔄 Return<a id="🔄-return"></a>
|
|
1641
1448
|
|
|
1642
|
-
[
|
|
1449
|
+
[TradeDetectionSubscription](./lib/snaptrade/models/trade_detection_subscription.rb)
|
|
1643
1450
|
|
|
1644
1451
|
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1645
1452
|
|
|
1646
|
-
`/
|
|
1453
|
+
`/snapTrade/tradeDetection/subscriptions` `GET`
|
|
1647
1454
|
|
|
1648
1455
|
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1649
1456
|
|
|
@@ -1674,30 +1481,6 @@ p result
|
|
|
1674
1481
|
---
|
|
1675
1482
|
|
|
1676
1483
|
|
|
1677
|
-
### `snaptrade.reference_data.get_security_types`<a id="snaptradereference_dataget_security_types"></a>
|
|
1678
|
-
|
|
1679
|
-
Return all available security types supported by SnapTrade.
|
|
1680
|
-
|
|
1681
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1682
|
-
|
|
1683
|
-
```ruby
|
|
1684
|
-
result = snaptrade.reference_data.get_security_types
|
|
1685
|
-
p result
|
|
1686
|
-
```
|
|
1687
|
-
|
|
1688
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
1689
|
-
|
|
1690
|
-
[SecurityType](./lib/snaptrade/models/security_type.rb)
|
|
1691
|
-
|
|
1692
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1693
|
-
|
|
1694
|
-
`/securityTypes` `GET`
|
|
1695
|
-
|
|
1696
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1697
|
-
|
|
1698
|
-
---
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
1484
|
### `snaptrade.reference_data.get_stock_exchanges`<a id="snaptradereference_dataget_stock_exchanges"></a>
|
|
1702
1485
|
|
|
1703
1486
|
Returns a list of all supported Exchanges.
|
|
@@ -1873,54 +1656,6 @@ p result
|
|
|
1873
1656
|
---
|
|
1874
1657
|
|
|
1875
1658
|
|
|
1876
|
-
### `snaptrade.reference_data.list_all_currencies`<a id="snaptradereference_datalist_all_currencies"></a>
|
|
1877
|
-
|
|
1878
|
-
Returns a list of all defined Currency objects.
|
|
1879
|
-
|
|
1880
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1881
|
-
|
|
1882
|
-
```ruby
|
|
1883
|
-
result = snaptrade.reference_data.list_all_currencies
|
|
1884
|
-
p result
|
|
1885
|
-
```
|
|
1886
|
-
|
|
1887
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
1888
|
-
|
|
1889
|
-
[Currency](./lib/snaptrade/models/currency.rb)
|
|
1890
|
-
|
|
1891
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1892
|
-
|
|
1893
|
-
`/currencies` `GET`
|
|
1894
|
-
|
|
1895
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1896
|
-
|
|
1897
|
-
---
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
### `snaptrade.reference_data.list_all_currencies_rates`<a id="snaptradereference_datalist_all_currencies_rates"></a>
|
|
1901
|
-
|
|
1902
|
-
Returns a list of all Exchange Rate Pairs for all supported Currencies.
|
|
1903
|
-
|
|
1904
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1905
|
-
|
|
1906
|
-
```ruby
|
|
1907
|
-
result = snaptrade.reference_data.list_all_currencies_rates
|
|
1908
|
-
p result
|
|
1909
|
-
```
|
|
1910
|
-
|
|
1911
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
1912
|
-
|
|
1913
|
-
[ExchangeRatePairs](./lib/snaptrade/models/exchange_rate_pairs.rb)
|
|
1914
|
-
|
|
1915
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1916
|
-
|
|
1917
|
-
`/currencies/rates` `GET`
|
|
1918
|
-
|
|
1919
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1920
|
-
|
|
1921
|
-
---
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
1659
|
### `snaptrade.reference_data.symbol_search_user_account`<a id="snaptradereference_datasymbol_search_user_account"></a>
|
|
1925
1660
|
|
|
1926
1661
|
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.
|
|
@@ -2000,48 +1735,6 @@ the brokerage system.
|
|
|
2000
1735
|
---
|
|
2001
1736
|
|
|
2002
1737
|
|
|
2003
|
-
### `snaptrade.trading.cancel_user_account_order`<a id="snaptradetradingcancel_user_account_order"></a>
|
|
2004
|
-

|
|
2005
|
-
|
|
2006
|
-
**Deprecated.** Use [the new cancel order endpoint](/reference/Trading/Trading_cancelOrder) instead.
|
|
2007
|
-
|
|
2008
|
-
Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected.
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
2012
|
-
|
|
2013
|
-
```ruby
|
|
2014
|
-
result = snaptrade.trading.cancel_user_account_order(
|
|
2015
|
-
brokerage_order_id: "66a033fa-da74-4fcf-b527-feefdec9257e",
|
|
2016
|
-
user_id: "snaptrade-user-123",
|
|
2017
|
-
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
2018
|
-
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
2019
|
-
)
|
|
2020
|
-
p result
|
|
2021
|
-
```
|
|
2022
|
-
|
|
2023
|
-
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
2024
|
-
|
|
2025
|
-
##### brokerage_order_id: `String`<a id="brokerage_order_id-string"></a>
|
|
2026
|
-
Order ID returned by brokerage. This is the unique identifier for the order in
|
|
2027
|
-
the brokerage system.
|
|
2028
|
-
|
|
2029
|
-
##### user_id: `String`<a id="user_id-string"></a>
|
|
2030
|
-
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
2031
|
-
##### account_id: `String`<a id="account_id-string"></a>
|
|
2032
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
2033
|
-
|
|
2034
|
-
[AccountOrderRecord](./lib/snaptrade/models/account_order_record.rb)
|
|
2035
|
-
|
|
2036
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
2037
|
-
|
|
2038
|
-
`/accounts/{accountId}/orders/cancel` `POST`
|
|
2039
|
-
|
|
2040
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
2041
|
-
|
|
2042
|
-
---
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
1738
|
### `snaptrade.trading.get_cryptocurrency_pair_quote`<a id="snaptradetradingget_cryptocurrency_pair_quote"></a>
|
|
2046
1739
|
|
|
2047
1740
|
Gets a quote for the specified account.
|
|
@@ -2314,96 +2007,6 @@ Should be set to `True` if `symbols` are comprised of tickers. Defaults to
|
|
|
2314
2007
|
---
|
|
2315
2008
|
|
|
2316
2009
|
|
|
2317
|
-
### `snaptrade.trading.place_bracket_order`<a id="snaptradetradingplace_bracket_order"></a>
|
|
2318
|
-

|
|
2319
|
-
|
|
2320
|
-
**Deprecated.** Use [the new complex order endpoint](/reference/Trading/Trading_placeComplexOrder) instead.
|
|
2321
|
-
|
|
2322
|
-
Places a bracket order (entry order + OCO of stop loss and take profit). Disabled by default please contact support for
|
|
2323
|
-
use. Only supported on certain brokerages
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
2327
|
-
|
|
2328
|
-
```ruby
|
|
2329
|
-
result = snaptrade.trading.place_bracket_order(
|
|
2330
|
-
action: "BUY",
|
|
2331
|
-
instrument: {
|
|
2332
|
-
"symbol" => "AAPL",
|
|
2333
|
-
"type" => "EQUITY",
|
|
2334
|
-
},
|
|
2335
|
-
order_type: "Market",
|
|
2336
|
-
time_in_force: "Day",
|
|
2337
|
-
stop_loss: {
|
|
2338
|
-
"stop_price" => "48.55",
|
|
2339
|
-
"limit_price" => "48.50",
|
|
2340
|
-
},
|
|
2341
|
-
take_profit: {
|
|
2342
|
-
"limit_price" => "49.95",
|
|
2343
|
-
},
|
|
2344
|
-
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
2345
|
-
user_id: "snaptrade-user-123",
|
|
2346
|
-
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
2347
|
-
price: 31.33,
|
|
2348
|
-
stop: 31.33,
|
|
2349
|
-
units: 10.5,
|
|
2350
|
-
)
|
|
2351
|
-
p result
|
|
2352
|
-
```
|
|
2353
|
-
|
|
2354
|
-
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
2355
|
-
|
|
2356
|
-
##### action: [`ActionStrictWithOptions`](./lib/snaptrade/models/action_strict_with_options.rb)<a id="action-actionstrictwithoptionslibsnaptrademodelsaction_strict_with_optionsrb"></a>
|
|
2357
|
-
The action describes the intent or side of a trade. This is either `BUY` or
|
|
2358
|
-
`SELL` for Equity symbols or `BUY_TO_OPEN`, `BUY_TO_CLOSE`, `SELL_TO_OPEN` or
|
|
2359
|
-
`SELL_TO_CLOSE` for Options.
|
|
2360
|
-
|
|
2361
|
-
##### instrument: [`TradingInstrument`](./lib/snaptrade/models/trading_instrument.rb)<a id="instrument-tradinginstrumentlibsnaptrademodelstrading_instrumentrb"></a>
|
|
2362
|
-
##### order_type: [`OrderTypeStrict`](./lib/snaptrade/models/order_type_strict.rb)<a id="order_type-ordertypestrictlibsnaptrademodelsorder_type_strictrb"></a>
|
|
2363
|
-
The type of order to place. - For `Limit` and `StopLimit` orders, the `price`
|
|
2364
|
-
field is required. - For `Stop` and `StopLimit` orders, the `stop` field is
|
|
2365
|
-
required.
|
|
2366
|
-
|
|
2367
|
-
##### time_in_force: [`TimeInForceStrict`](./lib/snaptrade/models/time_in_force_strict.rb)<a id="time_in_force-timeinforcestrictlibsnaptrademodelstime_in_force_strictrb"></a>
|
|
2368
|
-
The Time in Force type for the order. This field indicates how long the order
|
|
2369
|
-
will remain active before it is executed or expires. Here are the supported
|
|
2370
|
-
values: - `Day` - Day. The order is valid only for the trading day on which it
|
|
2371
|
-
is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed
|
|
2372
|
-
or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety
|
|
2373
|
-
immediately or be canceled completely. - `IOC` - Immediate Or Cancel. The order
|
|
2374
|
-
must be executed immediately. Any portion of the order that cannot be filled
|
|
2375
|
-
immediately will be canceled.
|
|
2376
|
-
|
|
2377
|
-
##### stop_loss: [`StopLoss`](./lib/snaptrade/models/stop_loss.rb)<a id="stop_loss-stoplosslibsnaptrademodelsstop_lossrb"></a>
|
|
2378
|
-
##### take_profit: [`TakeProfit`](./lib/snaptrade/models/take_profit.rb)<a id="take_profit-takeprofitlibsnaptrademodelstake_profitrb"></a>
|
|
2379
|
-
##### account_id: `String`<a id="account_id-string"></a>
|
|
2380
|
-
The ID of the account to execute the trade on.
|
|
2381
|
-
|
|
2382
|
-
##### user_id: `String`<a id="user_id-string"></a>
|
|
2383
|
-
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
2384
|
-
##### price: `Float`<a id="price-float"></a>
|
|
2385
|
-
The limit price for `Limit` and `StopLimit` orders.
|
|
2386
|
-
|
|
2387
|
-
##### stop: `Float`<a id="stop-float"></a>
|
|
2388
|
-
The price at which a stop order is triggered for `Stop` and `StopLimit` orders.
|
|
2389
|
-
|
|
2390
|
-
##### units: `Float`<a id="units-float"></a>
|
|
2391
|
-
Number of shares for the order. This can be a decimal for fractional orders.
|
|
2392
|
-
Must be `null` if `notional_value` is provided.
|
|
2393
|
-
|
|
2394
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
2395
|
-
|
|
2396
|
-
[AccountOrderRecord](./lib/snaptrade/models/account_order_record.rb)
|
|
2397
|
-
|
|
2398
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
2399
|
-
|
|
2400
|
-
`/accounts/{accountId}/trading/bracket` `POST`
|
|
2401
|
-
|
|
2402
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
2403
|
-
|
|
2404
|
-
---
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
2010
|
### `snaptrade.trading.place_complex_order`<a id="snaptradetradingplace_complex_order"></a>
|
|
2408
2011
|
|
|
2409
2012
|
Places a complex conditional order (OCO, OTO, or OTOCO).
|
|
@@ -2983,137 +2586,5 @@ p result
|
|
|
2983
2586
|
---
|
|
2984
2587
|
|
|
2985
2588
|
|
|
2986
|
-
### `snaptrade.transactions_and_reporting.get_activities`<a id="snaptradetransactions_and_reportingget_activities"></a>
|
|
2987
|
-

|
|
2988
|
-
|
|
2989
|
-
**Deprecated.** Use [the account level endpoint](/reference/Account%20Information/AccountInformation_getAccountActivities) instead, if possible.
|
|
2990
|
-
|
|
2991
|
-
This endpoint will return HTTP 410 Gone for all customers that sign up after April 25, 2026.
|
|
2992
|
-
|
|
2993
|
-
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.
|
|
2994
|
-
|
|
2995
|
-
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.
|
|
2996
|
-
|
|
2997
|
-
This endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage.
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
3001
|
-
|
|
3002
|
-
```ruby
|
|
3003
|
-
result = snaptrade.transactions_and_reporting.get_activities(
|
|
3004
|
-
user_id: "snaptrade-user-123",
|
|
3005
|
-
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
3006
|
-
start_date: "2022-01-24",
|
|
3007
|
-
end_date: "2022-01-24",
|
|
3008
|
-
accounts: "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
|
|
3009
|
-
brokerage_authorizations: "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
|
|
3010
|
-
type: "BUY,SELL,DIVIDEND",
|
|
3011
|
-
)
|
|
3012
|
-
p result
|
|
3013
|
-
```
|
|
3014
|
-
|
|
3015
|
-
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
3016
|
-
|
|
3017
|
-
##### user_id: `String`<a id="user_id-string"></a>
|
|
3018
|
-
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
3019
|
-
##### start_date: `Date`<a id="start_date-date"></a>
|
|
3020
|
-
The start date (inclusive) of the transaction history to retrieve. If not
|
|
3021
|
-
provided, the default is the first transaction known to SnapTrade based on
|
|
3022
|
-
`trade_date`.
|
|
3023
|
-
|
|
3024
|
-
##### end_date: `Date`<a id="end_date-date"></a>
|
|
3025
|
-
The end date (inclusive) of the transaction history to retrieve. If not
|
|
3026
|
-
provided, the default is the last transaction known to SnapTrade based on
|
|
3027
|
-
`trade_date`.
|
|
3028
|
-
|
|
3029
|
-
##### accounts: `String`<a id="accounts-string"></a>
|
|
3030
|
-
Optional comma separated list of SnapTrade Account IDs used to filter the
|
|
3031
|
-
request to specific accounts. If not provided, the default is all known
|
|
3032
|
-
brokerage accounts for the user. The `brokerageAuthorizations` parameter takes
|
|
3033
|
-
precedence over this parameter.
|
|
3034
|
-
|
|
3035
|
-
##### brokerage_authorizations: `String`<a id="brokerage_authorizations-string"></a>
|
|
3036
|
-
Optional comma separated list of SnapTrade Connection (Brokerage Authorization)
|
|
3037
|
-
IDs used to filter the request to only accounts that belong to those
|
|
3038
|
-
connections. If not provided, the default is all connections for the user. This
|
|
3039
|
-
parameter takes precedence over the `accounts` parameter.
|
|
3040
|
-
|
|
3041
|
-
##### type: `String`<a id="type-string"></a>
|
|
3042
|
-
Optional comma separated list of transaction types to filter by. SnapTrade does
|
|
3043
|
-
a best effort to categorize brokerage transaction types into a common set of
|
|
3044
|
-
values. Here are some of the most popular values: - `BUY` - Asset bought. -
|
|
3045
|
-
`SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `SUBSTITUTE_DIVIDEND` -
|
|
3046
|
-
Payment in lieu of a dividend. - `CONTRIBUTION` - Cash contribution. -
|
|
3047
|
-
`WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `INTEREST` -
|
|
3048
|
-
Interest deposited into the account. - `FEE` - Fee withdrawn from the account. -
|
|
3049
|
-
`OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option
|
|
3050
|
-
assignment event. - `OPTIONEXERCISE` - Option exercise event. - `TRANSFER` -
|
|
3051
|
-
Transfer of assets from one account to another
|
|
3052
|
-
|
|
3053
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
3054
|
-
|
|
3055
|
-
[UniversalActivity](./lib/snaptrade/models/universal_activity.rb)
|
|
3056
|
-
|
|
3057
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
3058
|
-
|
|
3059
|
-
`/activities` `GET`
|
|
3060
|
-
|
|
3061
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
3062
|
-
|
|
3063
|
-
---
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
### `snaptrade.transactions_and_reporting.get_reporting_custom_range`<a id="snaptradetransactions_and_reportingget_reporting_custom_range"></a>
|
|
3067
|
-

|
|
3068
|
-
|
|
3069
|
-
**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.
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
3073
|
-
|
|
3074
|
-
```ruby
|
|
3075
|
-
result = snaptrade.transactions_and_reporting.get_reporting_custom_range(
|
|
3076
|
-
start_date: "2022-01-24",
|
|
3077
|
-
end_date: "2022-01-24",
|
|
3078
|
-
user_id: "snaptrade-user-123",
|
|
3079
|
-
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
3080
|
-
accounts: "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
|
|
3081
|
-
detailed: true,
|
|
3082
|
-
frequency: "monthly",
|
|
3083
|
-
)
|
|
3084
|
-
p result
|
|
3085
|
-
```
|
|
3086
|
-
|
|
3087
|
-
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
3088
|
-
|
|
3089
|
-
##### start_date: `Date`<a id="start_date-date"></a>
|
|
3090
|
-
##### end_date: `Date`<a id="end_date-date"></a>
|
|
3091
|
-
##### user_id: `String`<a id="user_id-string"></a>
|
|
3092
|
-
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
3093
|
-
##### accounts: `String`<a id="accounts-string"></a>
|
|
3094
|
-
Optional comma separated list of account IDs used to filter the request on
|
|
3095
|
-
specific accounts
|
|
3096
|
-
|
|
3097
|
-
##### detailed: `Boolean`<a id="detailed-boolean"></a>
|
|
3098
|
-
Optional, increases frequency of data points for the total value and
|
|
3099
|
-
contribution charts if set to true
|
|
3100
|
-
|
|
3101
|
-
##### frequency: `String`<a id="frequency-string"></a>
|
|
3102
|
-
Optional frequency for the rate of return chart (defaults to monthly). Possible
|
|
3103
|
-
values are daily, weekly, monthly, quarterly, yearly.
|
|
3104
|
-
|
|
3105
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
3106
|
-
|
|
3107
|
-
[PerformanceCustom](./lib/snaptrade/models/performance_custom.rb)
|
|
3108
|
-
|
|
3109
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
3110
|
-
|
|
3111
|
-
`/performance/custom` `GET`
|
|
3112
|
-
|
|
3113
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
3114
|
-
|
|
3115
|
-
---
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
2589
|
## Author<a id="author"></a>
|
|
3119
2590
|
This TypeScript package is automatically generated by [Konfig](https://konfigthis.com)
|