Class: SnapTrade::AccountInformationApi

Inherits:
Object
  • Object
show all
Defined in:
lib/snaptrade/api/account_information_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AccountInformationApi

Returns a new instance of AccountInformationApi.



16
17
18
# File 'lib/snaptrade/api/account_information_api.rb', line 16

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



14
15
16
# File 'lib/snaptrade/api/account_information_api.rb', line 14

def api_client
  @api_client
end

Instance Method Details

#get_account_activities(account_id:, user_id:, user_secret:, start_date: SENTINEL, end_date: SENTINEL, offset: SENTINEL, limit: SENTINEL, type: SENTINEL, extra: {}) ⇒ Object

List account activities

Returns all historical transactions for the specified account.

This endpoint is paginated with a default page size of 1000. The endpoint will return a maximum of 1000 transactions per request. See the query parameters for pagination options.

Transaction are returned in reverse chronological order, using the ‘trade_date` field.

The data returned here is always cached and refreshed once a day.

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.

Parameters:

  • account_id (String)
  • user_id (String)
  • user_secret (String)
  • start_date (Date) (defaults to: SENTINEL)

    The start date (inclusive) of the transaction history to retrieve. If not provided, the default is the first transaction known to SnapTrade based on ‘trade_date`.

  • end_date (Date) (defaults to: SENTINEL)

    The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on ‘trade_date`.

  • offset (Integer) (defaults to: SENTINEL)

    An integer that specifies the starting point of the paginated results. Default is 0.

  • limit (Integer) (defaults to: SENTINEL)

    An integer that specifies the maximum number of transactions to return. Default of 1000.

  • type (String) (defaults to: SENTINEL)

    Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - ‘BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `STOCK_DIVIDEND` - A type of dividend where a company distributes shares instead of cash - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `TAX` - A tax related fee. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event. - `TRANSFER` - Transfer of assets from one account to another. - `SPLIT` - A stock share split.

  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



41
42
43
44
45
46
47
48
49
# File 'lib/snaptrade/api/account_information_api.rb', line 41

def (account_id:, user_id:, user_secret:, start_date: SENTINEL, end_date: SENTINEL, offset: SENTINEL, limit: SENTINEL, type: SENTINEL, extra: {})
  extra[:start_date] = start_date if start_date != SENTINEL
  extra[:end_date] = end_date if end_date != SENTINEL
  extra[:offset] = offset if offset != SENTINEL
  extra[:limit] = limit if limit != SENTINEL
  extra[:type] = type if type != SENTINEL
  data, _status_code, _headers = (, user_id, user_secret, extra)
  data
end

#get_account_activities_with_http_info(account_id:, user_id:, user_secret:, start_date: SENTINEL, end_date: SENTINEL, offset: SENTINEL, limit: SENTINEL, type: SENTINEL, extra: {}) ⇒ Object

List account activities

Returns all historical transactions for the specified account.

This endpoint is paginated with a default page size of 1000. The endpoint will return a maximum of 1000 transactions per request. See the query parameters for pagination options.

Transaction are returned in reverse chronological order, using the ‘trade_date` field.

The data returned here is always cached and refreshed once a day.

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.

Parameters:

  • account_id (String)
  • user_id (String)
  • user_secret (String)
  • start_date (Date) (defaults to: SENTINEL)

    The start date (inclusive) of the transaction history to retrieve. If not provided, the default is the first transaction known to SnapTrade based on ‘trade_date`.

  • end_date (Date) (defaults to: SENTINEL)

    The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on ‘trade_date`.

  • offset (Integer) (defaults to: SENTINEL)

    An integer that specifies the starting point of the paginated results. Default is 0.

  • limit (Integer) (defaults to: SENTINEL)

    An integer that specifies the maximum number of transactions to return. Default of 1000.

  • type (String) (defaults to: SENTINEL)

    Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - ‘BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `STOCK_DIVIDEND` - A type of dividend where a company distributes shares instead of cash - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `TAX` - A tax related fee. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event. - `TRANSFER` - Transfer of assets from one account to another. - `SPLIT` - A stock share split.

  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



72
73
74
75
76
77
78
79
# File 'lib/snaptrade/api/account_information_api.rb', line 72

def (account_id:, user_id:, user_secret:, start_date: SENTINEL, end_date: SENTINEL, offset: SENTINEL, limit: SENTINEL, type: SENTINEL, extra: {})
  extra[:start_date] = start_date if start_date != SENTINEL
  extra[:end_date] = end_date if end_date != SENTINEL
  extra[:offset] = offset if offset != SENTINEL
  extra[:limit] = limit if limit != SENTINEL
  extra[:type] = type if type != SENTINEL
  (, user_id, user_secret, extra)
end

#get_all_user_holdings(user_id:, user_secret:, brokerage_authorizations: SENTINEL, extra: {}) ⇒ Object

List all accounts for the user, plus balances, positions, and orders for each account.

**Deprecated, please use the account-specific holdings endpoint instead.**

List all accounts for the user, plus balances, positions, and orders for each account.

Parameters:

  • user_id (String)
  • user_secret (String)
  • brokerage_authorizations (String) (defaults to: SENTINEL)

    Optional. Comma separated list of authorization IDs (only use if filtering is needed on one or more authorizations).

  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



193
194
195
196
197
# File 'lib/snaptrade/api/account_information_api.rb', line 193

def get_all_user_holdings(user_id:, user_secret:, brokerage_authorizations: SENTINEL, extra: {})
  extra[:brokerage_authorizations] = brokerage_authorizations if brokerage_authorizations != SENTINEL
  data, _status_code, _headers = get_all_user_holdings_with_http_info_impl(user_id, user_secret, extra)
  data
end

#get_all_user_holdings_with_http_info(user_id:, user_secret:, brokerage_authorizations: SENTINEL, extra: {}) ⇒ Object

List all accounts for the user, plus balances, positions, and orders for each account.

**Deprecated, please use the account-specific holdings endpoint instead.**

List all accounts for the user, plus balances, positions, and orders for each account.

Parameters:

  • user_id (String)
  • user_secret (String)
  • brokerage_authorizations (String) (defaults to: SENTINEL)

    Optional. Comma separated list of authorization IDs (only use if filtering is needed on one or more authorizations).

  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



210
211
212
213
# File 'lib/snaptrade/api/account_information_api.rb', line 210

def get_all_user_holdings_with_http_info(user_id:, user_secret:, brokerage_authorizations: SENTINEL, extra: {})
  extra[:brokerage_authorizations] = brokerage_authorizations if brokerage_authorizations != SENTINEL
  get_all_user_holdings_with_http_info_impl(user_id, user_secret, extra)
end

#get_user_account_balance(user_id:, user_secret:, account_id:, extra: {}) ⇒ Object

List account balances

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](www.questrade.com/learning/questrade-basics/balances-and-reports/understanding-your-account-balances).

Check your API key on the [Customer Dashboard billing page](dashboard.snaptrade.com/settings/billing) to see if you have real-time data access:

- If you do, this endpoint returns real-time data.
- If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.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, 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.

Parameters:

  • user_id (String)
  • user_secret (String)
  • account_id (String)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



304
305
306
307
# File 'lib/snaptrade/api/account_information_api.rb', line 304

def (user_id:, user_secret:, account_id:, extra: {})
  data, _status_code, _headers = (user_id, user_secret, , extra)
  data
end

#get_user_account_balance_with_http_info(user_id:, user_secret:, account_id:, extra: {}) ⇒ Object

List account balances

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](www.questrade.com/learning/questrade-basics/balances-and-reports/understanding-your-account-balances).

Check your API key on the [Customer Dashboard billing page](dashboard.snaptrade.com/settings/billing) to see if you have real-time data access:

- If you do, this endpoint returns real-time data.
- If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.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, 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.

Parameters:

  • user_id (String)
  • user_secret (String)
  • account_id (String)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



323
324
325
# File 'lib/snaptrade/api/account_information_api.rb', line 323

def (user_id:, user_secret:, account_id:, extra: {})
  (user_id, user_secret, , extra)
end

#get_user_account_details(user_id:, user_secret:, account_id:, extra: {}) ⇒ Object

Get account detail

Returns account detail known to SnapTrade for the specified account.

Check your API key on the [Customer Dashboard billing page](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. 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.

Parameters:

  • user_id (String)
  • user_secret (String)
  • account_id (String)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



419
420
421
422
# File 'lib/snaptrade/api/account_information_api.rb', line 419

def (user_id:, user_secret:, account_id:, extra: {})
  data, _status_code, _headers = (user_id, user_secret, , extra)
  data
end

#get_user_account_details_with_http_info(user_id:, user_secret:, account_id:, extra: {}) ⇒ Object

Get account detail

Returns account detail known to SnapTrade for the specified account.

Check your API key on the [Customer Dashboard billing page](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. 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.

Parameters:

  • user_id (String)
  • user_secret (String)
  • account_id (String)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



438
439
440
# File 'lib/snaptrade/api/account_information_api.rb', line 438

def (user_id:, user_secret:, account_id:, extra: {})
  (user_id, user_secret, , extra)
end

#get_user_account_order_detail(brokerage_order_id:, account_id:, user_id:, user_secret:, extra: {}) ⇒ Object

Get account order detail

Returns the detail of a single order using the external order ID provided in the request body.

This endpoint only works for single-leg orders at this time. Support for multi-leg orders will be added in the future.

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.

Parameters:

  • brokerage_order_id (String)

    Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.

  • account_id (String)
  • user_id (String)
  • user_secret (String)
  • body (AccountInformationGetUserAccountOrderDetailRequest)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



536
537
538
539
540
541
542
# File 'lib/snaptrade/api/account_information_api.rb', line 536

def (brokerage_order_id:, account_id:, user_id:, user_secret:, extra: {})
  _body = {}
  _body[:brokerage_order_id] = brokerage_order_id if brokerage_order_id != SENTINEL
   = _body
  data, _status_code, _headers = (, user_id, user_secret, , extra)
  data
end

#get_user_account_order_detail_with_http_info(brokerage_order_id:, account_id:, user_id:, user_secret:, extra: {}) ⇒ Object

Get account order detail

Returns the detail of a single order using the external order ID provided in the request body.

This endpoint only works for single-leg orders at this time. Support for multi-leg orders will be added in the future.

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.

Parameters:

  • brokerage_order_id (String)

    Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.

  • account_id (String)
  • user_id (String)
  • user_secret (String)
  • body (AccountInformationGetUserAccountOrderDetailRequest)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



560
561
562
563
564
565
# File 'lib/snaptrade/api/account_information_api.rb', line 560

def (brokerage_order_id:, account_id:, user_id:, user_secret:, extra: {})
  _body = {}
  _body[:brokerage_order_id] = brokerage_order_id if brokerage_order_id != SENTINEL
   = _body
  (, user_id, user_secret, , extra)
end

#get_user_account_orders(user_id:, user_secret:, account_id:, state: SENTINEL, days: SENTINEL, extra: {}) ⇒ Object

List account orders

Returns a list of recent orders in the specified account.

Check your API key on the [Customer Dashboard billing page](dashboard.snaptrade.com/settings/billing) to see if you have real-time data access:

- If you do, this endpoint returns real-time data.
- If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.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, 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.

Parameters:

  • user_id (String)
  • user_secret (String)
  • account_id (String)
  • state (String) (defaults to: SENTINEL)

    defaults value is set to "all"

  • days (Integer) (defaults to: SENTINEL)

    Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in.

  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



672
673
674
675
676
677
# File 'lib/snaptrade/api/account_information_api.rb', line 672

def (user_id:, user_secret:, account_id:, state: SENTINEL, days: SENTINEL, extra: {})
  extra[:state] = state if state != SENTINEL
  extra[:days] = days if days != SENTINEL
  data, _status_code, _headers = (user_id, user_secret, , extra)
  data
end

#get_user_account_orders_with_http_info(user_id:, user_secret:, account_id:, state: SENTINEL, days: SENTINEL, extra: {}) ⇒ Object

List account orders

Returns a list of recent orders in the specified account.

Check your API key on the [Customer Dashboard billing page](dashboard.snaptrade.com/settings/billing) to see if you have real-time data access:

- If you do, this endpoint returns real-time data.
- If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.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, 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.

Parameters:

  • user_id (String)
  • user_secret (String)
  • account_id (String)
  • state (String) (defaults to: SENTINEL)

    defaults value is set to "all"

  • days (Integer) (defaults to: SENTINEL)

    Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in.

  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



695
696
697
698
699
# File 'lib/snaptrade/api/account_information_api.rb', line 695

def (user_id:, user_secret:, account_id:, state: SENTINEL, days: SENTINEL, extra: {})
  extra[:state] = state if state != SENTINEL
  extra[:days] = days if days != SENTINEL
  (user_id, user_secret, , extra)
end

#get_user_account_positions(user_id:, user_secret:, account_id:, extra: {}) ⇒ Object

List account positions

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](dashboard.snaptrade.com/settings/billing) to see if you have real-time data access:

- If you do, this endpoint returns real-time data.
- If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.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, 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.

Parameters:

  • user_id (String)
  • user_secret (String)
  • account_id (String)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



807
808
809
810
# File 'lib/snaptrade/api/account_information_api.rb', line 807

def (user_id:, user_secret:, account_id:, extra: {})
  data, _status_code, _headers = (user_id, user_secret, , extra)
  data
end

#get_user_account_positions_with_http_info(user_id:, user_secret:, account_id:, extra: {}) ⇒ Object

List account positions

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](dashboard.snaptrade.com/settings/billing) to see if you have real-time data access:

- If you do, this endpoint returns real-time data.
- If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.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, 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.

Parameters:

  • user_id (String)
  • user_secret (String)
  • account_id (String)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



826
827
828
# File 'lib/snaptrade/api/account_information_api.rb', line 826

def (user_id:, user_secret:, account_id:, extra: {})
  (user_id, user_secret, , extra)
end

#get_user_account_recent_orders(user_id:, user_secret:, account_id:, only_executed: SENTINEL, extra: {}) ⇒ Object

List account recent orders (last 24 hours only)

A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders Differs from /orders in that it is always realtime, and only checks the last 24 hours By default only returns executed orders, but that can be changed by setting only_executed to false

Parameters:

  • user_id (String)
  • user_secret (String)
  • account_id (String)
  • only_executed (Boolean) (defaults to: SENTINEL)

    Defaults to true. Indicates if request should fetch only executed orders. Set to false to retrieve non executed orders as well

  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



920
921
922
923
924
# File 'lib/snaptrade/api/account_information_api.rb', line 920

def (user_id:, user_secret:, account_id:, only_executed: SENTINEL, extra: {})
  extra[:only_executed] = only_executed if only_executed != SENTINEL
  data, _status_code, _headers = (user_id, user_secret, , extra)
  data
end

#get_user_account_recent_orders_with_http_info(user_id:, user_secret:, account_id:, only_executed: SENTINEL, extra: {}) ⇒ Object

List account recent orders (last 24 hours only)

A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders Differs from /orders in that it is always realtime, and only checks the last 24 hours By default only returns executed orders, but that can be changed by setting only_executed to false

Parameters:

  • user_id (String)
  • user_secret (String)
  • account_id (String)
  • only_executed (Boolean) (defaults to: SENTINEL)

    Defaults to true. Indicates if request should fetch only executed orders. Set to false to retrieve non executed orders as well

  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



938
939
940
941
# File 'lib/snaptrade/api/account_information_api.rb', line 938

def (user_id:, user_secret:, account_id:, only_executed: SENTINEL, extra: {})
  extra[:only_executed] = only_executed if only_executed != SENTINEL
  (user_id, user_secret, , extra)
end

#get_user_account_return_rates(user_id:, user_secret:, account_id:, extra: {}) ⇒ Object

List account rate of returns

Returns a list of rate of return percents for a given account. Will include timeframes available from the brokerage, for example “ALL”, “1Y”, “6M”, “3M”, “1M”

Parameters:

  • user_id (String)
  • user_secret (String)
  • account_id (String)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



1032
1033
1034
1035
# File 'lib/snaptrade/api/account_information_api.rb', line 1032

def (user_id:, user_secret:, account_id:, extra: {})
  data, _status_code, _headers = (user_id, user_secret, , extra)
  data
end

#get_user_account_return_rates_with_http_info(user_id:, user_secret:, account_id:, extra: {}) ⇒ Object

List account rate of returns

Returns a list of rate of return percents for a given account. Will include timeframes available from the brokerage, for example “ALL”, “1Y”, “6M”, “3M”, “1M”

Parameters:

  • user_id (String)
  • user_secret (String)
  • account_id (String)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



1045
1046
1047
# File 'lib/snaptrade/api/account_information_api.rb', line 1045

def (user_id:, user_secret:, account_id:, extra: {})
  (user_id, user_secret, , extra)
end

#get_user_holdings(account_id:, user_id:, user_secret:, extra: {}) ⇒ Object

List account holdings

Returns a list of balances, positions, and recent orders for the specified account. The data returned is similar to the data returned over the more fine-grained [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getUserAccountPositions) and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders) endpoints. __The finer-grained APIs are preferred. They are easier to work with, faster, and have better error handling than this coarse-grained API.__

Check your API key on the [Customer Dashboard billing page](dashboard.snaptrade.com/settings/billing) to see if you have real-time data access:

- If you do, this endpoint returns real-time data.
- If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.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, 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.

Parameters:

  • account_id (String)
  • user_id (String)
  • user_secret (String)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



1141
1142
1143
1144
# File 'lib/snaptrade/api/account_information_api.rb', line 1141

def get_user_holdings(account_id:, user_id:, user_secret:, extra: {})
  data, _status_code, _headers = get_user_holdings_with_http_info_impl(, user_id, user_secret, extra)
  data
end

#get_user_holdings_with_http_info(account_id:, user_id:, user_secret:, extra: {}) ⇒ Object

List account holdings

Returns a list of balances, positions, and recent orders for the specified account. The data returned is similar to the data returned over the more fine-grained [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getUserAccountPositions) and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders) endpoints. __The finer-grained APIs are preferred. They are easier to work with, faster, and have better error handling than this coarse-grained API.__

Check your API key on the [Customer Dashboard billing page](dashboard.snaptrade.com/settings/billing) to see if you have real-time data access:

- If you do, this endpoint returns real-time data.
- If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.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, 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.

Parameters:

  • account_id (String)
  • user_id (String)
  • user_secret (String)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



1160
1161
1162
# File 'lib/snaptrade/api/account_information_api.rb', line 1160

def get_user_holdings_with_http_info(account_id:, user_id:, user_secret:, extra: {})
  get_user_holdings_with_http_info_impl(, user_id, user_secret, extra)
end

#list_user_accounts(user_id:, user_secret:, extra: {}) ⇒ Object

List accounts

Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user.

Check your API key on the [Customer Dashboard billing page](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. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.

Parameters:

  • user_id (String)
  • user_secret (String)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



1253
1254
1255
1256
# File 'lib/snaptrade/api/account_information_api.rb', line 1253

def list_user_accounts(user_id:, user_secret:, extra: {})
  data, _status_code, _headers = list_user_accounts_with_http_info_impl(user_id, user_secret, extra)
  data
end

#list_user_accounts_with_http_info(user_id:, user_secret:, extra: {}) ⇒ Object

List accounts

Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user.

Check your API key on the [Customer Dashboard billing page](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. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.

Parameters:

  • user_id (String)
  • user_secret (String)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



1269
1270
1271
# File 'lib/snaptrade/api/account_information_api.rb', line 1269

def list_user_accounts_with_http_info(user_id:, user_secret:, extra: {})
  list_user_accounts_with_http_info_impl(user_id, user_secret, extra)
end

#update_user_account(user_id:, user_secret:, account_id:, extra: {}) ⇒ Object

Update details of an investment account

Updates various properties of a specified account.

Parameters:

  • user_id (String)
  • user_secret (String)
  • account_id (String)

    The ID of the account to update.

  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



1353
1354
1355
1356
# File 'lib/snaptrade/api/account_information_api.rb', line 1353

def (user_id:, user_secret:, account_id:, extra: {})
  data, _status_code, _headers = (user_id, user_secret, , extra)
  data
end

#update_user_account_with_http_info(user_id:, user_secret:, account_id:, extra: {}) ⇒ Object

Update details of an investment account

Updates various properties of a specified account.

Parameters:

  • user_id (String)
  • user_secret (String)
  • account_id (String)

    The ID of the account to update.

  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



1366
1367
1368
# File 'lib/snaptrade/api/account_information_api.rb', line 1366

def (user_id:, user_secret:, account_id:, extra: {})
  (user_id, user_secret, , extra)
end