For those looking for proper documentation on hydra codes, we now have a maintained version in the Caliper Api docs: https://docs.q2api.com/docs/uux/u8xmo9xohh5mp-products-and-types
https://docs.q2api.com/docs/uux/bngf0jbihw7sj-retrieve-accounts
This is an area we need to improve our documentation on, but the hydra_product_type_code is a broad category of account types, and hydra_product_code is a more specific type of account. Here is the full list:
- D = Deposit (
hydra_product_type_code- Q2_ProductType)- C = Checking (
hydra_product_code- Q2_Product) - M = Money Market (
hydra_product_code- Q2_Product) - S = Savings (
hydra_product_code- Q2_Product) - H = HSA (
hydra_product_code- Q2_Product) - X = Christmas Club (
hydra_product_code- Q2_Product) - T = Certificate of Deposit (
hydra_product_code- Q2_Product)
- C = Checking (
- L = Loan (
hydra_product_type_code- Q2_ProductType)- I = Installment (
hydra_product_code- Q2_Product) - C = Commercial (
hydra_product_code- Q2_Product) - M = Mortgage (
hydra_product_code- Q2_Product) - L = Line of Credit (
hydra_product_code- Q2_Product) - H = Home Equity (
hydra_product_code- Q2_Product)
- I = Installment (
- C = Credit Cards (
hydra_product_type_code- Q2_ProductType)- V = Visa (
hydra_product_code- Q2_Product) - M = MasterCard (
hydra_product_code- Q2_Product) - D = Discover (
hydra_product_code- Q2_Product) - A = American Express (
hydra_product_code- Q2_Product)
- V = Visa (
- G = Q2 Goals (
hydra_product_type_code- Q2_ProductType)
To get a User account list like this: https://docs.q2developer.com/api_references/hq_api/q2_api/GetUserAccountList.html?highlight=getuseraccountlist#module-q2_sdk.hq.hq_api.q2_api.GetUserAccountList for checking and savings accounts should be able to do something like:
from q2_sdk.hq.hq_api.q2_api import GetUserAccountList
params_obj = GetUserAccountList.ParamsObj(
self.logger,
user_name,
7,
True,
'DC*|DS*'
)
hq_response = await GetUserAccountList.execute(params_obj)
Thanks! I appreciate you getting that info.
Is there anything wrong with using self.account_list to retreive the accounts and then filter by the hydra codes?
So something like:
eligible_accounts = []
for account in self.account_list:
if account.hydra_product_type_code not in ['D']:
continue
if account.hydra_product_code not in ['C', 'S']:
continue
eligible_accounts.append(account)
—
You could make your code a little more readable by doing something like:
eligible_accounts = []
for account in self.account_list:
if account.hydra_product_type_code in ['D'] and account.hydra_product_code in ['C', 'S']:
eligible_accounts.append(account)
I didn't test this, but I think it is better practice not to use continue statements where possible.
—