snaptrade 2.0.32 → 2.0.34
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +26 -21
- data/lib/snaptrade/api/account_information_api.rb +70 -52
- data/lib/snaptrade/api/options_api.rb +16 -12
- data/lib/snaptrade/models/account.rb +13 -3
- data/lib/snaptrade/models/account_balance_total.rb +1 -8
- data/lib/snaptrade/models/account_holdings_account.rb +2 -2
- data/lib/snaptrade/models/account_order_record.rb +22 -18
- data/lib/snaptrade/models/{snap_trade_holdings_account_account_id_balance.rb → account_order_record_option_symbol.rb} +102 -12
- data/lib/snaptrade/models/{snap_trade_holdings_account_account_id.rb → account_order_record_universal_symbol.rb} +106 -73
- data/lib/snaptrade/models/account_sync_status.rb +1 -1
- data/lib/snaptrade/models/balance.rb +1 -1
- data/lib/snaptrade/models/{cash_restriction.rb → balance_currency.rb} +27 -35
- data/lib/snaptrade/models/brokerage_authorization_type_read_only.rb +1 -1
- data/lib/snaptrade/models/holdings_status.rb +4 -4
- data/lib/snaptrade/models/monthly_dividends.rb +1 -1
- data/lib/snaptrade/models/net_contributions.rb +1 -1
- data/lib/snaptrade/models/order_type_strict.rb +2 -2
- data/lib/snaptrade/models/past_value.rb +1 -1
- data/lib/snaptrade/models/strategy_order_record.rb +1 -1
- data/lib/snaptrade/models/sub_period_return_rate.rb +2 -2
- data/lib/snaptrade/models/transactions_status.rb +4 -5
- data/lib/snaptrade/models/type.rb +3 -3
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +3 -5
- data/spec/api/account_information_api_spec.rb +12 -12
- data/spec/api/options_api_spec.rb +3 -3
- data/spec/models/{cash_restriction_spec.rb → account_order_record_option_symbol_spec.rb} +22 -10
- data/spec/models/{snap_trade_holdings_account_account_id_spec.rb → account_order_record_universal_symbol_spec.rb} +15 -15
- data/spec/models/balance_currency_spec.rb +41 -0
- metadata +11 -17
- data/lib/snaptrade/models/amount.rb +0 -228
- data/lib/snaptrade/models/brokerage_authorization_type_read_only_type.rb +0 -37
- data/spec/models/amount_spec.rb +0 -35
- data/spec/models/brokerage_authorization_type_read_only_type_spec.rb +0 -23
- data/spec/models/snap_trade_holdings_account_account_id_balance_spec.rb +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 970b9a64740174d662e372bcda27e6a8abf2d4c19f70abca63b55ecd4a5e6df5
|
4
|
+
data.tar.gz: b7b0f1b0b0510932f1e9d1e02db3fb52678e03057b02065dce9f26507cf3496c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f59d7b0412ac4116df910ac089f2dce01214a072922c5e00c66b8f904a34ba88e4e4335f490547c71cd4f5d94e2154a28ff82931eed5ccbd0d86e28b6947708
|
7
|
+
data.tar.gz: fe2e89d41ba0f9ce682c1e3813162ca60440ec80100e75f05a7e29c2c9a756ad7ea51fb673b3b679b78ce6cd5aaa177d0bb1ad5ae1b736e5887360aeca8f44f8
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
snaptrade (2.0.
|
4
|
+
snaptrade (2.0.34)
|
5
5
|
faraday (>= 1.0.1, < 3.0)
|
6
6
|
faraday-multipart (~> 1.0, >= 1.0.4)
|
7
7
|
|
@@ -28,7 +28,7 @@ GEM
|
|
28
28
|
reline (>= 0.3.0)
|
29
29
|
method_source (1.1.0)
|
30
30
|
multipart-post (2.4.1)
|
31
|
-
parallel (1.26.
|
31
|
+
parallel (1.26.3)
|
32
32
|
parser (3.3.4.2)
|
33
33
|
ast (~> 2.4.1)
|
34
34
|
racc
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
Connect brokerage accounts to your app for live positions and trading
|
8
8
|
|
9
|
-
[![npm](https://img.shields.io/badge/gem-v2.0.
|
9
|
+
[![npm](https://img.shields.io/badge/gem-v2.0.34-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.34)
|
10
10
|
[![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](https://snaptrade.com/)
|
11
11
|
|
12
12
|
</div>
|
@@ -70,7 +70,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
70
70
|
Add to Gemfile:
|
71
71
|
|
72
72
|
```ruby
|
73
|
-
gem 'snaptrade', '~> 2.0.
|
73
|
+
gem 'snaptrade', '~> 2.0.34'
|
74
74
|
```
|
75
75
|
|
76
76
|
## Getting Started<a id="getting-started"></a>
|
@@ -152,7 +152,10 @@ needed on one or more authorizations).
|
|
152
152
|
|
153
153
|
### `snaptrade.account_information.get_user_account_balance`<a id="snaptradeaccount_informationget_user_account_balance"></a>
|
154
154
|
|
155
|
-
|
155
|
+
Returns a list of balances for the account. Each element of the list has a distinct currency. Some brokerages like Questrade [allows holding multiple currencies in the same account](https://www.questrade.com/learning/questrade-basics/balances-and-reports/understanding-your-account-balances).
|
156
|
+
|
157
|
+
The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
158
|
+
|
156
159
|
|
157
160
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
158
161
|
|
@@ -170,8 +173,6 @@ p result
|
|
170
173
|
##### user_id: `String`<a id="user_id-string"></a>
|
171
174
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
172
175
|
##### account_id: `String`<a id="account_id-string"></a>
|
173
|
-
The ID of the account to get balances.
|
174
|
-
|
175
176
|
#### 🔄 Return<a id="🔄-return"></a>
|
176
177
|
|
177
178
|
[Balance](./lib/snaptrade/models/balance.rb)
|
@@ -187,8 +188,9 @@ The ID of the account to get balances.
|
|
187
188
|
|
188
189
|
### `snaptrade.account_information.get_user_account_details`<a id="snaptradeaccount_informationget_user_account_details"></a>
|
189
190
|
|
190
|
-
Returns
|
191
|
-
|
191
|
+
Returns account detail known to SnapTrade for the specified account.
|
192
|
+
|
193
|
+
The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
192
194
|
|
193
195
|
|
194
196
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
@@ -207,8 +209,6 @@ p result
|
|
207
209
|
##### user_id: `String`<a id="user_id-string"></a>
|
208
210
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
209
211
|
##### account_id: `String`<a id="account_id-string"></a>
|
210
|
-
The ID of the account to get detail of.
|
211
|
-
|
212
212
|
#### 🔄 Return<a id="🔄-return"></a>
|
213
213
|
|
214
214
|
[Account](./lib/snaptrade/models/account.rb)
|
@@ -224,7 +224,10 @@ The ID of the account to get detail of.
|
|
224
224
|
|
225
225
|
### `snaptrade.account_information.get_user_account_orders`<a id="snaptradeaccount_informationget_user_account_orders"></a>
|
226
226
|
|
227
|
-
|
227
|
+
Returns a list of recent orders in the specified account.
|
228
|
+
|
229
|
+
The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
230
|
+
|
228
231
|
|
229
232
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
230
233
|
|
@@ -244,8 +247,6 @@ p result
|
|
244
247
|
##### user_id: `String`<a id="user_id-string"></a>
|
245
248
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
246
249
|
##### account_id: `String`<a id="account_id-string"></a>
|
247
|
-
The ID of the account to get orders.
|
248
|
-
|
249
250
|
##### state: `String`<a id="state-string"></a>
|
250
251
|
defaults value is set to \"all\"
|
251
252
|
|
@@ -268,7 +269,10 @@ Number of days in the past to fetch the most recent orders. Defaults to the last
|
|
268
269
|
|
269
270
|
### `snaptrade.account_information.get_user_account_positions`<a id="snaptradeaccount_informationget_user_account_positions"></a>
|
270
271
|
|
271
|
-
Returns a list of positions in the specified account.
|
272
|
+
Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the [options endpoint](/reference/Options/Options_listOptionHoldings).
|
273
|
+
|
274
|
+
The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
275
|
+
|
272
276
|
|
273
277
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
274
278
|
|
@@ -286,8 +290,6 @@ p result
|
|
286
290
|
##### user_id: `String`<a id="user_id-string"></a>
|
287
291
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
288
292
|
##### account_id: `String`<a id="account_id-string"></a>
|
289
|
-
The ID of the account to get positions.
|
290
|
-
|
291
293
|
#### 🔄 Return<a id="🔄-return"></a>
|
292
294
|
|
293
295
|
[Position](./lib/snaptrade/models/position.rb)
|
@@ -303,7 +305,7 @@ The ID of the account to get positions.
|
|
303
305
|
|
304
306
|
### `snaptrade.account_information.get_user_holdings`<a id="snaptradeaccount_informationget_user_holdings"></a>
|
305
307
|
|
306
|
-
|
308
|
+
Returns a list of balances, positions, and recent orders for the specified account. The data returned is similar to the data returned over the more fine-grained [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getUserAccountPositions) and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders) endpoints. __The finer-grained APIs are preferred. They are easier to work with, faster, and have better error handling than this coarse-grained API.__
|
307
309
|
|
308
310
|
The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
309
311
|
|
@@ -339,7 +341,10 @@ p result
|
|
339
341
|
|
340
342
|
### `snaptrade.account_information.list_user_accounts`<a id="snaptradeaccount_informationlist_user_accounts"></a>
|
341
343
|
|
342
|
-
|
344
|
+
Returns all brokerage accounts known to SnapTrade for the authenticated user.
|
345
|
+
|
346
|
+
The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
347
|
+
|
343
348
|
|
344
349
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
345
350
|
|
@@ -947,7 +952,9 @@ Option strategy id obtained from response when creating option strategy object
|
|
947
952
|
|
948
953
|
### `snaptrade.options.list_option_holdings`<a id="snaptradeoptionslist_option_holdings"></a>
|
949
954
|
|
950
|
-
Returns a list of
|
955
|
+
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).
|
956
|
+
|
957
|
+
The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
951
958
|
|
952
959
|
|
953
960
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
@@ -956,7 +963,7 @@ Returns a list of Options Positions.
|
|
956
963
|
result = snaptrade.options.list_option_holdings(
|
957
964
|
user_id: "snaptrade-user-123",
|
958
965
|
user_secret: "USERSECRET123",
|
959
|
-
account_id: "
|
966
|
+
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
960
967
|
)
|
961
968
|
p result
|
962
969
|
```
|
@@ -966,8 +973,6 @@ p result
|
|
966
973
|
##### user_id: `String`<a id="user_id-string"></a>
|
967
974
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
968
975
|
##### account_id: `String`<a id="account_id-string"></a>
|
969
|
-
The ID of the account to fetch options holdings for.
|
970
|
-
|
971
976
|
#### 🔄 Return<a id="🔄-return"></a>
|
972
977
|
|
973
978
|
[OptionsPosition](./lib/snaptrade/models/options_position.rb)
|
@@ -127,11 +127,13 @@ module SnapTrade
|
|
127
127
|
|
128
128
|
# List account balances
|
129
129
|
#
|
130
|
-
#
|
130
|
+
# 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).
|
131
|
+
#
|
132
|
+
# The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
131
133
|
#
|
132
134
|
# @param user_id [String]
|
133
135
|
# @param user_secret [String]
|
134
|
-
# @param account_id [String]
|
136
|
+
# @param account_id [String]
|
135
137
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
136
138
|
def get_user_account_balance(user_id:, user_secret:, account_id:, extra: {})
|
137
139
|
data, _status_code, _headers = get_user_account_balance_with_http_info_impl(user_id, user_secret, account_id, extra)
|
@@ -140,21 +142,23 @@ module SnapTrade
|
|
140
142
|
|
141
143
|
# List account balances
|
142
144
|
#
|
143
|
-
#
|
145
|
+
# 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).
|
146
|
+
#
|
147
|
+
# The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
144
148
|
#
|
145
149
|
# @param user_id [String]
|
146
150
|
# @param user_secret [String]
|
147
|
-
# @param account_id [String]
|
151
|
+
# @param account_id [String]
|
148
152
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
149
153
|
def get_user_account_balance_with_http_info(user_id:, user_secret:, account_id:, extra: {})
|
150
154
|
get_user_account_balance_with_http_info_impl(user_id, user_secret, account_id, extra)
|
151
155
|
end
|
152
156
|
|
153
157
|
# List account balances
|
154
|
-
#
|
158
|
+
# 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). The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
155
159
|
# @param user_id [String]
|
156
160
|
# @param user_secret [String]
|
157
|
-
# @param account_id [String]
|
161
|
+
# @param account_id [String]
|
158
162
|
# @param [Hash] opts the optional parameters
|
159
163
|
# @return [Array<Balance>]
|
160
164
|
private def get_user_account_balance_impl(user_id, user_secret, account_id, opts = {})
|
@@ -163,10 +167,10 @@ module SnapTrade
|
|
163
167
|
end
|
164
168
|
|
165
169
|
# List account balances
|
166
|
-
#
|
170
|
+
# 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). The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
167
171
|
# @param user_id [String]
|
168
172
|
# @param user_secret [String]
|
169
|
-
# @param account_id [String]
|
173
|
+
# @param account_id [String]
|
170
174
|
# @param [Hash] opts the optional parameters
|
171
175
|
# @return [Array<(Array<Balance>, Integer, Hash)>] Array<Balance> data, response status code and response headers
|
172
176
|
private def get_user_account_balance_with_http_info_impl(user_id, user_secret, account_id, opts = {})
|
@@ -196,7 +200,7 @@ module SnapTrade
|
|
196
200
|
# header parameters
|
197
201
|
header_params = opts[:header_params] || {}
|
198
202
|
# HTTP header 'Accept' (if needed)
|
199
|
-
header_params['Accept'] = @api_client.select_header_accept(['
|
203
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
200
204
|
|
201
205
|
# form parameters
|
202
206
|
form_params = opts[:form_params] || {}
|
@@ -228,38 +232,40 @@ module SnapTrade
|
|
228
232
|
end
|
229
233
|
|
230
234
|
|
231
|
-
#
|
235
|
+
# Get account detail
|
232
236
|
#
|
233
|
-
# Returns
|
234
|
-
#
|
237
|
+
# Returns account detail known to SnapTrade for the specified account.
|
238
|
+
#
|
239
|
+
# The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
235
240
|
#
|
236
241
|
# @param user_id [String]
|
237
242
|
# @param user_secret [String]
|
238
|
-
# @param account_id [String]
|
243
|
+
# @param account_id [String]
|
239
244
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
240
245
|
def get_user_account_details(user_id:, user_secret:, account_id:, extra: {})
|
241
246
|
data, _status_code, _headers = get_user_account_details_with_http_info_impl(user_id, user_secret, account_id, extra)
|
242
247
|
data
|
243
248
|
end
|
244
249
|
|
245
|
-
#
|
250
|
+
# Get account detail
|
246
251
|
#
|
247
|
-
# Returns
|
248
|
-
#
|
252
|
+
# Returns account detail known to SnapTrade for the specified account.
|
253
|
+
#
|
254
|
+
# The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
249
255
|
#
|
250
256
|
# @param user_id [String]
|
251
257
|
# @param user_secret [String]
|
252
|
-
# @param account_id [String]
|
258
|
+
# @param account_id [String]
|
253
259
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
254
260
|
def get_user_account_details_with_http_info(user_id:, user_secret:, account_id:, extra: {})
|
255
261
|
get_user_account_details_with_http_info_impl(user_id, user_secret, account_id, extra)
|
256
262
|
end
|
257
263
|
|
258
|
-
#
|
259
|
-
# Returns
|
264
|
+
# Get account detail
|
265
|
+
# Returns account detail known to SnapTrade for the specified account. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
260
266
|
# @param user_id [String]
|
261
267
|
# @param user_secret [String]
|
262
|
-
# @param account_id [String]
|
268
|
+
# @param account_id [String]
|
263
269
|
# @param [Hash] opts the optional parameters
|
264
270
|
# @return [Account]
|
265
271
|
private def get_user_account_details_impl(user_id, user_secret, account_id, opts = {})
|
@@ -267,11 +273,11 @@ module SnapTrade
|
|
267
273
|
data
|
268
274
|
end
|
269
275
|
|
270
|
-
#
|
271
|
-
# Returns
|
276
|
+
# Get account detail
|
277
|
+
# Returns account detail known to SnapTrade for the specified account. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
272
278
|
# @param user_id [String]
|
273
279
|
# @param user_secret [String]
|
274
|
-
# @param account_id [String]
|
280
|
+
# @param account_id [String]
|
275
281
|
# @param [Hash] opts the optional parameters
|
276
282
|
# @return [Array<(Account, Integer, Hash)>] Account data, response status code and response headers
|
277
283
|
private def get_user_account_details_with_http_info_impl(user_id, user_secret, account_id, opts = {})
|
@@ -333,13 +339,15 @@ module SnapTrade
|
|
333
339
|
end
|
334
340
|
|
335
341
|
|
336
|
-
# List account orders
|
342
|
+
# List account recent orders
|
337
343
|
#
|
338
|
-
#
|
344
|
+
# Returns a list of recent orders in the specified account.
|
345
|
+
#
|
346
|
+
# The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
339
347
|
#
|
340
348
|
# @param user_id [String]
|
341
349
|
# @param user_secret [String]
|
342
|
-
# @param account_id [String]
|
350
|
+
# @param account_id [String]
|
343
351
|
# @param state [String] defaults value is set to \"all\"
|
344
352
|
# @param days [Integer] Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in.
|
345
353
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
@@ -350,13 +358,15 @@ module SnapTrade
|
|
350
358
|
data
|
351
359
|
end
|
352
360
|
|
353
|
-
# List account orders
|
361
|
+
# List account recent orders
|
354
362
|
#
|
355
|
-
#
|
363
|
+
# Returns a list of recent orders in the specified account.
|
364
|
+
#
|
365
|
+
# The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
356
366
|
#
|
357
367
|
# @param user_id [String]
|
358
368
|
# @param user_secret [String]
|
359
|
-
# @param account_id [String]
|
369
|
+
# @param account_id [String]
|
360
370
|
# @param state [String] defaults value is set to \"all\"
|
361
371
|
# @param days [Integer] Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in.
|
362
372
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
@@ -366,11 +376,11 @@ module SnapTrade
|
|
366
376
|
get_user_account_orders_with_http_info_impl(user_id, user_secret, account_id, extra)
|
367
377
|
end
|
368
378
|
|
369
|
-
# List account orders
|
370
|
-
#
|
379
|
+
# List account recent orders
|
380
|
+
# Returns a list of recent orders in the specified account. The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
371
381
|
# @param user_id [String]
|
372
382
|
# @param user_secret [String]
|
373
|
-
# @param account_id [String]
|
383
|
+
# @param account_id [String]
|
374
384
|
# @param [Hash] opts the optional parameters
|
375
385
|
# @option opts [String] :state defaults value is set to \"all\"
|
376
386
|
# @option opts [Integer] :days Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in.
|
@@ -380,11 +390,11 @@ module SnapTrade
|
|
380
390
|
data
|
381
391
|
end
|
382
392
|
|
383
|
-
# List account orders
|
384
|
-
#
|
393
|
+
# List account recent orders
|
394
|
+
# Returns a list of recent orders in the specified account. The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
385
395
|
# @param user_id [String]
|
386
396
|
# @param user_secret [String]
|
387
|
-
# @param account_id [String]
|
397
|
+
# @param account_id [String]
|
388
398
|
# @param [Hash] opts the optional parameters
|
389
399
|
# @option opts [String] :state defaults value is set to \"all\"
|
390
400
|
# @option opts [Integer] :days Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in.
|
@@ -460,11 +470,13 @@ module SnapTrade
|
|
460
470
|
|
461
471
|
# List account positions
|
462
472
|
#
|
463
|
-
# Returns a list of positions in the specified account.
|
473
|
+
# 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).
|
474
|
+
#
|
475
|
+
# The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
464
476
|
#
|
465
477
|
# @param user_id [String]
|
466
478
|
# @param user_secret [String]
|
467
|
-
# @param account_id [String]
|
479
|
+
# @param account_id [String]
|
468
480
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
469
481
|
def get_user_account_positions(user_id:, user_secret:, account_id:, extra: {})
|
470
482
|
data, _status_code, _headers = get_user_account_positions_with_http_info_impl(user_id, user_secret, account_id, extra)
|
@@ -473,21 +485,23 @@ module SnapTrade
|
|
473
485
|
|
474
486
|
# List account positions
|
475
487
|
#
|
476
|
-
# Returns a list of positions in the specified account.
|
488
|
+
# 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).
|
489
|
+
#
|
490
|
+
# The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
477
491
|
#
|
478
492
|
# @param user_id [String]
|
479
493
|
# @param user_secret [String]
|
480
|
-
# @param account_id [String]
|
494
|
+
# @param account_id [String]
|
481
495
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
482
496
|
def get_user_account_positions_with_http_info(user_id:, user_secret:, account_id:, extra: {})
|
483
497
|
get_user_account_positions_with_http_info_impl(user_id, user_secret, account_id, extra)
|
484
498
|
end
|
485
499
|
|
486
500
|
# List account positions
|
487
|
-
# Returns a list of positions in the specified account.
|
501
|
+
# 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). The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
488
502
|
# @param user_id [String]
|
489
503
|
# @param user_secret [String]
|
490
|
-
# @param account_id [String]
|
504
|
+
# @param account_id [String]
|
491
505
|
# @param [Hash] opts the optional parameters
|
492
506
|
# @return [Array<Position>]
|
493
507
|
private def get_user_account_positions_impl(user_id, user_secret, account_id, opts = {})
|
@@ -496,10 +510,10 @@ module SnapTrade
|
|
496
510
|
end
|
497
511
|
|
498
512
|
# List account positions
|
499
|
-
# Returns a list of positions in the specified account.
|
513
|
+
# 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). The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
500
514
|
# @param user_id [String]
|
501
515
|
# @param user_secret [String]
|
502
|
-
# @param account_id [String]
|
516
|
+
# @param account_id [String]
|
503
517
|
# @param [Hash] opts the optional parameters
|
504
518
|
# @return [Array<(Array<Position>, Integer, Hash)>] Array<Position> data, response status code and response headers
|
505
519
|
private def get_user_account_positions_with_http_info_impl(user_id, user_secret, account_id, opts = {})
|
@@ -529,7 +543,7 @@ module SnapTrade
|
|
529
543
|
# header parameters
|
530
544
|
header_params = opts[:header_params] || {}
|
531
545
|
# HTTP header 'Accept' (if needed)
|
532
|
-
header_params['Accept'] = @api_client.select_header_accept(['
|
546
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
533
547
|
|
534
548
|
# form parameters
|
535
549
|
form_params = opts[:form_params] || {}
|
@@ -563,7 +577,7 @@ module SnapTrade
|
|
563
577
|
|
564
578
|
# List account holdings
|
565
579
|
#
|
566
|
-
#
|
580
|
+
# 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.__
|
567
581
|
#
|
568
582
|
# The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
569
583
|
#
|
@@ -578,7 +592,7 @@ module SnapTrade
|
|
578
592
|
|
579
593
|
# List account holdings
|
580
594
|
#
|
581
|
-
#
|
595
|
+
# 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.__
|
582
596
|
#
|
583
597
|
# The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
584
598
|
#
|
@@ -591,7 +605,7 @@ module SnapTrade
|
|
591
605
|
end
|
592
606
|
|
593
607
|
# List account holdings
|
594
|
-
#
|
608
|
+
# 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.__ The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
595
609
|
# @param account_id [String]
|
596
610
|
# @param user_id [String]
|
597
611
|
# @param user_secret [String]
|
@@ -603,7 +617,7 @@ module SnapTrade
|
|
603
617
|
end
|
604
618
|
|
605
619
|
# List account holdings
|
606
|
-
#
|
620
|
+
# 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.__ The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
607
621
|
# @param account_id [String]
|
608
622
|
# @param user_id [String]
|
609
623
|
# @param user_secret [String]
|
@@ -670,7 +684,9 @@ module SnapTrade
|
|
670
684
|
|
671
685
|
# List accounts
|
672
686
|
#
|
673
|
-
#
|
687
|
+
# Returns all brokerage accounts known to SnapTrade for the authenticated user.
|
688
|
+
#
|
689
|
+
# The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
674
690
|
#
|
675
691
|
# @param user_id [String]
|
676
692
|
# @param user_secret [String]
|
@@ -682,7 +698,9 @@ module SnapTrade
|
|
682
698
|
|
683
699
|
# List accounts
|
684
700
|
#
|
685
|
-
#
|
701
|
+
# Returns all brokerage accounts known to SnapTrade for the authenticated user.
|
702
|
+
#
|
703
|
+
# The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
686
704
|
#
|
687
705
|
# @param user_id [String]
|
688
706
|
# @param user_secret [String]
|
@@ -692,7 +710,7 @@ module SnapTrade
|
|
692
710
|
end
|
693
711
|
|
694
712
|
# List accounts
|
695
|
-
#
|
713
|
+
# Returns all brokerage accounts known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
696
714
|
# @param user_id [String]
|
697
715
|
# @param user_secret [String]
|
698
716
|
# @param [Hash] opts the optional parameters
|
@@ -703,7 +721,7 @@ module SnapTrade
|
|
703
721
|
end
|
704
722
|
|
705
723
|
# List accounts
|
706
|
-
#
|
724
|
+
# Returns all brokerage accounts known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
707
725
|
# @param user_id [String]
|
708
726
|
# @param user_secret [String]
|
709
727
|
# @param [Hash] opts the optional parameters
|
@@ -372,36 +372,40 @@ module SnapTrade
|
|
372
372
|
end
|
373
373
|
|
374
374
|
|
375
|
-
#
|
375
|
+
# List account option positions
|
376
376
|
#
|
377
|
-
# Returns a list of
|
377
|
+
# 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).
|
378
|
+
#
|
379
|
+
# The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
378
380
|
#
|
379
381
|
# @param user_id [String]
|
380
382
|
# @param user_secret [String]
|
381
|
-
# @param account_id [String]
|
383
|
+
# @param account_id [String]
|
382
384
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
383
385
|
def list_option_holdings(user_id:, user_secret:, account_id:, extra: {})
|
384
386
|
data, _status_code, _headers = list_option_holdings_with_http_info_impl(user_id, user_secret, account_id, extra)
|
385
387
|
data
|
386
388
|
end
|
387
389
|
|
388
|
-
#
|
390
|
+
# List account option positions
|
389
391
|
#
|
390
|
-
# Returns a list of
|
392
|
+
# 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).
|
393
|
+
#
|
394
|
+
# The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
391
395
|
#
|
392
396
|
# @param user_id [String]
|
393
397
|
# @param user_secret [String]
|
394
|
-
# @param account_id [String]
|
398
|
+
# @param account_id [String]
|
395
399
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
396
400
|
def list_option_holdings_with_http_info(user_id:, user_secret:, account_id:, extra: {})
|
397
401
|
list_option_holdings_with_http_info_impl(user_id, user_secret, account_id, extra)
|
398
402
|
end
|
399
403
|
|
400
|
-
#
|
401
|
-
# Returns a list of
|
404
|
+
# List account option positions
|
405
|
+
# 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). The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
402
406
|
# @param user_id [String]
|
403
407
|
# @param user_secret [String]
|
404
|
-
# @param account_id [String]
|
408
|
+
# @param account_id [String]
|
405
409
|
# @param [Hash] opts the optional parameters
|
406
410
|
# @return [Array<OptionsPosition>]
|
407
411
|
private def list_option_holdings_impl(user_id, user_secret, account_id, opts = {})
|
@@ -409,11 +413,11 @@ module SnapTrade
|
|
409
413
|
data
|
410
414
|
end
|
411
415
|
|
412
|
-
#
|
413
|
-
# Returns a list of
|
416
|
+
# List account option positions
|
417
|
+
# 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). The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
414
418
|
# @param user_id [String]
|
415
419
|
# @param user_secret [String]
|
416
|
-
# @param account_id [String]
|
420
|
+
# @param account_id [String]
|
417
421
|
# @param [Hash] opts the optional parameters
|
418
422
|
# @return [Array<(Array<OptionsPosition>, Integer, Hash)>] Array<OptionsPosition> data, response status code and response headers
|
419
423
|
private def list_option_holdings_with_http_info_impl(user_id, user_secret, account_id, opts = {})
|