Related accounts
You can define a parent and child relationship between accounts in the Pismo platform. Parent and child accounts are linked through the parent_account_id
field.
Account relationship
A parent account can have multiple child accounts. A child account can have only one parent, but it can have multiple child accounts of its own (grandchild accounts of the main parent account). All child and grandchild accounts connect to the main parent account.
To establish account relationship:
- Create the parent account and note its
account_id
in the response. - When you create the child account, in the
applicant
>account
object of the request, in theparent_account_id
parameter, provide theaccount_id
of the parent account. - To test the relationship, get account with the parent account ID in the
accountId
path parameter andshow_children
set totrue
. In the response, thechildren
array will show the child's account ID.
Example
A parent account with ID 123
has two children: child account A with ID 456
and child account B with ID 789
. Account B also has two children: child account B.1 with ID 111
and child account B.2 with ID 222
.
In this case, when you call get account on the parent account 123
, the response shows the following in the children
array:
"children": [
456,
789,
111,
222
]
Child and grandchild accounts are always displayed at the same level and no further information about the hierarchy is provided.
When you call get account on the child account B 789
, the response shows the following in the children
array:
"children": [
111,
222
]
Get related account information
You can see balances and limits of all related accounts with a single call to Get related accounts. Given a parent account ID, this endpoint provides an overview of all related accounts within the same Org, with up to two levels of child accounts. The endpoint returns balances and limits of both the parent account and its active child and grandchild accounts. Active account means that its account status must be NORMAL.
To run Get related accounts, provide the parent account ID in the accountId
path parameter. The response shows balances and limits of the parent account and its child and grandchild accounts. Regardless of the account hierarchy, all child and grandchild accounts of the parent account are always displayed at the same level in the related_accounts
array.
Example
GET balances-limits/v1/accounts/123/related-accounts-limits
{
"account_id": 123,
"program_id": 1111,
"available_credit_limit": 712.02,
"available_savings_account_limit": 0,
"available_withdrawal_credit": 500,
"held_funds": 0,
"max_credit_limit": 800,
"total_credit_limit": 800,
"withdrawal_credit_limit": 500,
"total_overdraft_limit": 0,
"percentage_over_limit": 0.1,
"related_accounts": [
{
"account_id": 456,
"program_id": 1111,
"available_credit_limit": 712.02,
"available_savings_account_limit": 0,
"available_withdrawal_credit": 500,
"held_funds": 0,
"max_credit_limit": 800,
"total_credit_limit": 800,
"withdrawal_credit_limit": 500,
"total_overdraft_limit": 0,
"percentage_over_limit": 0.1
},
{
"account_id": 789,
"program_id": 2222,
"available_credit_limit": 712.02,
"available_savings_account_limit": 0,
"available_withdrawal_credit": 500,
"held_funds": 0,
"max_credit_limit": 1000,
"total_credit_limit": 800,
"withdrawal_credit_limit": 500,
"total_overdraft_limit": 0,
"percentage_over_limit": 0.15
},
{
"account_id": 111,
"program_id": 2222,
"available_credit_limit": 712.02,
"available_savings_account_limit": 0,
"available_withdrawal_credit": 500,
"held_funds": 0,
"max_credit_limit": 1000,
"total_credit_limit": 800,
"withdrawal_credit_limit": 500,
"total_overdraft_limit": 0,
"percentage_over_limit": 0.15
},
{
"account_id": 222,
"program_id": 2222,
"available_credit_limit": 712.02,
"available_savings_account_limit": 0,
"available_withdrawal_credit": 500,
"held_funds": 0,
"max_credit_limit": 1000,
"total_credit_limit": 950,
"withdrawal_credit_limit": 500,
"total_overdraft_limit": 0,
"percentage_over_limit": 0.15
}
]
}
Updated about 1 year ago