Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
 
Answered
Filter account list to only checkings and savings accounts

What's the best way to filter the account list to only return checkings and savings accounts?

I see that we can filter by the hydra_product_type_code but couldn't find any documentation on what those values are.

Also, what's the different between the hydra_product_type_code and hydra_product_code?

Votes Newest

Answers 2


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

Posted 3 years ago
Trey Teter
124 × 2 Administrator

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)
  • 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)
  • 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)
  • 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)
Posted 4 years ago
Trey Teter
124 × 2 Administrator
0

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)
— David Maksimov   4 years ago
0

That should work, and I personally think that is fine because we have already done the call to retrieve the accounts, so it makes sense to do the filtering on the python side like that.

— Trey Teter   4 years ago
0

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.

— Trey Teter   4 years ago
0

Ok great. Thanks for the suggestion

— David Maksimov   4 years ago
209 Views
2 Answers
4 years ago
3 years ago
Tags