snaptrade 2.0.190 → 2.0.192
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 +50 -46
- data/lib/snaptrade/api/account_information_api.rb +121 -2
- data/lib/snaptrade/api/connections_api.rb +4 -4
- data/lib/snaptrade/api/experimental_endpoints_api.rb +0 -115
- data/lib/snaptrade/api/options_api.rb +6 -2
- data/lib/snaptrade/api/trading_api.rb +8 -8
- data/lib/snaptrade/version.rb +1 -1
- data/spec/api/account_information_api_spec.rb +15 -1
- data/spec/api/connections_api_spec.rb +1 -1
- data/spec/api/experimental_endpoints_api_spec.rb +0 -14
- data/spec/api/options_api_spec.rb +1 -1
- data/spec/api/trading_api_spec.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9ede6e6181e46a7500e67d7e924f252bc910cf62589cbf0d62fddf63920e3879
|
|
4
|
+
data.tar.gz: 5788add5fcbebce33f39e072191df96cac0e961cfb0e171845360b1cd2b99c2f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9fcb591561aef1f10e2da66be446a595a1fb25045295f501d833f1cb0b788bcc9957f5f0fe9d38d47825dbf498a80417e42e88bc8c1dd2299690694dc197f44d
|
|
7
|
+
data.tar.gz: ffffe7b8ee6e417a32b19547e44488bb068d9ef6b5446b492fe89d6651241fdcb27d0087f0ae45d06de5b6949b44972f6e41400e0743c82e98c07aebbc4aafc0
|
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.192)
|
|
10
10
|
[](https://snaptrade.com/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
@@ -21,6 +21,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
21
21
|
- [Reference](#reference)
|
|
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
|
+
* [`snaptrade.account_information.get_all_account_positions`](#snaptradeaccount_informationget_all_account_positions)
|
|
24
25
|
* [`snaptrade.account_information.get_all_user_holdings`](#snaptradeaccount_informationget_all_user_holdings)
|
|
25
26
|
* [`snaptrade.account_information.get_user_account_balance`](#snaptradeaccount_informationget_user_account_balance)
|
|
26
27
|
* [`snaptrade.account_information.get_user_account_details`](#snaptradeaccount_informationget_user_account_details)
|
|
@@ -47,7 +48,6 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
47
48
|
* [`snaptrade.connections.remove_brokerage_authorization`](#snaptradeconnectionsremove_brokerage_authorization)
|
|
48
49
|
* [`snaptrade.connections.return_rates`](#snaptradeconnectionsreturn_rates)
|
|
49
50
|
* [`snaptrade.connections.session_events`](#snaptradeconnectionssession_events)
|
|
50
|
-
* [`snaptrade.experimental_endpoints.get_all_account_positions`](#snaptradeexperimental_endpointsget_all_account_positions)
|
|
51
51
|
* [`snaptrade.experimental_endpoints.get_user_account_order_detail_v2`](#snaptradeexperimental_endpointsget_user_account_order_detail_v2)
|
|
52
52
|
* [`snaptrade.experimental_endpoints.get_user_account_orders_v2`](#snaptradeexperimental_endpointsget_user_account_orders_v2)
|
|
53
53
|
* [`snaptrade.experimental_endpoints.get_user_account_recent_orders_v2`](#snaptradeexperimental_endpointsget_user_account_recent_orders_v2)
|
|
@@ -91,7 +91,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
91
91
|
Add to Gemfile:
|
|
92
92
|
|
|
93
93
|
```ruby
|
|
94
|
-
gem 'snaptrade', '~> 2.0.
|
|
94
|
+
gem 'snaptrade', '~> 2.0.192'
|
|
95
95
|
```
|
|
96
96
|
|
|
97
97
|
## Getting Started<a id="getting-started"></a>
|
|
@@ -252,6 +252,46 @@ p result
|
|
|
252
252
|
---
|
|
253
253
|
|
|
254
254
|
|
|
255
|
+
### `snaptrade.account_information.get_all_account_positions`<a id="snaptradeaccount_informationget_all_account_positions"></a>
|
|
256
|
+
|
|
257
|
+
Returns a list of all positions in the specified account.
|
|
258
|
+
|
|
259
|
+
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`.
|
|
260
|
+
|
|
261
|
+
Stock positions may also include `cash_equivalent`, and may include `tax_lots` when tax lot data is enabled for the account.
|
|
262
|
+
|
|
263
|
+
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.
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
267
|
+
|
|
268
|
+
```ruby
|
|
269
|
+
result = snaptrade.account_information.get_all_account_positions(
|
|
270
|
+
user_id: "snaptrade-user-123",
|
|
271
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
272
|
+
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
273
|
+
)
|
|
274
|
+
p result
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
278
|
+
|
|
279
|
+
##### user_id: `String`<a id="user_id-string"></a>
|
|
280
|
+
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
281
|
+
##### account_id: `String`<a id="account_id-string"></a>
|
|
282
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
283
|
+
|
|
284
|
+
[AllAccountPositionsResponse](./lib/snaptrade/models/all_account_positions_response.rb)
|
|
285
|
+
|
|
286
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
287
|
+
|
|
288
|
+
`/accounts/{accountId}/positions/all` `GET`
|
|
289
|
+
|
|
290
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
|
|
255
295
|
### `snaptrade.account_information.get_all_user_holdings`<a id="snaptradeaccount_informationget_all_user_holdings"></a>
|
|
256
296
|

|
|
257
297
|
|
|
@@ -473,6 +513,8 @@ Number of days in the past to fetch the most recent orders. Defaults to the last
|
|
|
473
513
|
|
|
474
514
|
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).
|
|
475
515
|
|
|
516
|
+
Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures.
|
|
517
|
+
|
|
476
518
|
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:
|
|
477
519
|
- If you do, this endpoint returns real-time data.
|
|
478
520
|
- 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.
|
|
@@ -1042,7 +1084,7 @@ p result
|
|
|
1042
1084
|
|
|
1043
1085
|
Returns all brokerage accounts that belong to the specified connection for the authenticated user.
|
|
1044
1086
|
|
|
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.
|
|
1087
|
+
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
1088
|
|
|
1047
1089
|
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
1090
|
|
|
@@ -1259,46 +1301,6 @@ specific users
|
|
|
1259
1301
|
---
|
|
1260
1302
|
|
|
1261
1303
|
|
|
1262
|
-
### `snaptrade.experimental_endpoints.get_all_account_positions`<a id="snaptradeexperimental_endpointsget_all_account_positions"></a>
|
|
1263
|
-
|
|
1264
|
-
Returns a list of all positions in the specified account.
|
|
1265
|
-
|
|
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`.
|
|
1267
|
-
|
|
1268
|
-
Stock positions may also include `cash_equivalent`, and may include `tax_lots` when tax lot data is enabled for the account.
|
|
1269
|
-
|
|
1270
|
-
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.
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1274
|
-
|
|
1275
|
-
```ruby
|
|
1276
|
-
result = snaptrade.experimental_endpoints.get_all_account_positions(
|
|
1277
|
-
user_id: "snaptrade-user-123",
|
|
1278
|
-
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1279
|
-
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
1280
|
-
)
|
|
1281
|
-
p result
|
|
1282
|
-
```
|
|
1283
|
-
|
|
1284
|
-
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1285
|
-
|
|
1286
|
-
##### user_id: `String`<a id="user_id-string"></a>
|
|
1287
|
-
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
1288
|
-
##### account_id: `String`<a id="account_id-string"></a>
|
|
1289
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
1290
|
-
|
|
1291
|
-
[AllAccountPositionsResponse](./lib/snaptrade/models/all_account_positions_response.rb)
|
|
1292
|
-
|
|
1293
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1294
|
-
|
|
1295
|
-
`/accounts/{accountId}/positions/all` `GET`
|
|
1296
|
-
|
|
1297
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1298
|
-
|
|
1299
|
-
---
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
1304
|
### `snaptrade.experimental_endpoints.get_user_account_order_detail_v2`<a id="snaptradeexperimental_endpointsget_user_account_order_detail_v2"></a>
|
|
1303
1305
|
|
|
1304
1306
|
Returns the detail of a single order using the brokerage order ID provided as a path parameter.
|
|
@@ -1470,6 +1472,8 @@ p result
|
|
|
1470
1472
|
|
|
1471
1473
|
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).
|
|
1472
1474
|
|
|
1475
|
+
Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures.
|
|
1476
|
+
|
|
1473
1477
|
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:
|
|
1474
1478
|
- If you do, this endpoint returns real-time data.
|
|
1475
1479
|
- 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.
|
|
@@ -2150,7 +2154,7 @@ The OCC-formatted option symbol.
|
|
|
2150
2154
|
|
|
2151
2155
|
### `snaptrade.trading.get_user_account_quotes`<a id="snaptradetradingget_user_account_quotes"></a>
|
|
2152
2156
|
|
|
2153
|
-
Returns quotes from the brokerage for the specified symbols and account.
|
|
2157
|
+
Returns a maximum of 10 quotes from the brokerage for the specified symbols and account.
|
|
2154
2158
|
|
|
2155
2159
|
The quotes returned can be delayed depending on the brokerage the account belongs to. It is highly recommended that you use your own market data provider for real-time quotes instead of relying on this endpoint.
|
|
2156
2160
|
|
|
@@ -2180,7 +2184,7 @@ p result
|
|
|
2180
2184
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
2181
2185
|
##### symbols: `String`<a id="symbols-string"></a>
|
|
2182
2186
|
List of Universal Symbol IDs or tickers to get quotes for. When providing
|
|
2183
|
-
multiple values, use a comma as separator
|
|
2187
|
+
multiple values, use a comma as separator. Maximum of 10 values allowed
|
|
2184
2188
|
|
|
2185
2189
|
##### account_id: `String`<a id="account_id-string"></a>
|
|
2186
2190
|
##### use_ticker: `Boolean`<a id="use_ticker-boolean"></a>
|
|
@@ -282,6 +282,121 @@ module SnapTrade
|
|
|
282
282
|
end
|
|
283
283
|
|
|
284
284
|
|
|
285
|
+
# List all account positions
|
|
286
|
+
#
|
|
287
|
+
# Returns a list of all positions in the specified account.
|
|
288
|
+
#
|
|
289
|
+
# 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`.
|
|
290
|
+
#
|
|
291
|
+
# Stock positions may also include `cash_equivalent`, and may include `tax_lots` when tax lot data is enabled for the account.
|
|
292
|
+
#
|
|
293
|
+
# 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.
|
|
294
|
+
#
|
|
295
|
+
# @param user_id [String]
|
|
296
|
+
# @param user_secret [String]
|
|
297
|
+
# @param account_id [String]
|
|
298
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
299
|
+
def get_all_account_positions(user_id:, user_secret:, account_id:, extra: {})
|
|
300
|
+
data, _status_code, _headers = get_all_account_positions_with_http_info_impl(user_id, user_secret, account_id, extra)
|
|
301
|
+
data
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
# List all account positions
|
|
305
|
+
#
|
|
306
|
+
# Returns a list of all positions in the specified account.
|
|
307
|
+
#
|
|
308
|
+
# 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`.
|
|
309
|
+
#
|
|
310
|
+
# Stock positions may also include `cash_equivalent`, and may include `tax_lots` when tax lot data is enabled for the account.
|
|
311
|
+
#
|
|
312
|
+
# 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.
|
|
313
|
+
#
|
|
314
|
+
# @param user_id [String]
|
|
315
|
+
# @param user_secret [String]
|
|
316
|
+
# @param account_id [String]
|
|
317
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
318
|
+
def get_all_account_positions_with_http_info(user_id:, user_secret:, account_id:, extra: {})
|
|
319
|
+
get_all_account_positions_with_http_info_impl(user_id, user_secret, account_id, extra)
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
# List all account positions
|
|
323
|
+
# Returns a list of all positions in the specified account. 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`. Stock positions may also include `cash_equivalent`, and may include `tax_lots` when tax lot data is enabled for the account. 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.
|
|
324
|
+
# @param user_id [String]
|
|
325
|
+
# @param user_secret [String]
|
|
326
|
+
# @param account_id [String]
|
|
327
|
+
# @param [Hash] opts the optional parameters
|
|
328
|
+
# @return [AllAccountPositionsResponse]
|
|
329
|
+
private def get_all_account_positions_impl(user_id, user_secret, account_id, opts = {})
|
|
330
|
+
data, _status_code, _headers = get_all_account_positions_with_http_info(user_id, user_secret, account_id, opts)
|
|
331
|
+
data
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
# List all account positions
|
|
335
|
+
# Returns a list of all positions in the specified account. 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`. Stock positions may also include `cash_equivalent`, and may include `tax_lots` when tax lot data is enabled for the account. 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.
|
|
336
|
+
# @param user_id [String]
|
|
337
|
+
# @param user_secret [String]
|
|
338
|
+
# @param account_id [String]
|
|
339
|
+
# @param [Hash] opts the optional parameters
|
|
340
|
+
# @return [Array<(AllAccountPositionsResponse, Integer, Hash)>] AllAccountPositionsResponse data, response status code and response headers
|
|
341
|
+
private def get_all_account_positions_with_http_info_impl(user_id, user_secret, account_id, opts = {})
|
|
342
|
+
if @api_client.config.debugging
|
|
343
|
+
@api_client.config.logger.debug 'Calling API: AccountInformationApi.get_all_account_positions ...'
|
|
344
|
+
end
|
|
345
|
+
# verify the required parameter 'user_id' is set
|
|
346
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
347
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AccountInformationApi.get_all_account_positions"
|
|
348
|
+
end
|
|
349
|
+
# verify the required parameter 'user_secret' is set
|
|
350
|
+
if @api_client.config.client_side_validation && user_secret.nil?
|
|
351
|
+
fail ArgumentError, "Missing the required parameter 'user_secret' when calling AccountInformationApi.get_all_account_positions"
|
|
352
|
+
end
|
|
353
|
+
# verify the required parameter 'account_id' is set
|
|
354
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
355
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountInformationApi.get_all_account_positions"
|
|
356
|
+
end
|
|
357
|
+
# resource path
|
|
358
|
+
local_var_path = '/accounts/{accountId}/positions/all'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
|
|
359
|
+
|
|
360
|
+
# query parameters
|
|
361
|
+
query_params = opts[:query_params] || {}
|
|
362
|
+
query_params[:'userId'] = user_id
|
|
363
|
+
query_params[:'userSecret'] = user_secret
|
|
364
|
+
|
|
365
|
+
# header parameters
|
|
366
|
+
header_params = opts[:header_params] || {}
|
|
367
|
+
# HTTP header 'Accept' (if needed)
|
|
368
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
369
|
+
|
|
370
|
+
# form parameters
|
|
371
|
+
form_params = opts[:form_params] || {}
|
|
372
|
+
|
|
373
|
+
# http body (model)
|
|
374
|
+
post_body = opts[:debug_body]
|
|
375
|
+
|
|
376
|
+
# return_type
|
|
377
|
+
return_type = opts[:debug_return_type] || 'AllAccountPositionsResponse'
|
|
378
|
+
|
|
379
|
+
# auth_names
|
|
380
|
+
auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
|
|
381
|
+
|
|
382
|
+
new_options = opts.merge(
|
|
383
|
+
:operation => :"AccountInformationApi.get_all_account_positions",
|
|
384
|
+
:header_params => header_params,
|
|
385
|
+
:query_params => query_params,
|
|
386
|
+
:form_params => form_params,
|
|
387
|
+
:body => post_body,
|
|
388
|
+
:auth_names => auth_names,
|
|
389
|
+
:return_type => return_type
|
|
390
|
+
)
|
|
391
|
+
|
|
392
|
+
data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
|
|
393
|
+
if @api_client.config.debugging
|
|
394
|
+
@api_client.config.logger.debug "API called: AccountInformationApi#get_all_account_positions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
395
|
+
end
|
|
396
|
+
return data, status_code, headers, response
|
|
397
|
+
end
|
|
398
|
+
|
|
399
|
+
|
|
285
400
|
# List all accounts for the user, plus balances, positions, and orders for each account.
|
|
286
401
|
#
|
|
287
402
|
# **Deprecated, please use the account-specific holdings endpoint instead.**
|
|
@@ -905,6 +1020,8 @@ module SnapTrade
|
|
|
905
1020
|
#
|
|
906
1021
|
# 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).
|
|
907
1022
|
#
|
|
1023
|
+
# Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures.
|
|
1024
|
+
#
|
|
908
1025
|
# 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:
|
|
909
1026
|
# - If you do, this endpoint returns real-time data.
|
|
910
1027
|
# - 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.
|
|
@@ -924,6 +1041,8 @@ module SnapTrade
|
|
|
924
1041
|
#
|
|
925
1042
|
# 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).
|
|
926
1043
|
#
|
|
1044
|
+
# Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures.
|
|
1045
|
+
#
|
|
927
1046
|
# 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:
|
|
928
1047
|
# - If you do, this endpoint returns real-time data.
|
|
929
1048
|
# - 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.
|
|
@@ -939,7 +1058,7 @@ module SnapTrade
|
|
|
939
1058
|
end
|
|
940
1059
|
|
|
941
1060
|
# List account positions
|
|
942
|
-
# 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.
|
|
1061
|
+
# 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). Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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.
|
|
943
1062
|
# @param user_id [String]
|
|
944
1063
|
# @param user_secret [String]
|
|
945
1064
|
# @param account_id [String]
|
|
@@ -951,7 +1070,7 @@ module SnapTrade
|
|
|
951
1070
|
end
|
|
952
1071
|
|
|
953
1072
|
# List account positions
|
|
954
|
-
# 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.
|
|
1073
|
+
# 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). Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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.
|
|
955
1074
|
# @param user_id [String]
|
|
956
1075
|
# @param user_secret [String]
|
|
957
1076
|
# @param account_id [String]
|
|
@@ -336,7 +336,7 @@ module SnapTrade
|
|
|
336
336
|
#
|
|
337
337
|
# Returns all brokerage accounts that belong to the specified connection for the authenticated user.
|
|
338
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.
|
|
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
340
|
#
|
|
341
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
342
|
#
|
|
@@ -355,7 +355,7 @@ module SnapTrade
|
|
|
355
355
|
#
|
|
356
356
|
# Returns all brokerage accounts that belong to the specified connection for the authenticated user.
|
|
357
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.
|
|
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
359
|
#
|
|
360
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
361
|
#
|
|
@@ -370,7 +370,7 @@ module SnapTrade
|
|
|
370
370
|
end
|
|
371
371
|
|
|
372
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.
|
|
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
374
|
# @param authorization_id [String]
|
|
375
375
|
# @param user_id [String]
|
|
376
376
|
# @param user_secret [String]
|
|
@@ -382,7 +382,7 @@ module SnapTrade
|
|
|
382
382
|
end
|
|
383
383
|
|
|
384
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.
|
|
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
386
|
# @param authorization_id [String]
|
|
387
387
|
# @param user_id [String]
|
|
388
388
|
# @param user_secret [String]
|
|
@@ -17,121 +17,6 @@ module SnapTrade
|
|
|
17
17
|
@api_client = api_client
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
# List all account positions
|
|
21
|
-
#
|
|
22
|
-
# Returns a list of all positions in the specified account.
|
|
23
|
-
#
|
|
24
|
-
# 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`.
|
|
25
|
-
#
|
|
26
|
-
# Stock positions may also include `cash_equivalent`, and may include `tax_lots` when tax lot data is enabled for the account.
|
|
27
|
-
#
|
|
28
|
-
# 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.
|
|
29
|
-
#
|
|
30
|
-
# @param user_id [String]
|
|
31
|
-
# @param user_secret [String]
|
|
32
|
-
# @param account_id [String]
|
|
33
|
-
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
34
|
-
def get_all_account_positions(user_id:, user_secret:, account_id:, extra: {})
|
|
35
|
-
data, _status_code, _headers = get_all_account_positions_with_http_info_impl(user_id, user_secret, account_id, extra)
|
|
36
|
-
data
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
# List all account positions
|
|
40
|
-
#
|
|
41
|
-
# Returns a list of all positions in the specified account.
|
|
42
|
-
#
|
|
43
|
-
# 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`.
|
|
44
|
-
#
|
|
45
|
-
# Stock positions may also include `cash_equivalent`, and may include `tax_lots` when tax lot data is enabled for the account.
|
|
46
|
-
#
|
|
47
|
-
# 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.
|
|
48
|
-
#
|
|
49
|
-
# @param user_id [String]
|
|
50
|
-
# @param user_secret [String]
|
|
51
|
-
# @param account_id [String]
|
|
52
|
-
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
53
|
-
def get_all_account_positions_with_http_info(user_id:, user_secret:, account_id:, extra: {})
|
|
54
|
-
get_all_account_positions_with_http_info_impl(user_id, user_secret, account_id, extra)
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
# List all account positions
|
|
58
|
-
# Returns a list of all positions in the specified account. 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`. Stock positions may also include `cash_equivalent`, and may include `tax_lots` when tax lot data is enabled for the account. 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.
|
|
59
|
-
# @param user_id [String]
|
|
60
|
-
# @param user_secret [String]
|
|
61
|
-
# @param account_id [String]
|
|
62
|
-
# @param [Hash] opts the optional parameters
|
|
63
|
-
# @return [AllAccountPositionsResponse]
|
|
64
|
-
private def get_all_account_positions_impl(user_id, user_secret, account_id, opts = {})
|
|
65
|
-
data, _status_code, _headers = get_all_account_positions_with_http_info(user_id, user_secret, account_id, opts)
|
|
66
|
-
data
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
# List all account positions
|
|
70
|
-
# Returns a list of all positions in the specified account. 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`. Stock positions may also include `cash_equivalent`, and may include `tax_lots` when tax lot data is enabled for the account. 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.
|
|
71
|
-
# @param user_id [String]
|
|
72
|
-
# @param user_secret [String]
|
|
73
|
-
# @param account_id [String]
|
|
74
|
-
# @param [Hash] opts the optional parameters
|
|
75
|
-
# @return [Array<(AllAccountPositionsResponse, Integer, Hash)>] AllAccountPositionsResponse data, response status code and response headers
|
|
76
|
-
private def get_all_account_positions_with_http_info_impl(user_id, user_secret, account_id, opts = {})
|
|
77
|
-
if @api_client.config.debugging
|
|
78
|
-
@api_client.config.logger.debug 'Calling API: ExperimentalEndpointsApi.get_all_account_positions ...'
|
|
79
|
-
end
|
|
80
|
-
# verify the required parameter 'user_id' is set
|
|
81
|
-
if @api_client.config.client_side_validation && user_id.nil?
|
|
82
|
-
fail ArgumentError, "Missing the required parameter 'user_id' when calling ExperimentalEndpointsApi.get_all_account_positions"
|
|
83
|
-
end
|
|
84
|
-
# verify the required parameter 'user_secret' is set
|
|
85
|
-
if @api_client.config.client_side_validation && user_secret.nil?
|
|
86
|
-
fail ArgumentError, "Missing the required parameter 'user_secret' when calling ExperimentalEndpointsApi.get_all_account_positions"
|
|
87
|
-
end
|
|
88
|
-
# verify the required parameter 'account_id' is set
|
|
89
|
-
if @api_client.config.client_side_validation && account_id.nil?
|
|
90
|
-
fail ArgumentError, "Missing the required parameter 'account_id' when calling ExperimentalEndpointsApi.get_all_account_positions"
|
|
91
|
-
end
|
|
92
|
-
# resource path
|
|
93
|
-
local_var_path = '/accounts/{accountId}/positions/all'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
|
|
94
|
-
|
|
95
|
-
# query parameters
|
|
96
|
-
query_params = opts[:query_params] || {}
|
|
97
|
-
query_params[:'userId'] = user_id
|
|
98
|
-
query_params[:'userSecret'] = user_secret
|
|
99
|
-
|
|
100
|
-
# header parameters
|
|
101
|
-
header_params = opts[:header_params] || {}
|
|
102
|
-
# HTTP header 'Accept' (if needed)
|
|
103
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
104
|
-
|
|
105
|
-
# form parameters
|
|
106
|
-
form_params = opts[:form_params] || {}
|
|
107
|
-
|
|
108
|
-
# http body (model)
|
|
109
|
-
post_body = opts[:debug_body]
|
|
110
|
-
|
|
111
|
-
# return_type
|
|
112
|
-
return_type = opts[:debug_return_type] || 'AllAccountPositionsResponse'
|
|
113
|
-
|
|
114
|
-
# auth_names
|
|
115
|
-
auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
|
|
116
|
-
|
|
117
|
-
new_options = opts.merge(
|
|
118
|
-
:operation => :"ExperimentalEndpointsApi.get_all_account_positions",
|
|
119
|
-
:header_params => header_params,
|
|
120
|
-
:query_params => query_params,
|
|
121
|
-
:form_params => form_params,
|
|
122
|
-
:body => post_body,
|
|
123
|
-
:auth_names => auth_names,
|
|
124
|
-
:return_type => return_type
|
|
125
|
-
)
|
|
126
|
-
|
|
127
|
-
data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
|
|
128
|
-
if @api_client.config.debugging
|
|
129
|
-
@api_client.config.logger.debug "API called: ExperimentalEndpointsApi#get_all_account_positions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
130
|
-
end
|
|
131
|
-
return data, status_code, headers, response
|
|
132
|
-
end
|
|
133
|
-
|
|
134
|
-
|
|
135
20
|
# Get account order detail (V2)
|
|
136
21
|
#
|
|
137
22
|
# Returns the detail of a single order using the brokerage order ID provided as a path parameter.
|
|
@@ -21,6 +21,8 @@ module SnapTrade
|
|
|
21
21
|
#
|
|
22
22
|
# 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).
|
|
23
23
|
#
|
|
24
|
+
# Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures.
|
|
25
|
+
#
|
|
24
26
|
# 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:
|
|
25
27
|
# - If you do, this endpoint returns real-time data.
|
|
26
28
|
# - 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.
|
|
@@ -38,6 +40,8 @@ module SnapTrade
|
|
|
38
40
|
#
|
|
39
41
|
# 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).
|
|
40
42
|
#
|
|
43
|
+
# Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures.
|
|
44
|
+
#
|
|
41
45
|
# 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:
|
|
42
46
|
# - If you do, this endpoint returns real-time data.
|
|
43
47
|
# - 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.
|
|
@@ -51,7 +55,7 @@ module SnapTrade
|
|
|
51
55
|
end
|
|
52
56
|
|
|
53
57
|
# List account option positions
|
|
54
|
-
# 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). 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.
|
|
58
|
+
# 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). Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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.
|
|
55
59
|
# @param user_id [String]
|
|
56
60
|
# @param user_secret [String]
|
|
57
61
|
# @param account_id [String]
|
|
@@ -63,7 +67,7 @@ module SnapTrade
|
|
|
63
67
|
end
|
|
64
68
|
|
|
65
69
|
# List account option positions
|
|
66
|
-
# 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). 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.
|
|
70
|
+
# 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). Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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.
|
|
67
71
|
# @param user_id [String]
|
|
68
72
|
# @param user_secret [String]
|
|
69
73
|
# @param account_id [String]
|
|
@@ -788,7 +788,7 @@ module SnapTrade
|
|
|
788
788
|
|
|
789
789
|
# Get equity symbol quotes
|
|
790
790
|
#
|
|
791
|
-
# Returns quotes from the brokerage for the specified symbols and account.
|
|
791
|
+
# Returns a maximum of 10 quotes from the brokerage for the specified symbols and account.
|
|
792
792
|
#
|
|
793
793
|
# The quotes returned can be delayed depending on the brokerage the account belongs to. It is highly recommended that you use your own market data provider for real-time quotes instead of relying on this endpoint.
|
|
794
794
|
#
|
|
@@ -800,7 +800,7 @@ module SnapTrade
|
|
|
800
800
|
#
|
|
801
801
|
# @param user_id [String]
|
|
802
802
|
# @param user_secret [String]
|
|
803
|
-
# @param symbols [String] List of Universal Symbol IDs or tickers to get quotes for. When providing multiple values, use a comma as separator
|
|
803
|
+
# @param symbols [String] List of Universal Symbol IDs or tickers to get quotes for. When providing multiple values, use a comma as separator. Maximum of 10 values allowed
|
|
804
804
|
# @param account_id [String]
|
|
805
805
|
# @param use_ticker [Boolean] Should be set to `True` if `symbols` are comprised of tickers. Defaults to `False` if not provided.
|
|
806
806
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
@@ -812,7 +812,7 @@ module SnapTrade
|
|
|
812
812
|
|
|
813
813
|
# Get equity symbol quotes
|
|
814
814
|
#
|
|
815
|
-
# Returns quotes from the brokerage for the specified symbols and account.
|
|
815
|
+
# Returns a maximum of 10 quotes from the brokerage for the specified symbols and account.
|
|
816
816
|
#
|
|
817
817
|
# The quotes returned can be delayed depending on the brokerage the account belongs to. It is highly recommended that you use your own market data provider for real-time quotes instead of relying on this endpoint.
|
|
818
818
|
#
|
|
@@ -824,7 +824,7 @@ module SnapTrade
|
|
|
824
824
|
#
|
|
825
825
|
# @param user_id [String]
|
|
826
826
|
# @param user_secret [String]
|
|
827
|
-
# @param symbols [String] List of Universal Symbol IDs or tickers to get quotes for. When providing multiple values, use a comma as separator
|
|
827
|
+
# @param symbols [String] List of Universal Symbol IDs or tickers to get quotes for. When providing multiple values, use a comma as separator. Maximum of 10 values allowed
|
|
828
828
|
# @param account_id [String]
|
|
829
829
|
# @param use_ticker [Boolean] Should be set to `True` if `symbols` are comprised of tickers. Defaults to `False` if not provided.
|
|
830
830
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
@@ -834,10 +834,10 @@ module SnapTrade
|
|
|
834
834
|
end
|
|
835
835
|
|
|
836
836
|
# Get equity symbol quotes
|
|
837
|
-
# Returns quotes from the brokerage for the specified symbols and account. The quotes returned can be delayed depending on the brokerage the account belongs to. It is highly recommended that you use your own market data provider for real-time quotes instead of relying on this endpoint. **This endpoint is not a substitute for a market data provider. Frequent polling of this endpoint may result in the disabling of your keys** This endpoint does not work for options quotes. This endpoint is disabled for free plans by default. Please contact support to enable this endpoint if needed.
|
|
837
|
+
# Returns a maximum of 10 quotes from the brokerage for the specified symbols and account. The quotes returned can be delayed depending on the brokerage the account belongs to. It is highly recommended that you use your own market data provider for real-time quotes instead of relying on this endpoint. **This endpoint is not a substitute for a market data provider. Frequent polling of this endpoint may result in the disabling of your keys** This endpoint does not work for options quotes. This endpoint is disabled for free plans by default. Please contact support to enable this endpoint if needed.
|
|
838
838
|
# @param user_id [String]
|
|
839
839
|
# @param user_secret [String]
|
|
840
|
-
# @param symbols [String] List of Universal Symbol IDs or tickers to get quotes for. When providing multiple values, use a comma as separator
|
|
840
|
+
# @param symbols [String] List of Universal Symbol IDs or tickers to get quotes for. When providing multiple values, use a comma as separator. Maximum of 10 values allowed
|
|
841
841
|
# @param account_id [String]
|
|
842
842
|
# @param [Hash] opts the optional parameters
|
|
843
843
|
# @option opts [Boolean] :use_ticker Should be set to `True` if `symbols` are comprised of tickers. Defaults to `False` if not provided.
|
|
@@ -848,10 +848,10 @@ module SnapTrade
|
|
|
848
848
|
end
|
|
849
849
|
|
|
850
850
|
# Get equity symbol quotes
|
|
851
|
-
# Returns quotes from the brokerage for the specified symbols and account. The quotes returned can be delayed depending on the brokerage the account belongs to. It is highly recommended that you use your own market data provider for real-time quotes instead of relying on this endpoint. **This endpoint is not a substitute for a market data provider. Frequent polling of this endpoint may result in the disabling of your keys** This endpoint does not work for options quotes. This endpoint is disabled for free plans by default. Please contact support to enable this endpoint if needed.
|
|
851
|
+
# Returns a maximum of 10 quotes from the brokerage for the specified symbols and account. The quotes returned can be delayed depending on the brokerage the account belongs to. It is highly recommended that you use your own market data provider for real-time quotes instead of relying on this endpoint. **This endpoint is not a substitute for a market data provider. Frequent polling of this endpoint may result in the disabling of your keys** This endpoint does not work for options quotes. This endpoint is disabled for free plans by default. Please contact support to enable this endpoint if needed.
|
|
852
852
|
# @param user_id [String]
|
|
853
853
|
# @param user_secret [String]
|
|
854
|
-
# @param symbols [String] List of Universal Symbol IDs or tickers to get quotes for. When providing multiple values, use a comma as separator
|
|
854
|
+
# @param symbols [String] List of Universal Symbol IDs or tickers to get quotes for. When providing multiple values, use a comma as separator. Maximum of 10 values allowed
|
|
855
855
|
# @param account_id [String]
|
|
856
856
|
# @param [Hash] opts the optional parameters
|
|
857
857
|
# @option opts [Boolean] :use_ticker Should be set to `True` if `symbols` are comprised of tickers. Defaults to `False` if not provided.
|
data/lib/snaptrade/version.rb
CHANGED
|
@@ -60,6 +60,20 @@ describe 'AccountInformationApi' do
|
|
|
60
60
|
end
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
+
# unit tests for get_all_account_positions
|
|
64
|
+
# List all account positions
|
|
65
|
+
# Returns a list of all positions in the specified account. 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`. Stock positions may also include `cash_equivalent`, and may include `tax_lots` when tax lot data is enabled for the account. 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.
|
|
66
|
+
# @param user_id
|
|
67
|
+
# @param user_secret
|
|
68
|
+
# @param account_id
|
|
69
|
+
# @param [Hash] opts the optional parameters
|
|
70
|
+
# @return [AllAccountPositionsResponse]
|
|
71
|
+
describe 'get_all_account_positions test' do
|
|
72
|
+
it 'should work' do
|
|
73
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
63
77
|
# unit tests for get_all_user_holdings
|
|
64
78
|
# List all accounts for the user, plus balances, positions, and orders for each account.
|
|
65
79
|
# **Deprecated, please use the account-specific holdings endpoint instead.** List all accounts for the user, plus balances, positions, and orders for each account. **Note:** This endpoint will return HTTP 410 Gone for all customers that sign up after April 25, 2026.
|
|
@@ -135,7 +149,7 @@ describe 'AccountInformationApi' do
|
|
|
135
149
|
|
|
136
150
|
# unit tests for get_user_account_positions
|
|
137
151
|
# List account positions
|
|
138
|
-
# 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.
|
|
152
|
+
# 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). Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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.
|
|
139
153
|
# @param user_id
|
|
140
154
|
# @param user_secret
|
|
141
155
|
# @param account_id
|
|
@@ -71,7 +71,7 @@ describe 'ConnectionsApi' do
|
|
|
71
71
|
|
|
72
72
|
# unit tests for list_brokerage_authorization_accounts
|
|
73
73
|
# List accounts for a connection
|
|
74
|
-
# 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.
|
|
74
|
+
# 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.
|
|
75
75
|
# @param authorization_id
|
|
76
76
|
# @param user_id
|
|
77
77
|
# @param user_secret
|
|
@@ -27,20 +27,6 @@ describe 'ExperimentalEndpointsApi' do
|
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
-
# unit tests for get_all_account_positions
|
|
31
|
-
# List all account positions
|
|
32
|
-
# Returns a list of all positions in the specified account. 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`. Stock positions may also include `cash_equivalent`, and may include `tax_lots` when tax lot data is enabled for the account. 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.
|
|
33
|
-
# @param user_id
|
|
34
|
-
# @param user_secret
|
|
35
|
-
# @param account_id
|
|
36
|
-
# @param [Hash] opts the optional parameters
|
|
37
|
-
# @return [AllAccountPositionsResponse]
|
|
38
|
-
describe 'get_all_account_positions test' do
|
|
39
|
-
it 'should work' do
|
|
40
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
|
|
44
30
|
# unit tests for get_user_account_order_detail_v2
|
|
45
31
|
# Get account order detail (V2)
|
|
46
32
|
# Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
@@ -29,7 +29,7 @@ describe 'OptionsApi' do
|
|
|
29
29
|
|
|
30
30
|
# unit tests for list_option_holdings
|
|
31
31
|
# List account option positions
|
|
32
|
-
# 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). 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.
|
|
32
|
+
# 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). Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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.
|
|
33
33
|
# @param user_id
|
|
34
34
|
# @param user_secret
|
|
35
35
|
# @param account_id
|
|
@@ -118,10 +118,10 @@ describe 'TradingApi' do
|
|
|
118
118
|
|
|
119
119
|
# unit tests for get_user_account_quotes
|
|
120
120
|
# Get equity symbol quotes
|
|
121
|
-
# Returns quotes from the brokerage for the specified symbols and account. The quotes returned can be delayed depending on the brokerage the account belongs to. It is highly recommended that you use your own market data provider for real-time quotes instead of relying on this endpoint. **This endpoint is not a substitute for a market data provider. Frequent polling of this endpoint may result in the disabling of your keys** This endpoint does not work for options quotes. This endpoint is disabled for free plans by default. Please contact support to enable this endpoint if needed.
|
|
121
|
+
# Returns a maximum of 10 quotes from the brokerage for the specified symbols and account. The quotes returned can be delayed depending on the brokerage the account belongs to. It is highly recommended that you use your own market data provider for real-time quotes instead of relying on this endpoint. **This endpoint is not a substitute for a market data provider. Frequent polling of this endpoint may result in the disabling of your keys** This endpoint does not work for options quotes. This endpoint is disabled for free plans by default. Please contact support to enable this endpoint if needed.
|
|
122
122
|
# @param user_id
|
|
123
123
|
# @param user_secret
|
|
124
|
-
# @param symbols List of Universal Symbol IDs or tickers to get quotes for. When providing multiple values, use a comma as separator
|
|
124
|
+
# @param symbols List of Universal Symbol IDs or tickers to get quotes for. When providing multiple values, use a comma as separator. Maximum of 10 values allowed
|
|
125
125
|
# @param account_id
|
|
126
126
|
# @param [Hash] opts the optional parameters
|
|
127
127
|
# @option opts [Boolean] :use_ticker Should be set to `True` if `symbols` are comprised of tickers. Defaults to `False` if not provided.
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: snaptrade
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.192
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- SnapTrade
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-05-
|
|
11
|
+
date: 2026-05-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|