Companies Service
The `CompaniesService` is a specialized service for retrieving your organization's structure, including all companies and their associated branches. This is useful for administrative tasks or for integrations that need to be aware of the multi-company or multi-branch setup within your Acumatica instance.
Service Method
get_structure(api_version)
This method retrieves a complete list of companies and their branches. It handles the API request to the `/CompaniesStructure` endpoint, automatically expands the `Results` field, and returns it directly as a list of dictionaries.
# 1. Call the get_structure method
company_hierarchy = client.companies.get_structure("24.200.001")
# 2. Process and display the results
print("--- Acumatica Company Hierarchy ---")
for company in company_hierarchy:
company_id = company.get('CompanyID', {}).get('value', 'N/A')
print(f"\nCompany: {company_id}")
branches = company.get('Branches', [])
if not branches:
print(" - No branches found for this company.")
continue
for branch in branches:
branch_id = branch.get('BranchID', {}).get('value', 'N/A')
print(f" - Branch: {branch_id}")
ON THIS PAGE
Introduction
Service Method
- get_structure