snaptrade 2.0.166 → 2.0.168
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 +46 -51
- data/lib/snaptrade/api/account_information_api.rb +16 -16
- data/lib/snaptrade/api/authentication_api.rb +2 -2
- data/lib/snaptrade/api/experimental_endpoints_api.rb +103 -0
- data/lib/snaptrade/api/options_api.rb +4 -116
- data/lib/snaptrade/api/trading_api.rb +8 -8
- data/lib/snaptrade/models/account_universal_activity.rb +1 -1
- data/lib/snaptrade/models/account_value_history_item.rb +228 -0
- data/lib/snaptrade/models/account_value_history_response.rb +230 -0
- data/lib/snaptrade/models/brokerage.rb +11 -1
- data/lib/snaptrade/models/notional_value.rb +1 -1
- data/lib/snaptrade/models/snap_trade_login_user_request_body.rb +1 -1
- data/lib/snaptrade/models/transactions_status.rb +1 -1
- data/lib/snaptrade/models/universal_activity.rb +1 -1
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +2 -0
- data/spec/api/account_information_api_spec.rb +4 -4
- data/spec/api/experimental_endpoints_api_spec.rb +14 -0
- data/spec/api/options_api_spec.rb +1 -16
- data/spec/api/trading_api_spec.rb +2 -2
- data/spec/models/account_value_history_item_spec.rb +35 -0
- data/spec/models/account_value_history_response_spec.rb +35 -0
- data/spec/models/brokerage_spec.rb +6 -0
- metadata +8 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 877eef10b8ceb980f9035205f8c42c7f7f7f94f6fdb8c59181ae8886559a5acf
|
|
4
|
+
data.tar.gz: 6a987bdd3837df47290243d63312326a2adadb3e5984b679163bdcd969ce5b18
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2deb665d83251f8b873b6563a4d0a9c1a114792b16ce1073c917c1f52d6fb964d232a87eca9eb203c2bb529f3f8ce13009d14cac0c98b2f462a54624ea4bafac
|
|
7
|
+
data.tar.gz: 4b7ebb77bb0822cc4de28a70a488591583377444925f2200443baaf62ad6e49b205b280bcfefdb5d2447d77927546d121a7be3f69a44e851d6aace04965d77bd
|
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.168)
|
|
10
10
|
[](https://snaptrade.com/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
@@ -45,11 +45,11 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
45
45
|
* [`snaptrade.connections.remove_brokerage_authorization`](#snaptradeconnectionsremove_brokerage_authorization)
|
|
46
46
|
* [`snaptrade.connections.return_rates`](#snaptradeconnectionsreturn_rates)
|
|
47
47
|
* [`snaptrade.connections.session_events`](#snaptradeconnectionssession_events)
|
|
48
|
+
* [`snaptrade.experimental_endpoints.get_account_balance_history`](#snaptradeexperimental_endpointsget_account_balance_history)
|
|
48
49
|
* [`snaptrade.experimental_endpoints.get_user_account_order_detail_v2`](#snaptradeexperimental_endpointsget_user_account_order_detail_v2)
|
|
49
50
|
* [`snaptrade.experimental_endpoints.get_user_account_orders_v2`](#snaptradeexperimental_endpointsget_user_account_orders_v2)
|
|
50
51
|
* [`snaptrade.experimental_endpoints.get_user_account_recent_orders_v2`](#snaptradeexperimental_endpointsget_user_account_recent_orders_v2)
|
|
51
52
|
* [`snaptrade.options.get_option_quote`](#snaptradeoptionsget_option_quote)
|
|
52
|
-
* [`snaptrade.options.get_options_chain`](#snaptradeoptionsget_options_chain)
|
|
53
53
|
* [`snaptrade.options.list_option_holdings`](#snaptradeoptionslist_option_holdings)
|
|
54
54
|
* [`snaptrade.reference_data.get_currency_exchange_rate_pair`](#snaptradereference_dataget_currency_exchange_rate_pair)
|
|
55
55
|
* [`snaptrade.reference_data.get_partner_info`](#snaptradereference_dataget_partner_info)
|
|
@@ -87,7 +87,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
87
87
|
Add to Gemfile:
|
|
88
88
|
|
|
89
89
|
```ruby
|
|
90
|
-
gem 'snaptrade', '~> 2.0.
|
|
90
|
+
gem 'snaptrade', '~> 2.0.168'
|
|
91
91
|
```
|
|
92
92
|
|
|
93
93
|
## Getting Started<a id="getting-started"></a>
|
|
@@ -261,7 +261,7 @@ Returns a list of balances for the account. Each element of the list has a disti
|
|
|
261
261
|
|
|
262
262
|
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:
|
|
263
263
|
- If you do, this endpoint returns real-time data.
|
|
264
|
-
- If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.
|
|
264
|
+
- If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
|
|
265
265
|
|
|
266
266
|
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.
|
|
267
267
|
|
|
@@ -386,7 +386,7 @@ Returns a list of recent orders in the specified account.
|
|
|
386
386
|
|
|
387
387
|
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:
|
|
388
388
|
- If you do, this endpoint returns real-time data.
|
|
389
|
-
- If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.
|
|
389
|
+
- If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
|
|
390
390
|
|
|
391
391
|
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.
|
|
392
392
|
|
|
@@ -435,7 +435,7 @@ Returns a list of stock/ETF/crypto/mutual fund positions in the specified accoun
|
|
|
435
435
|
|
|
436
436
|
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:
|
|
437
437
|
- If you do, this endpoint returns real-time data.
|
|
438
|
-
- If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.
|
|
438
|
+
- If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
|
|
439
439
|
|
|
440
440
|
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.
|
|
441
441
|
|
|
@@ -551,7 +551,7 @@ Returns a list of balances, positions, and recent orders for the specified accou
|
|
|
551
551
|
|
|
552
552
|
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:
|
|
553
553
|
- If you do, this endpoint returns real-time data.
|
|
554
|
-
- If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.
|
|
554
|
+
- If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
|
|
555
555
|
|
|
556
556
|
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.
|
|
557
557
|
|
|
@@ -762,8 +762,8 @@ p result
|
|
|
762
762
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
763
763
|
##### broker: `String`<a id="broker-string"></a>
|
|
764
764
|
Slug of the brokerage to connect the user to. See [the integrations
|
|
765
|
-
page](https://snaptrade.
|
|
766
|
-
|
|
765
|
+
page](https://support.snaptrade.com/brokerages) for a list of supported
|
|
766
|
+
brokerages and their slugs.
|
|
767
767
|
|
|
768
768
|
##### immediateRedirect: `Boolean`<a id="immediateredirect-boolean"></a>
|
|
769
769
|
When set to `true`, user will be redirected back to the partner's site instead
|
|
@@ -1167,6 +1167,40 @@ specific users
|
|
|
1167
1167
|
---
|
|
1168
1168
|
|
|
1169
1169
|
|
|
1170
|
+
### `snaptrade.experimental_endpoints.get_account_balance_history`<a id="snaptradeexperimental_endpointsget_account_balance_history"></a>
|
|
1171
|
+
|
|
1172
|
+
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.
|
|
1173
|
+
|
|
1174
|
+
|
|
1175
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1176
|
+
|
|
1177
|
+
```ruby
|
|
1178
|
+
result = snaptrade.experimental_endpoints.get_account_balance_history(
|
|
1179
|
+
user_id: "snaptrade-user-123",
|
|
1180
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1181
|
+
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
1182
|
+
)
|
|
1183
|
+
p result
|
|
1184
|
+
```
|
|
1185
|
+
|
|
1186
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1187
|
+
|
|
1188
|
+
##### user_id: `String`<a id="user_id-string"></a>
|
|
1189
|
+
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
1190
|
+
##### account_id: `String`<a id="account_id-string"></a>
|
|
1191
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
1192
|
+
|
|
1193
|
+
[AccountValueHistoryResponse](./lib/snaptrade/models/account_value_history_response.rb)
|
|
1194
|
+
|
|
1195
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1196
|
+
|
|
1197
|
+
`/accounts/{accountId}/balanceHistory` `GET`
|
|
1198
|
+
|
|
1199
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1200
|
+
|
|
1201
|
+
---
|
|
1202
|
+
|
|
1203
|
+
|
|
1170
1204
|
### `snaptrade.experimental_endpoints.get_user_account_order_detail_v2`<a id="snaptradeexperimental_endpointsget_user_account_order_detail_v2"></a>
|
|
1171
1205
|
|
|
1172
1206
|
Returns the detail of a single order using the brokerage order ID provided as a path parameter.
|
|
@@ -1338,52 +1372,13 @@ The OCC-formatted option symbol.
|
|
|
1338
1372
|
---
|
|
1339
1373
|
|
|
1340
1374
|
|
|
1341
|
-
### `snaptrade.options.get_options_chain`<a id="snaptradeoptionsget_options_chain"></a>
|
|
1342
|
-
|
|
1343
|
-
Returns the option chain for the specified symbol in the specified account.
|
|
1344
|
-
|
|
1345
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1346
|
-
|
|
1347
|
-
```ruby
|
|
1348
|
-
result = snaptrade.options.get_options_chain(
|
|
1349
|
-
user_id: "snaptrade-user-123",
|
|
1350
|
-
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1351
|
-
account_id: "accountId_example",
|
|
1352
|
-
symbol: "symbol_example",
|
|
1353
|
-
)
|
|
1354
|
-
p result
|
|
1355
|
-
```
|
|
1356
|
-
|
|
1357
|
-
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1358
|
-
|
|
1359
|
-
##### user_id: `String`<a id="user_id-string"></a>
|
|
1360
|
-
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
1361
|
-
##### account_id: `String`<a id="account_id-string"></a>
|
|
1362
|
-
The ID of the account to get the options chain from.
|
|
1363
|
-
|
|
1364
|
-
##### symbol: `String`<a id="symbol-string"></a>
|
|
1365
|
-
Universal symbol ID if symbol
|
|
1366
|
-
|
|
1367
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
1368
|
-
|
|
1369
|
-
[OptionChainInner](./lib/snaptrade/models/option_chain_inner.rb)
|
|
1370
|
-
|
|
1371
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1372
|
-
|
|
1373
|
-
`/accounts/{accountId}/optionsChain` `GET`
|
|
1374
|
-
|
|
1375
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1376
|
-
|
|
1377
|
-
---
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
1375
|
### `snaptrade.options.list_option_holdings`<a id="snaptradeoptionslist_option_holdings"></a>
|
|
1381
1376
|
|
|
1382
1377
|
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).
|
|
1383
1378
|
|
|
1384
1379
|
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:
|
|
1385
1380
|
- If you do, this endpoint returns real-time data.
|
|
1386
|
-
- If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.
|
|
1381
|
+
- If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
|
|
1387
1382
|
|
|
1388
1383
|
|
|
1389
1384
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
@@ -1876,7 +1871,7 @@ p result
|
|
|
1876
1871
|
### `snaptrade.trading.get_option_impact`<a id="snaptradetradingget_option_impact"></a>
|
|
1877
1872
|
|
|
1878
1873
|
Simulates an option order with up to 4 legs and returns the estimated cost and transaction fees without placing it.
|
|
1879
|
-
Only supported for certain brokerages. Please refer to https://snaptrade.
|
|
1874
|
+
Only supported for certain brokerages. Please refer to https://support.snaptrade.com/brokerages for more information on brokerage trading support.
|
|
1880
1875
|
|
|
1881
1876
|
|
|
1882
1877
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
@@ -2340,7 +2335,7 @@ contracts to buy or sell. (e.g., 1 contract = 100 shares).
|
|
|
2340
2335
|
|
|
2341
2336
|
### `snaptrade.trading.place_mleg_order`<a id="snaptradetradingplace_mleg_order"></a>
|
|
2342
2337
|
|
|
2343
|
-
Places a multi-leg option order. Only supported on certain option trading brokerages. https://snaptrade.
|
|
2338
|
+
Places a multi-leg option order. Only supported on certain option trading brokerages. https://support.snaptrade.com/brokerages has information on brokerage trading support
|
|
2344
2339
|
|
|
2345
2340
|
|
|
2346
2341
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
@@ -293,7 +293,7 @@ module SnapTrade
|
|
|
293
293
|
#
|
|
294
294
|
# 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:
|
|
295
295
|
# - If you do, this endpoint returns real-time data.
|
|
296
|
-
# - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.
|
|
296
|
+
# - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
|
|
297
297
|
#
|
|
298
298
|
# 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.
|
|
299
299
|
#
|
|
@@ -312,7 +312,7 @@ module SnapTrade
|
|
|
312
312
|
#
|
|
313
313
|
# 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:
|
|
314
314
|
# - If you do, this endpoint returns real-time data.
|
|
315
|
-
# - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.
|
|
315
|
+
# - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
|
|
316
316
|
#
|
|
317
317
|
# 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.
|
|
318
318
|
#
|
|
@@ -325,7 +325,7 @@ module SnapTrade
|
|
|
325
325
|
end
|
|
326
326
|
|
|
327
327
|
# List account balances
|
|
328
|
-
# 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). 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: - If you do, this endpoint returns real-time data. - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.
|
|
328
|
+
# 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). 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: - If you do, this endpoint returns real-time data. - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
|
|
329
329
|
# @param user_id [String]
|
|
330
330
|
# @param user_secret [String]
|
|
331
331
|
# @param account_id [String]
|
|
@@ -337,7 +337,7 @@ module SnapTrade
|
|
|
337
337
|
end
|
|
338
338
|
|
|
339
339
|
# List account balances
|
|
340
|
-
# 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). 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: - If you do, this endpoint returns real-time data. - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.
|
|
340
|
+
# 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). 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: - If you do, this endpoint returns real-time data. - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
|
|
341
341
|
# @param user_id [String]
|
|
342
342
|
# @param user_secret [String]
|
|
343
343
|
# @param account_id [String]
|
|
@@ -659,7 +659,7 @@ module SnapTrade
|
|
|
659
659
|
#
|
|
660
660
|
# 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:
|
|
661
661
|
# - If you do, this endpoint returns real-time data.
|
|
662
|
-
# - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.
|
|
662
|
+
# - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
|
|
663
663
|
#
|
|
664
664
|
# 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.
|
|
665
665
|
#
|
|
@@ -682,7 +682,7 @@ module SnapTrade
|
|
|
682
682
|
#
|
|
683
683
|
# 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:
|
|
684
684
|
# - If you do, this endpoint returns real-time data.
|
|
685
|
-
# - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.
|
|
685
|
+
# - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
|
|
686
686
|
#
|
|
687
687
|
# 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.
|
|
688
688
|
#
|
|
@@ -699,7 +699,7 @@ module SnapTrade
|
|
|
699
699
|
end
|
|
700
700
|
|
|
701
701
|
# List account orders
|
|
702
|
-
# Returns a list of recent orders in the specified account. 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: - If you do, this endpoint returns real-time data. - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.
|
|
702
|
+
# Returns a list of recent orders in the specified account. 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: - If you do, this endpoint returns real-time data. - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
|
|
703
703
|
# @param user_id [String]
|
|
704
704
|
# @param user_secret [String]
|
|
705
705
|
# @param account_id [String]
|
|
@@ -713,7 +713,7 @@ module SnapTrade
|
|
|
713
713
|
end
|
|
714
714
|
|
|
715
715
|
# List account orders
|
|
716
|
-
# Returns a list of recent orders in the specified account. 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: - If you do, this endpoint returns real-time data. - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.
|
|
716
|
+
# Returns a list of recent orders in the specified account. 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: - If you do, this endpoint returns real-time data. - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
|
|
717
717
|
# @param user_id [String]
|
|
718
718
|
# @param user_secret [String]
|
|
719
719
|
# @param account_id [String]
|
|
@@ -796,7 +796,7 @@ module SnapTrade
|
|
|
796
796
|
#
|
|
797
797
|
# 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:
|
|
798
798
|
# - If you do, this endpoint returns real-time data.
|
|
799
|
-
# - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.
|
|
799
|
+
# - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
|
|
800
800
|
#
|
|
801
801
|
# 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.
|
|
802
802
|
#
|
|
@@ -815,7 +815,7 @@ module SnapTrade
|
|
|
815
815
|
#
|
|
816
816
|
# 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:
|
|
817
817
|
# - If you do, this endpoint returns real-time data.
|
|
818
|
-
# - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.
|
|
818
|
+
# - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
|
|
819
819
|
#
|
|
820
820
|
# 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.
|
|
821
821
|
#
|
|
@@ -828,7 +828,7 @@ module SnapTrade
|
|
|
828
828
|
end
|
|
829
829
|
|
|
830
830
|
# List account positions
|
|
831
|
-
# 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). 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: - If you do, this endpoint returns real-time data. - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.
|
|
831
|
+
# 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). 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: - If you do, this endpoint returns real-time data. - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
|
|
832
832
|
# @param user_id [String]
|
|
833
833
|
# @param user_secret [String]
|
|
834
834
|
# @param account_id [String]
|
|
@@ -840,7 +840,7 @@ module SnapTrade
|
|
|
840
840
|
end
|
|
841
841
|
|
|
842
842
|
# List account positions
|
|
843
|
-
# 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). 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: - If you do, this endpoint returns real-time data. - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.
|
|
843
|
+
# 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). 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: - If you do, this endpoint returns real-time data. - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
|
|
844
844
|
# @param user_id [String]
|
|
845
845
|
# @param user_secret [String]
|
|
846
846
|
# @param account_id [String]
|
|
@@ -1130,7 +1130,7 @@ module SnapTrade
|
|
|
1130
1130
|
#
|
|
1131
1131
|
# 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:
|
|
1132
1132
|
# - If you do, this endpoint returns real-time data.
|
|
1133
|
-
# - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.
|
|
1133
|
+
# - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
|
|
1134
1134
|
#
|
|
1135
1135
|
# 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.
|
|
1136
1136
|
#
|
|
@@ -1149,7 +1149,7 @@ module SnapTrade
|
|
|
1149
1149
|
#
|
|
1150
1150
|
# 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:
|
|
1151
1151
|
# - If you do, this endpoint returns real-time data.
|
|
1152
|
-
# - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.
|
|
1152
|
+
# - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
|
|
1153
1153
|
#
|
|
1154
1154
|
# 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.
|
|
1155
1155
|
#
|
|
@@ -1162,7 +1162,7 @@ module SnapTrade
|
|
|
1162
1162
|
end
|
|
1163
1163
|
|
|
1164
1164
|
# List account holdings
|
|
1165
|
-
# 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.__ 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: - If you do, this endpoint returns real-time data. - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.
|
|
1165
|
+
# 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.__ 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: - If you do, this endpoint returns real-time data. - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
|
|
1166
1166
|
# @param account_id [String]
|
|
1167
1167
|
# @param user_id [String]
|
|
1168
1168
|
# @param user_secret [String]
|
|
@@ -1174,7 +1174,7 @@ module SnapTrade
|
|
|
1174
1174
|
end
|
|
1175
1175
|
|
|
1176
1176
|
# List account holdings
|
|
1177
|
-
# 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.__ 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: - If you do, this endpoint returns real-time data. - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.
|
|
1177
|
+
# 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.__ 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: - If you do, this endpoint returns real-time data. - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
|
|
1178
1178
|
# @param account_id [String]
|
|
1179
1179
|
# @param user_id [String]
|
|
1180
1180
|
# @param user_secret [String]
|
|
@@ -188,7 +188,7 @@ module SnapTrade
|
|
|
188
188
|
#
|
|
189
189
|
# @param user_id [String]
|
|
190
190
|
# @param user_secret [String]
|
|
191
|
-
# @param broker [String] Slug of the brokerage to connect the user to. See [the integrations page](https://snaptrade.
|
|
191
|
+
# @param broker [String] Slug of the brokerage to connect the user to. See [the integrations page](https://support.snaptrade.com/brokerages) for a list of supported brokerages and their slugs.
|
|
192
192
|
# @param immediate_redirect [Boolean] When set to `true`, user will be redirected back to the partner's site instead of the connection portal. This parameter is ignored if the connection portal is loaded inside an iframe. See the [guide on ways to integrate the connection portal](/docs/implement-connection-portal) for more information.
|
|
193
193
|
# @param custom_redirect [String] URL to redirect the user to after the user connects their brokerage account. This parameter is ignored if the connection portal is loaded inside an iframe. See the [guide on ways to integrate the connection portal](/docs/implement-connection-portal) for more information.
|
|
194
194
|
# @param reconnect [String] The UUID of the brokerage connection to be reconnected. This parameter should be left empty unless you are reconnecting a disabled connection. See the [guide on fixing broken connections](/docs/fix-broken-connections) for more information.
|
|
@@ -221,7 +221,7 @@ module SnapTrade
|
|
|
221
221
|
#
|
|
222
222
|
# @param user_id [String]
|
|
223
223
|
# @param user_secret [String]
|
|
224
|
-
# @param broker [String] Slug of the brokerage to connect the user to. See [the integrations page](https://snaptrade.
|
|
224
|
+
# @param broker [String] Slug of the brokerage to connect the user to. See [the integrations page](https://support.snaptrade.com/brokerages) for a list of supported brokerages and their slugs.
|
|
225
225
|
# @param immediate_redirect [Boolean] When set to `true`, user will be redirected back to the partner's site instead of the connection portal. This parameter is ignored if the connection portal is loaded inside an iframe. See the [guide on ways to integrate the connection portal](/docs/implement-connection-portal) for more information.
|
|
226
226
|
# @param custom_redirect [String] URL to redirect the user to after the user connects their brokerage account. This parameter is ignored if the connection portal is loaded inside an iframe. See the [guide on ways to integrate the connection portal](/docs/implement-connection-portal) for more information.
|
|
227
227
|
# @param reconnect [String] The UUID of the brokerage connection to be reconnected. This parameter should be left empty unless you are reconnecting a disabled connection. See the [guide on fixing broken connections](/docs/fix-broken-connections) for more information.
|
|
@@ -17,6 +17,109 @@ module SnapTrade
|
|
|
17
17
|
@api_client = api_client
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
+
# List historical account total value
|
|
21
|
+
#
|
|
22
|
+
# 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.
|
|
23
|
+
#
|
|
24
|
+
# @param user_id [String]
|
|
25
|
+
# @param user_secret [String]
|
|
26
|
+
# @param account_id [String]
|
|
27
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
28
|
+
def get_account_balance_history(user_id:, user_secret:, account_id:, extra: {})
|
|
29
|
+
data, _status_code, _headers = get_account_balance_history_with_http_info_impl(user_id, user_secret, account_id, extra)
|
|
30
|
+
data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# List historical account total value
|
|
34
|
+
#
|
|
35
|
+
# 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.
|
|
36
|
+
#
|
|
37
|
+
# @param user_id [String]
|
|
38
|
+
# @param user_secret [String]
|
|
39
|
+
# @param account_id [String]
|
|
40
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
41
|
+
def get_account_balance_history_with_http_info(user_id:, user_secret:, account_id:, extra: {})
|
|
42
|
+
get_account_balance_history_with_http_info_impl(user_id, user_secret, account_id, extra)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# List historical account total value
|
|
46
|
+
# 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.
|
|
47
|
+
# @param user_id [String]
|
|
48
|
+
# @param user_secret [String]
|
|
49
|
+
# @param account_id [String]
|
|
50
|
+
# @param [Hash] opts the optional parameters
|
|
51
|
+
# @return [AccountValueHistoryResponse]
|
|
52
|
+
private def get_account_balance_history_impl(user_id, user_secret, account_id, opts = {})
|
|
53
|
+
data, _status_code, _headers = get_account_balance_history_with_http_info(user_id, user_secret, account_id, opts)
|
|
54
|
+
data
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# List historical account total value
|
|
58
|
+
# 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.
|
|
59
|
+
# @param user_id [String]
|
|
60
|
+
# @param user_secret [String]
|
|
61
|
+
# @param account_id [String]
|
|
62
|
+
# @param [Hash] opts the optional parameters
|
|
63
|
+
# @return [Array<(AccountValueHistoryResponse, Integer, Hash)>] AccountValueHistoryResponse data, response status code and response headers
|
|
64
|
+
private def get_account_balance_history_with_http_info_impl(user_id, user_secret, account_id, opts = {})
|
|
65
|
+
if @api_client.config.debugging
|
|
66
|
+
@api_client.config.logger.debug 'Calling API: ExperimentalEndpointsApi.get_account_balance_history ...'
|
|
67
|
+
end
|
|
68
|
+
# verify the required parameter 'user_id' is set
|
|
69
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
70
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling ExperimentalEndpointsApi.get_account_balance_history"
|
|
71
|
+
end
|
|
72
|
+
# verify the required parameter 'user_secret' is set
|
|
73
|
+
if @api_client.config.client_side_validation && user_secret.nil?
|
|
74
|
+
fail ArgumentError, "Missing the required parameter 'user_secret' when calling ExperimentalEndpointsApi.get_account_balance_history"
|
|
75
|
+
end
|
|
76
|
+
# verify the required parameter 'account_id' is set
|
|
77
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
78
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling ExperimentalEndpointsApi.get_account_balance_history"
|
|
79
|
+
end
|
|
80
|
+
# resource path
|
|
81
|
+
local_var_path = '/accounts/{accountId}/balanceHistory'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
|
|
82
|
+
|
|
83
|
+
# query parameters
|
|
84
|
+
query_params = opts[:query_params] || {}
|
|
85
|
+
query_params[:'userId'] = user_id
|
|
86
|
+
query_params[:'userSecret'] = user_secret
|
|
87
|
+
|
|
88
|
+
# header parameters
|
|
89
|
+
header_params = opts[:header_params] || {}
|
|
90
|
+
# HTTP header 'Accept' (if needed)
|
|
91
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
92
|
+
|
|
93
|
+
# form parameters
|
|
94
|
+
form_params = opts[:form_params] || {}
|
|
95
|
+
|
|
96
|
+
# http body (model)
|
|
97
|
+
post_body = opts[:debug_body]
|
|
98
|
+
|
|
99
|
+
# return_type
|
|
100
|
+
return_type = opts[:debug_return_type] || 'AccountValueHistoryResponse'
|
|
101
|
+
|
|
102
|
+
# auth_names
|
|
103
|
+
auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
|
|
104
|
+
|
|
105
|
+
new_options = opts.merge(
|
|
106
|
+
:operation => :"ExperimentalEndpointsApi.get_account_balance_history",
|
|
107
|
+
:header_params => header_params,
|
|
108
|
+
:query_params => query_params,
|
|
109
|
+
:form_params => form_params,
|
|
110
|
+
:body => post_body,
|
|
111
|
+
:auth_names => auth_names,
|
|
112
|
+
:return_type => return_type
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
|
|
116
|
+
if @api_client.config.debugging
|
|
117
|
+
@api_client.config.logger.debug "API called: ExperimentalEndpointsApi#get_account_balance_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
118
|
+
end
|
|
119
|
+
return data, status_code, headers, response
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
|
|
20
123
|
# Get account order detail (V2)
|
|
21
124
|
#
|
|
22
125
|
# Returns the detail of a single order using the brokerage order ID provided as a path parameter.
|