Class: SnapTrade::TransactionsAndReportingApi
- Inherits:
-
Object
- Object
- SnapTrade::TransactionsAndReportingApi
- Defined in:
- lib/snaptrade/api/transactions_and_reporting_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_activities(user_id:, user_secret:, start_date: SENTINEL, end_date: SENTINEL, accounts: SENTINEL, brokerage_authorizations: SENTINEL, type: SENTINEL, extra: {}) ⇒ Object
Get transaction history for a user.
-
#get_activities_with_http_info(user_id:, user_secret:, start_date: SENTINEL, end_date: SENTINEL, accounts: SENTINEL, brokerage_authorizations: SENTINEL, type: SENTINEL, extra: {}) ⇒ Object
Get transaction history for a user.
-
#get_reporting_custom_range(start_date:, end_date:, user_id:, user_secret:, accounts: SENTINEL, detailed: SENTINEL, frequency: SENTINEL, extra: {}) ⇒ Object
Get performance information for a specific timeframe.
-
#get_reporting_custom_range_with_http_info(start_date:, end_date:, user_id:, user_secret:, accounts: SENTINEL, detailed: SENTINEL, frequency: SENTINEL, extra: {}) ⇒ Object
Get performance information for a specific timeframe.
-
#initialize(api_client = ApiClient.default) ⇒ TransactionsAndReportingApi
constructor
A new instance of TransactionsAndReportingApi.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ TransactionsAndReportingApi
Returns a new instance of TransactionsAndReportingApi.
16 17 18 |
# File 'lib/snaptrade/api/transactions_and_reporting_api.rb', line 16 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
14 15 16 |
# File 'lib/snaptrade/api/transactions_and_reporting_api.rb', line 14 def api_client @api_client end |
Instance Method Details
#get_activities(user_id:, user_secret:, start_date: SENTINEL, end_date: SENTINEL, accounts: SENTINEL, brokerage_authorizations: SENTINEL, type: SENTINEL, extra: {}) ⇒ Object
Get transaction history for a user
This endpoint is being deprecated but will continue to be available for use via SDKs, please use the account level endpoint if possible
Returns all historical transactions for the specified user and filtering criteria. It's recommended to use startDate and endDate to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There's a max number of 10000 transactions returned per request.
There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the trade_date field if you need them in a specific order.
This endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage.
Note: This endpoint will return HTTP 410 Gone for all customers that sign up after April 25, 2026.
40 41 42 43 44 45 46 47 48 |
# File 'lib/snaptrade/api/transactions_and_reporting_api.rb', line 40 def get_activities(user_id:, user_secret:, start_date: SENTINEL, end_date: SENTINEL, accounts: SENTINEL, brokerage_authorizations: SENTINEL, type: SENTINEL, extra: {}) extra[:start_date] = start_date if start_date != SENTINEL extra[:end_date] = end_date if end_date != SENTINEL extra[:accounts] = accounts if accounts != SENTINEL extra[:brokerage_authorizations] = if != SENTINEL extra[:type] = type if type != SENTINEL data, _status_code, _headers = get_activities_with_http_info_impl(user_id, user_secret, extra) data end |
#get_activities_with_http_info(user_id:, user_secret:, start_date: SENTINEL, end_date: SENTINEL, accounts: SENTINEL, brokerage_authorizations: SENTINEL, type: SENTINEL, extra: {}) ⇒ Object
Get transaction history for a user
This endpoint is being deprecated but will continue to be available for use via SDKs, please use the account level endpoint if possible
Returns all historical transactions for the specified user and filtering criteria. It's recommended to use startDate and endDate to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There's a max number of 10000 transactions returned per request.
There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the trade_date field if you need them in a specific order.
This endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage.
Note: This endpoint will return HTTP 410 Gone for all customers that sign up after April 25, 2026.
70 71 72 73 74 75 76 77 |
# File 'lib/snaptrade/api/transactions_and_reporting_api.rb', line 70 def get_activities_with_http_info(user_id:, user_secret:, start_date: SENTINEL, end_date: SENTINEL, accounts: SENTINEL, brokerage_authorizations: SENTINEL, type: SENTINEL, extra: {}) extra[:start_date] = start_date if start_date != SENTINEL extra[:end_date] = end_date if end_date != SENTINEL extra[:accounts] = accounts if accounts != SENTINEL extra[:brokerage_authorizations] = if != SENTINEL extra[:type] = type if type != SENTINEL get_activities_with_http_info_impl(user_id, user_secret, extra) end |
#get_reporting_custom_range(start_date:, end_date:, user_id:, user_secret:, accounts: SENTINEL, detailed: SENTINEL, frequency: SENTINEL, extra: {}) ⇒ Object
Get performance information for a specific timeframe
Returns performance information (contributions, dividends, rate of return, etc) for a specific timeframe. Please note that Total Equity Timeframe and Rate of Returns are experimental features. Please contact support@snaptrade.com if you notice any inconsistencies.
178 179 180 181 182 183 184 |
# File 'lib/snaptrade/api/transactions_and_reporting_api.rb', line 178 def get_reporting_custom_range(start_date:, end_date:, user_id:, user_secret:, accounts: SENTINEL, detailed: SENTINEL, frequency: SENTINEL, extra: {}) extra[:accounts] = accounts if accounts != SENTINEL extra[:detailed] = detailed if detailed != SENTINEL extra[:frequency] = frequency if frequency != SENTINEL data, _status_code, _headers = get_reporting_custom_range_with_http_info_impl(start_date, end_date, user_id, user_secret, extra) data end |
#get_reporting_custom_range_with_http_info(start_date:, end_date:, user_id:, user_secret:, accounts: SENTINEL, detailed: SENTINEL, frequency: SENTINEL, extra: {}) ⇒ Object
Get performance information for a specific timeframe
Returns performance information (contributions, dividends, rate of return, etc) for a specific timeframe. Please note that Total Equity Timeframe and Rate of Returns are experimental features. Please contact support@snaptrade.com if you notice any inconsistencies.
198 199 200 201 202 203 |
# File 'lib/snaptrade/api/transactions_and_reporting_api.rb', line 198 def get_reporting_custom_range_with_http_info(start_date:, end_date:, user_id:, user_secret:, accounts: SENTINEL, detailed: SENTINEL, frequency: SENTINEL, extra: {}) extra[:accounts] = accounts if accounts != SENTINEL extra[:detailed] = detailed if detailed != SENTINEL extra[:frequency] = frequency if frequency != SENTINEL get_reporting_custom_range_with_http_info_impl(start_date, end_date, user_id, user_secret, extra) end |