snaptrade 2.0.187 → 2.0.189
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 +1 -1
- data/README.md +84 -53
- data/lib/snaptrade/api/account_information_api.rb +111 -12
- data/lib/snaptrade/api/connections_api.rb +115 -0
- data/lib/snaptrade/api/experimental_endpoints_api.rb +8 -137
- data/lib/snaptrade/configuration.rb +1 -1
- data/lib/snaptrade/models/adr_instrument.rb +311 -0
- data/lib/snaptrade/models/adr_instrument_kind.rb +36 -0
- data/lib/snaptrade/models/all_account_positions_response.rb +3 -40
- data/lib/snaptrade/models/cef_instrument.rb +311 -0
- data/lib/snaptrade/models/cef_instrument_kind.rb +36 -0
- data/lib/snaptrade/models/instrument.rb +6 -0
- data/lib/snaptrade/models/mutual_fund_instrument.rb +311 -0
- data/lib/snaptrade/models/mutual_fund_instrument_kind.rb +36 -0
- data/lib/snaptrade/models/underlying_option_instrument.rb +6 -0
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +6 -0
- data/spec/api/account_information_api_spec.rb +15 -1
- data/spec/api/connections_api_spec.rb +14 -0
- data/spec/api/experimental_endpoints_api_spec.rb +1 -17
- data/spec/models/adr_instrument_kind_spec.rb +23 -0
- data/spec/models/adr_instrument_spec.rb +71 -0
- data/spec/models/all_account_positions_response_spec.rb +0 -18
- data/spec/models/cef_instrument_kind_spec.rb +23 -0
- data/spec/models/cef_instrument_spec.rb +71 -0
- data/spec/models/mutual_fund_instrument_kind_spec.rb +23 -0
- data/spec/models/mutual_fund_instrument_spec.rb +71 -0
- metadata +20 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bc1822b15054d558264492488c4ad3fe18564ac200cbf40963c6b7770e907835
|
|
4
|
+
data.tar.gz: 7ca5ed2fa30342fa05db76eb269be0ac6cc64f8ba05ac48338187742908be1f8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9e4aa643fabacb21f007ecef2c4b9051d8d19a36f8f9e970f25d61b4dd1c34538dbe448357f1f95f95cba74258d40acf44f1262ff3b91aed3fd9c63714d6dc31
|
|
7
|
+
data.tar.gz: dc0fd724bb3bb6e424b69de4804dd2b96af686d824043b48d576e559a212a8f9f6c8624b2bd045a240970dd0110bb9826b9523dfe42a0c5a45588b5cfc2d9dca
|
data/Gemfile.lock
CHANGED
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/2.0.189)
|
|
10
10
|
[](https://snaptrade.com/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
@@ -20,6 +20,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
20
20
|
- [Raw HTTP Response](#raw-http-response)
|
|
21
21
|
- [Reference](#reference)
|
|
22
22
|
* [`snaptrade.account_information.get_account_activities`](#snaptradeaccount_informationget_account_activities)
|
|
23
|
+
* [`snaptrade.account_information.get_account_balance_history`](#snaptradeaccount_informationget_account_balance_history)
|
|
23
24
|
* [`snaptrade.account_information.get_all_user_holdings`](#snaptradeaccount_informationget_all_user_holdings)
|
|
24
25
|
* [`snaptrade.account_information.get_user_account_balance`](#snaptradeaccount_informationget_user_account_balance)
|
|
25
26
|
* [`snaptrade.account_information.get_user_account_details`](#snaptradeaccount_informationget_user_account_details)
|
|
@@ -40,12 +41,12 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
40
41
|
* [`snaptrade.connections.delete_connection`](#snaptradeconnectionsdelete_connection)
|
|
41
42
|
* [`snaptrade.connections.detail_brokerage_authorization`](#snaptradeconnectionsdetail_brokerage_authorization)
|
|
42
43
|
* [`snaptrade.connections.disable_brokerage_authorization`](#snaptradeconnectionsdisable_brokerage_authorization)
|
|
44
|
+
* [`snaptrade.connections.list_brokerage_authorization_accounts`](#snaptradeconnectionslist_brokerage_authorization_accounts)
|
|
43
45
|
* [`snaptrade.connections.list_brokerage_authorizations`](#snaptradeconnectionslist_brokerage_authorizations)
|
|
44
46
|
* [`snaptrade.connections.refresh_brokerage_authorization`](#snaptradeconnectionsrefresh_brokerage_authorization)
|
|
45
47
|
* [`snaptrade.connections.remove_brokerage_authorization`](#snaptradeconnectionsremove_brokerage_authorization)
|
|
46
48
|
* [`snaptrade.connections.return_rates`](#snaptradeconnectionsreturn_rates)
|
|
47
49
|
* [`snaptrade.connections.session_events`](#snaptradeconnectionssession_events)
|
|
48
|
-
* [`snaptrade.experimental_endpoints.get_account_balance_history`](#snaptradeexperimental_endpointsget_account_balance_history)
|
|
49
50
|
* [`snaptrade.experimental_endpoints.get_all_account_positions`](#snaptradeexperimental_endpointsget_all_account_positions)
|
|
50
51
|
* [`snaptrade.experimental_endpoints.get_user_account_order_detail_v2`](#snaptradeexperimental_endpointsget_user_account_order_detail_v2)
|
|
51
52
|
* [`snaptrade.experimental_endpoints.get_user_account_orders_v2`](#snaptradeexperimental_endpointsget_user_account_orders_v2)
|
|
@@ -90,7 +91,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
90
91
|
Add to Gemfile:
|
|
91
92
|
|
|
92
93
|
```ruby
|
|
93
|
-
gem 'snaptrade', '~> 2.0.
|
|
94
|
+
gem 'snaptrade', '~> 2.0.189'
|
|
94
95
|
```
|
|
95
96
|
|
|
96
97
|
## Getting Started<a id="getting-started"></a>
|
|
@@ -217,6 +218,40 @@ Transfer of assets from one account to another. - `SPLIT` - A stock share split.
|
|
|
217
218
|
---
|
|
218
219
|
|
|
219
220
|
|
|
221
|
+
### `snaptrade.account_information.get_account_balance_history`<a id="snaptradeaccount_informationget_account_balance_history"></a>
|
|
222
|
+
|
|
223
|
+
An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year.
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
227
|
+
|
|
228
|
+
```ruby
|
|
229
|
+
result = snaptrade.account_information.get_account_balance_history(
|
|
230
|
+
user_id: "snaptrade-user-123",
|
|
231
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
232
|
+
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
233
|
+
)
|
|
234
|
+
p result
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
238
|
+
|
|
239
|
+
##### user_id: `String`<a id="user_id-string"></a>
|
|
240
|
+
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
241
|
+
##### account_id: `String`<a id="account_id-string"></a>
|
|
242
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
243
|
+
|
|
244
|
+
[AccountValueHistoryResponse](./lib/snaptrade/models/account_value_history_response.rb)
|
|
245
|
+
|
|
246
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
247
|
+
|
|
248
|
+
`/accounts/{accountId}/balanceHistory` `GET`
|
|
249
|
+
|
|
250
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
|
|
220
255
|
### `snaptrade.account_information.get_all_user_holdings`<a id="snaptradeaccount_informationget_all_user_holdings"></a>
|
|
221
256
|

|
|
222
257
|
|
|
@@ -597,14 +632,13 @@ p result
|
|
|
597
632
|
|
|
598
633
|
|
|
599
634
|
### `snaptrade.account_information.list_user_accounts`<a id="snaptradeaccount_informationlist_user_accounts"></a>
|
|
635
|
+

|
|
600
636
|
|
|
601
|
-
|
|
637
|
+
**Deprecated, please use the [list accounts for a connection endpoint](/reference/Connections/Connections_listBrokerageAuthorizationAccounts) instead.**
|
|
602
638
|
|
|
603
|
-
|
|
639
|
+
Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user.
|
|
604
640
|
|
|
605
|
-
|
|
606
|
-
- If you do, real-time data can be fetched using the [update account details endpoint](/reference/Account%20Information/AccountInformation_getUserAccountDetails).
|
|
607
|
-
- If you don't, the data is cached and refreshed once a day. If you need real-time, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
641
|
+
This data is cached and only refreshed once a day, regardless of the customer's plan. To get real-time data on a real-time plan, use the connection-scoped endpoint linked above. Customers on delayed plans can force a refresh with the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
608
642
|
|
|
609
643
|
|
|
610
644
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
@@ -1004,6 +1038,46 @@ p result
|
|
|
1004
1038
|
---
|
|
1005
1039
|
|
|
1006
1040
|
|
|
1041
|
+
### `snaptrade.connections.list_brokerage_authorization_accounts`<a id="snaptradeconnectionslist_brokerage_authorization_accounts"></a>
|
|
1042
|
+
|
|
1043
|
+
Returns all brokerage accounts that belong to the specified connection for the authenticated user.
|
|
1044
|
+
|
|
1045
|
+
On real-time plans, this endpoint refreshes each account's opening date, funding date, and total value live from the brokerage on each call.
|
|
1046
|
+
|
|
1047
|
+
On delayed plans, this endpoint returns cached data that is refreshed once a day. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
1048
|
+
|
|
1049
|
+
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.
|
|
1050
|
+
|
|
1051
|
+
|
|
1052
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1053
|
+
|
|
1054
|
+
```ruby
|
|
1055
|
+
result = snaptrade.connections.list_brokerage_authorization_accounts(
|
|
1056
|
+
authorization_id: "87b24961-b51e-4db8-9226-f198f6518a89",
|
|
1057
|
+
user_id: "snaptrade-user-123",
|
|
1058
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1059
|
+
)
|
|
1060
|
+
p result
|
|
1061
|
+
```
|
|
1062
|
+
|
|
1063
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1064
|
+
|
|
1065
|
+
##### authorization_id: `String`<a id="authorization_id-string"></a>
|
|
1066
|
+
##### user_id: `String`<a id="user_id-string"></a>
|
|
1067
|
+
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
1068
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
1069
|
+
|
|
1070
|
+
[Account](./lib/snaptrade/models/account.rb)
|
|
1071
|
+
|
|
1072
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1073
|
+
|
|
1074
|
+
`/authorizations/{authorizationId}/accounts` `GET`
|
|
1075
|
+
|
|
1076
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1077
|
+
|
|
1078
|
+
---
|
|
1079
|
+
|
|
1080
|
+
|
|
1007
1081
|
### `snaptrade.connections.list_brokerage_authorizations`<a id="snaptradeconnectionslist_brokerage_authorizations"></a>
|
|
1008
1082
|
|
|
1009
1083
|
Returns a list of all connections for the specified user. Note that `Connection` and `Brokerage Authorization` are interchangeable, but the term `Connection` is preferred and used in the doc for consistency.
|
|
@@ -1185,45 +1259,11 @@ specific users
|
|
|
1185
1259
|
---
|
|
1186
1260
|
|
|
1187
1261
|
|
|
1188
|
-
### `snaptrade.experimental_endpoints.get_account_balance_history`<a id="snaptradeexperimental_endpointsget_account_balance_history"></a>
|
|
1189
|
-
|
|
1190
|
-
An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and only available for certain brokerages with a maximum lookback of 1 year.
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1194
|
-
|
|
1195
|
-
```ruby
|
|
1196
|
-
result = snaptrade.experimental_endpoints.get_account_balance_history(
|
|
1197
|
-
user_id: "snaptrade-user-123",
|
|
1198
|
-
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1199
|
-
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
1200
|
-
)
|
|
1201
|
-
p result
|
|
1202
|
-
```
|
|
1203
|
-
|
|
1204
|
-
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1205
|
-
|
|
1206
|
-
##### user_id: `String`<a id="user_id-string"></a>
|
|
1207
|
-
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
1208
|
-
##### account_id: `String`<a id="account_id-string"></a>
|
|
1209
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
1210
|
-
|
|
1211
|
-
[AccountValueHistoryResponse](./lib/snaptrade/models/account_value_history_response.rb)
|
|
1212
|
-
|
|
1213
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1214
|
-
|
|
1215
|
-
`/accounts/{accountId}/balanceHistory` `GET`
|
|
1216
|
-
|
|
1217
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1218
|
-
|
|
1219
|
-
---
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
1262
|
### `snaptrade.experimental_endpoints.get_all_account_positions`<a id="snaptradeexperimental_endpointsget_all_account_positions"></a>
|
|
1223
1263
|
|
|
1224
|
-
Returns a
|
|
1264
|
+
Returns a list of all positions in the specified account.
|
|
1225
1265
|
|
|
1226
|
-
The `results` list can contain multiple instrument types in the same response
|
|
1266
|
+
The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, crypto, futures, and option positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`.
|
|
1227
1267
|
|
|
1228
1268
|
Stock positions may also include `cash_equivalent`, and may include `tax_lots` when tax lot data is enabled for the account.
|
|
1229
1269
|
|
|
@@ -1237,8 +1277,6 @@ result = snaptrade.experimental_endpoints.get_all_account_positions(
|
|
|
1237
1277
|
user_id: "snaptrade-user-123",
|
|
1238
1278
|
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1239
1279
|
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
1240
|
-
page: 1,
|
|
1241
|
-
page_size: 100,
|
|
1242
1280
|
)
|
|
1243
1281
|
p result
|
|
1244
1282
|
```
|
|
@@ -1248,13 +1286,6 @@ p result
|
|
|
1248
1286
|
##### user_id: `String`<a id="user_id-string"></a>
|
|
1249
1287
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
1250
1288
|
##### account_id: `String`<a id="account_id-string"></a>
|
|
1251
|
-
##### page: `Integer`<a id="page-integer"></a>
|
|
1252
|
-
The page number to return. Defaults to 1.
|
|
1253
|
-
|
|
1254
|
-
##### page_size: `Integer`<a id="page_size-integer"></a>
|
|
1255
|
-
The number of positions to return per page. Defaults to 100 with a maximum of
|
|
1256
|
-
1000.
|
|
1257
|
-
|
|
1258
1289
|
#### 🔄 Return<a id="🔄-return"></a>
|
|
1259
1290
|
|
|
1260
1291
|
[AllAccountPositionsResponse](./lib/snaptrade/models/all_account_positions_response.rb)
|
|
@@ -179,6 +179,109 @@ module SnapTrade
|
|
|
179
179
|
end
|
|
180
180
|
|
|
181
181
|
|
|
182
|
+
# List historical account total value
|
|
183
|
+
#
|
|
184
|
+
# An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year.
|
|
185
|
+
#
|
|
186
|
+
# @param user_id [String]
|
|
187
|
+
# @param user_secret [String]
|
|
188
|
+
# @param account_id [String]
|
|
189
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
190
|
+
def get_account_balance_history(user_id:, user_secret:, account_id:, extra: {})
|
|
191
|
+
data, _status_code, _headers = get_account_balance_history_with_http_info_impl(user_id, user_secret, account_id, extra)
|
|
192
|
+
data
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# List historical account total value
|
|
196
|
+
#
|
|
197
|
+
# An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year.
|
|
198
|
+
#
|
|
199
|
+
# @param user_id [String]
|
|
200
|
+
# @param user_secret [String]
|
|
201
|
+
# @param account_id [String]
|
|
202
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
203
|
+
def get_account_balance_history_with_http_info(user_id:, user_secret:, account_id:, extra: {})
|
|
204
|
+
get_account_balance_history_with_http_info_impl(user_id, user_secret, account_id, extra)
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# List historical account total value
|
|
208
|
+
# An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year.
|
|
209
|
+
# @param user_id [String]
|
|
210
|
+
# @param user_secret [String]
|
|
211
|
+
# @param account_id [String]
|
|
212
|
+
# @param [Hash] opts the optional parameters
|
|
213
|
+
# @return [AccountValueHistoryResponse]
|
|
214
|
+
private def get_account_balance_history_impl(user_id, user_secret, account_id, opts = {})
|
|
215
|
+
data, _status_code, _headers = get_account_balance_history_with_http_info(user_id, user_secret, account_id, opts)
|
|
216
|
+
data
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# List historical account total value
|
|
220
|
+
# An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year.
|
|
221
|
+
# @param user_id [String]
|
|
222
|
+
# @param user_secret [String]
|
|
223
|
+
# @param account_id [String]
|
|
224
|
+
# @param [Hash] opts the optional parameters
|
|
225
|
+
# @return [Array<(AccountValueHistoryResponse, Integer, Hash)>] AccountValueHistoryResponse data, response status code and response headers
|
|
226
|
+
private def get_account_balance_history_with_http_info_impl(user_id, user_secret, account_id, opts = {})
|
|
227
|
+
if @api_client.config.debugging
|
|
228
|
+
@api_client.config.logger.debug 'Calling API: AccountInformationApi.get_account_balance_history ...'
|
|
229
|
+
end
|
|
230
|
+
# verify the required parameter 'user_id' is set
|
|
231
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
232
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AccountInformationApi.get_account_balance_history"
|
|
233
|
+
end
|
|
234
|
+
# verify the required parameter 'user_secret' is set
|
|
235
|
+
if @api_client.config.client_side_validation && user_secret.nil?
|
|
236
|
+
fail ArgumentError, "Missing the required parameter 'user_secret' when calling AccountInformationApi.get_account_balance_history"
|
|
237
|
+
end
|
|
238
|
+
# verify the required parameter 'account_id' is set
|
|
239
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
240
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountInformationApi.get_account_balance_history"
|
|
241
|
+
end
|
|
242
|
+
# resource path
|
|
243
|
+
local_var_path = '/accounts/{accountId}/balanceHistory'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
|
|
244
|
+
|
|
245
|
+
# query parameters
|
|
246
|
+
query_params = opts[:query_params] || {}
|
|
247
|
+
query_params[:'userId'] = user_id
|
|
248
|
+
query_params[:'userSecret'] = user_secret
|
|
249
|
+
|
|
250
|
+
# header parameters
|
|
251
|
+
header_params = opts[:header_params] || {}
|
|
252
|
+
# HTTP header 'Accept' (if needed)
|
|
253
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
254
|
+
|
|
255
|
+
# form parameters
|
|
256
|
+
form_params = opts[:form_params] || {}
|
|
257
|
+
|
|
258
|
+
# http body (model)
|
|
259
|
+
post_body = opts[:debug_body]
|
|
260
|
+
|
|
261
|
+
# return_type
|
|
262
|
+
return_type = opts[:debug_return_type] || 'AccountValueHistoryResponse'
|
|
263
|
+
|
|
264
|
+
# auth_names
|
|
265
|
+
auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
|
|
266
|
+
|
|
267
|
+
new_options = opts.merge(
|
|
268
|
+
:operation => :"AccountInformationApi.get_account_balance_history",
|
|
269
|
+
:header_params => header_params,
|
|
270
|
+
:query_params => query_params,
|
|
271
|
+
:form_params => form_params,
|
|
272
|
+
:body => post_body,
|
|
273
|
+
:auth_names => auth_names,
|
|
274
|
+
:return_type => return_type
|
|
275
|
+
)
|
|
276
|
+
|
|
277
|
+
data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
|
|
278
|
+
if @api_client.config.debugging
|
|
279
|
+
@api_client.config.logger.debug "API called: AccountInformationApi#get_account_balance_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
280
|
+
end
|
|
281
|
+
return data, status_code, headers, response
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
|
|
182
285
|
# List all accounts for the user, plus balances, positions, and orders for each account.
|
|
183
286
|
#
|
|
184
287
|
# **Deprecated, please use the account-specific holdings endpoint instead.**
|
|
@@ -1252,13 +1355,11 @@ module SnapTrade
|
|
|
1252
1355
|
|
|
1253
1356
|
# List accounts
|
|
1254
1357
|
#
|
|
1255
|
-
#
|
|
1358
|
+
# **Deprecated, please use the [list accounts for a connection endpoint](/reference/Connections/Connections_listBrokerageAuthorizationAccounts) instead.**
|
|
1256
1359
|
#
|
|
1257
|
-
#
|
|
1360
|
+
# Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user.
|
|
1258
1361
|
#
|
|
1259
|
-
#
|
|
1260
|
-
# - If you do, real-time data can be fetched using the [update account details endpoint](/reference/Account%20Information/AccountInformation_getUserAccountDetails).
|
|
1261
|
-
# - If you don't, the data is cached and refreshed once a day. If you need real-time, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
1362
|
+
# This data is cached and only refreshed once a day, regardless of the customer's plan. To get real-time data on a real-time plan, use the connection-scoped endpoint linked above. Customers on delayed plans can force a refresh with the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
1262
1363
|
#
|
|
1263
1364
|
# @param user_id [String]
|
|
1264
1365
|
# @param user_secret [String]
|
|
@@ -1270,13 +1371,11 @@ module SnapTrade
|
|
|
1270
1371
|
|
|
1271
1372
|
# List accounts
|
|
1272
1373
|
#
|
|
1273
|
-
#
|
|
1374
|
+
# **Deprecated, please use the [list accounts for a connection endpoint](/reference/Connections/Connections_listBrokerageAuthorizationAccounts) instead.**
|
|
1274
1375
|
#
|
|
1275
|
-
#
|
|
1376
|
+
# Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user.
|
|
1276
1377
|
#
|
|
1277
|
-
#
|
|
1278
|
-
# - If you do, real-time data can be fetched using the [update account details endpoint](/reference/Account%20Information/AccountInformation_getUserAccountDetails).
|
|
1279
|
-
# - If you don't, the data is cached and refreshed once a day. If you need real-time, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
1378
|
+
# This data is cached and only refreshed once a day, regardless of the customer's plan. To get real-time data on a real-time plan, use the connection-scoped endpoint linked above. Customers on delayed plans can force a refresh with the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
1280
1379
|
#
|
|
1281
1380
|
# @param user_id [String]
|
|
1282
1381
|
# @param user_secret [String]
|
|
@@ -1286,7 +1385,7 @@ module SnapTrade
|
|
|
1286
1385
|
end
|
|
1287
1386
|
|
|
1288
1387
|
# List accounts
|
|
1289
|
-
# Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user.
|
|
1388
|
+
# **Deprecated, please use the [list accounts for a connection endpoint](/reference/Connections/Connections_listBrokerageAuthorizationAccounts) instead.** Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. This data is cached and only refreshed once a day, regardless of the customer's plan. To get real-time data on a real-time plan, use the connection-scoped endpoint linked above. Customers on delayed plans can force a refresh with the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
1290
1389
|
# @param user_id [String]
|
|
1291
1390
|
# @param user_secret [String]
|
|
1292
1391
|
# @param [Hash] opts the optional parameters
|
|
@@ -1297,7 +1396,7 @@ module SnapTrade
|
|
|
1297
1396
|
end
|
|
1298
1397
|
|
|
1299
1398
|
# List accounts
|
|
1300
|
-
# Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user.
|
|
1399
|
+
# **Deprecated, please use the [list accounts for a connection endpoint](/reference/Connections/Connections_listBrokerageAuthorizationAccounts) instead.** Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. This data is cached and only refreshed once a day, regardless of the customer's plan. To get real-time data on a real-time plan, use the connection-scoped endpoint linked above. Customers on delayed plans can force a refresh with the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
1301
1400
|
# @param user_id [String]
|
|
1302
1401
|
# @param user_secret [String]
|
|
1303
1402
|
# @param [Hash] opts the optional parameters
|
|
@@ -332,6 +332,121 @@ module SnapTrade
|
|
|
332
332
|
end
|
|
333
333
|
|
|
334
334
|
|
|
335
|
+
# List accounts for a connection
|
|
336
|
+
#
|
|
337
|
+
# Returns all brokerage accounts that belong to the specified connection for the authenticated user.
|
|
338
|
+
#
|
|
339
|
+
# On real-time plans, this endpoint refreshes each account's opening date, funding date, and total value live from the brokerage on each call.
|
|
340
|
+
#
|
|
341
|
+
# On delayed plans, this endpoint returns cached data that is refreshed once a day. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
342
|
+
#
|
|
343
|
+
# 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.
|
|
344
|
+
#
|
|
345
|
+
# @param authorization_id [String]
|
|
346
|
+
# @param user_id [String]
|
|
347
|
+
# @param user_secret [String]
|
|
348
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
349
|
+
def list_brokerage_authorization_accounts(authorization_id:, user_id:, user_secret:, extra: {})
|
|
350
|
+
data, _status_code, _headers = list_brokerage_authorization_accounts_with_http_info_impl(authorization_id, user_id, user_secret, extra)
|
|
351
|
+
data
|
|
352
|
+
end
|
|
353
|
+
|
|
354
|
+
# List accounts for a connection
|
|
355
|
+
#
|
|
356
|
+
# Returns all brokerage accounts that belong to the specified connection for the authenticated user.
|
|
357
|
+
#
|
|
358
|
+
# On real-time plans, this endpoint refreshes each account's opening date, funding date, and total value live from the brokerage on each call.
|
|
359
|
+
#
|
|
360
|
+
# On delayed plans, this endpoint returns cached data that is refreshed once a day. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
361
|
+
#
|
|
362
|
+
# 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.
|
|
363
|
+
#
|
|
364
|
+
# @param authorization_id [String]
|
|
365
|
+
# @param user_id [String]
|
|
366
|
+
# @param user_secret [String]
|
|
367
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
368
|
+
def list_brokerage_authorization_accounts_with_http_info(authorization_id:, user_id:, user_secret:, extra: {})
|
|
369
|
+
list_brokerage_authorization_accounts_with_http_info_impl(authorization_id, user_id, user_secret, extra)
|
|
370
|
+
end
|
|
371
|
+
|
|
372
|
+
# List accounts for a connection
|
|
373
|
+
# Returns all brokerage accounts that belong to the specified connection for the authenticated user. On real-time plans, this endpoint refreshes each account's opening date, funding date, and total value live from the brokerage on each call. On delayed plans, this endpoint returns cached data that is refreshed once a day. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). 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.
|
|
374
|
+
# @param authorization_id [String]
|
|
375
|
+
# @param user_id [String]
|
|
376
|
+
# @param user_secret [String]
|
|
377
|
+
# @param [Hash] opts the optional parameters
|
|
378
|
+
# @return [Array<Account>]
|
|
379
|
+
private def list_brokerage_authorization_accounts_impl(authorization_id, user_id, user_secret, opts = {})
|
|
380
|
+
data, _status_code, _headers = list_brokerage_authorization_accounts_with_http_info(authorization_id, user_id, user_secret, opts)
|
|
381
|
+
data
|
|
382
|
+
end
|
|
383
|
+
|
|
384
|
+
# List accounts for a connection
|
|
385
|
+
# Returns all brokerage accounts that belong to the specified connection for the authenticated user. On real-time plans, this endpoint refreshes each account's opening date, funding date, and total value live from the brokerage on each call. On delayed plans, this endpoint returns cached data that is refreshed once a day. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). 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.
|
|
386
|
+
# @param authorization_id [String]
|
|
387
|
+
# @param user_id [String]
|
|
388
|
+
# @param user_secret [String]
|
|
389
|
+
# @param [Hash] opts the optional parameters
|
|
390
|
+
# @return [Array<(Array<Account>, Integer, Hash)>] Array<Account> data, response status code and response headers
|
|
391
|
+
private def list_brokerage_authorization_accounts_with_http_info_impl(authorization_id, user_id, user_secret, opts = {})
|
|
392
|
+
if @api_client.config.debugging
|
|
393
|
+
@api_client.config.logger.debug 'Calling API: ConnectionsApi.list_brokerage_authorization_accounts ...'
|
|
394
|
+
end
|
|
395
|
+
# verify the required parameter 'authorization_id' is set
|
|
396
|
+
if @api_client.config.client_side_validation && authorization_id.nil?
|
|
397
|
+
fail ArgumentError, "Missing the required parameter 'authorization_id' when calling ConnectionsApi.list_brokerage_authorization_accounts"
|
|
398
|
+
end
|
|
399
|
+
# verify the required parameter 'user_id' is set
|
|
400
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
401
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling ConnectionsApi.list_brokerage_authorization_accounts"
|
|
402
|
+
end
|
|
403
|
+
# verify the required parameter 'user_secret' is set
|
|
404
|
+
if @api_client.config.client_side_validation && user_secret.nil?
|
|
405
|
+
fail ArgumentError, "Missing the required parameter 'user_secret' when calling ConnectionsApi.list_brokerage_authorization_accounts"
|
|
406
|
+
end
|
|
407
|
+
# resource path
|
|
408
|
+
local_var_path = '/authorizations/{authorizationId}/accounts'.sub('{' + 'authorizationId' + '}', CGI.escape(authorization_id.to_s))
|
|
409
|
+
|
|
410
|
+
# query parameters
|
|
411
|
+
query_params = opts[:query_params] || {}
|
|
412
|
+
query_params[:'userId'] = user_id
|
|
413
|
+
query_params[:'userSecret'] = user_secret
|
|
414
|
+
|
|
415
|
+
# header parameters
|
|
416
|
+
header_params = opts[:header_params] || {}
|
|
417
|
+
# HTTP header 'Accept' (if needed)
|
|
418
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
419
|
+
|
|
420
|
+
# form parameters
|
|
421
|
+
form_params = opts[:form_params] || {}
|
|
422
|
+
|
|
423
|
+
# http body (model)
|
|
424
|
+
post_body = opts[:debug_body]
|
|
425
|
+
|
|
426
|
+
# return_type
|
|
427
|
+
return_type = opts[:debug_return_type] || 'Array<Account>'
|
|
428
|
+
|
|
429
|
+
# auth_names
|
|
430
|
+
auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
|
|
431
|
+
|
|
432
|
+
new_options = opts.merge(
|
|
433
|
+
:operation => :"ConnectionsApi.list_brokerage_authorization_accounts",
|
|
434
|
+
:header_params => header_params,
|
|
435
|
+
:query_params => query_params,
|
|
436
|
+
:form_params => form_params,
|
|
437
|
+
:body => post_body,
|
|
438
|
+
:auth_names => auth_names,
|
|
439
|
+
:return_type => return_type
|
|
440
|
+
)
|
|
441
|
+
|
|
442
|
+
data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
|
|
443
|
+
if @api_client.config.debugging
|
|
444
|
+
@api_client.config.logger.debug "API called: ConnectionsApi#list_brokerage_authorization_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
445
|
+
end
|
|
446
|
+
return data, status_code, headers, response
|
|
447
|
+
end
|
|
448
|
+
|
|
449
|
+
|
|
335
450
|
# List all connections
|
|
336
451
|
#
|
|
337
452
|
# Returns a list of all connections for the specified user. Note that `Connection` and `Brokerage Authorization` are interchangeable, but the term `Connection` is preferred and used in the doc for consistency.
|