Skip to main content

GET get_hierarchy_tree

Returns the consolidation hierarchy as a nested JSON tree.

Endpoint

GET /api/method/konsol.api.get_hierarchy_tree

Authentication: Required (Frappe session cookie)

Parameters

ParameterTypeRequiredDescription
consolidation_groupstringNoFilter to a subtree rooted at this group. Omit for full tree.

Response

{
"message": {
"tree": [
{
"name": "CG-GROUP_CORP-GBMF",
"consolidation_group": "GROUP_CORP",
"data_area_id": "GBMF",
"entity_name": "GB Manufacturing",
"parent_group": null,
"ownership_pct": 100,
"consolidation_method": "full",
"children": [
{
"name": "CG-GROUP_EMEA-DEMF",
"consolidation_group": "GROUP_EMEA",
"data_area_id": "DEMF",
"entity_name": "DE Manufacturing",
"parent_group": "GROUP_CORP",
"ownership_pct": 80,
"consolidation_method": "full",
"children": []
}
]
}
]
}
}

Tree Structure

Each node contains:

FieldTypeDescription
namestringFrappe document name
consolidation_groupstringGroup identifier
data_area_idstringEntity/legal entity code
entity_namestringDisplay name
parent_groupstring/nullParent group (null for root)
ownership_pctnumberDirect ownership percentage
consolidation_methodstringfull or equity
childrenarrayChild nodes (recursive)

Examples

Full hierarchy

curl "http://localhost:8069/api/method/konsol.api.get_hierarchy_tree" \
-b "cookies.txt"

Subtree for a specific group

curl "http://localhost:8069/api/method/konsol.api.get_hierarchy_tree?\
consolidation_group=GROUP_EMEA" \
-b "cookies.txt"