# Customer groups

> Put customers under a parent, up to five levels, and read the ageing, the revenue by customer report and a custom report rolled up by group; send one statement for the whole group and let the parent's person see the group in the customer portal.

Source: /help/en/contacts/customer-groups

Groups of companies are invoiced company by company and chased as one debt. A **customer group** is a parent link on the contact: put *Gulf Retail LLC*, *Gulf Logistics FZE* and *Gulf Foods LLC* under *Gulf Group Holdings*, and the ageing, the revenue report and the statement can be read for the group as well as for each company. Nothing is stored twice: invoices, payments, credit limits and reminders stay on each company, and the group figures are added up when you open a report.

## Put a customer under a parent

Owners, admins and accountants change the parent; other roles see the card with the note *Your role cannot change the parent.*

1. Open **Contacts**, open the customer and choose the tab **Group and portal** (it is there once the contact is saved).
2. In the **Group** card, pick the **Parent**. The list leaves out the customer itself and every customer already under it.
3. The choice is saved at once: the toast reads *Parent saved*. Pick *No parent* to take the customer out of its group (*Taken out of its group*).

The card then shows:

- **Top of the group**, when the top is not the direct parent (a group of three levels or more);
- **Own balance** and **Group balance**: what the customer owes today on its open invoices, alone and together with every customer under it, in your base currency;
- **Under this customer**: every customer beneath it, indented by level, with **Own balance**, **With its group** and what is **Overdue**; *No customer sits under this one.* otherwise;
- **Group statement**, once something sits under the customer.

The **Contacts** list has a **Parent** column on a wide screen. The link is on any contact, so suppliers can be grouped the same way and the payables side of the ageing rolls up too.

## Five levels, and no circles

A group has **five levels at most**, counted from the top to the lowest company. The hint under the picker says so: *A group has five levels at most, and a customer cannot sit under one of its own children.*

- **A sixth level is refused.** Putting a customer under a company that already sits on the fifth level, or moving a customer whose own branch would then reach past the fifth, shows *This link would make the group too deep.*, followed by the next step: *A customer group has five levels at most: put the contact under a parent nearer the top, or move its own children up first.* Nothing is changed.
- **A circle cannot be made.** A customer is never its own parent and never sits under one of its own children. The picker does not offer them. Over the API or through an assistant the answer is `contact_parent_cycle`, for example *Gulf Retail LLC is already under this contact, so it cannot be its parent*, with the next step: pick another parent, or take that contact out of the group first.

The parent must be a contact of the same organisation.

## Read the ageing rolled up

1. Open **Reports** → **Ageing** (see [Ageing and statements of account](/help/en/accounting/ar-ageing-and-statements)).
2. Switch **Roll up groups** on (in the filter row, beside the date). Point at it for the hint: *A parent's row is its own figures plus its children's, listed beneath it. The totals do not change.*

What changes:

- **A parent's row** is the parent's own open amounts plus those of every customer under it, bucket by bucket (**Not due**, **1–30 days**, **31–60 days**, **61–90 days**, **Over 90 days**).
- **The children are listed under it**, indented one step per level, each with its own figures (a child that has children of its own shows its own branch the same way).
- **A parent with nothing open of its own** still gets a row when something is open beneath it.
- **The totals are unchanged.** The total row counts the top rows only, so it equals the total with the switch off, and the sum of the rows you see with it off.
- **One contact** chosen in the filter with the switch on shows that contact's branch.

**Excel** and **PDF** export the rolled-up rows, each child's name indented. Switch to **Payables (suppliers)** to roll up a supplier group.

## Revenue by customer, rolled up

**Revenue** → **By customer** has the same switch, **Roll up groups**. A parent's **Invoiced**, **Recognised**, **Deferred**, **Usage**, **MRR** and **ARR** are then its own figures plus its group's, the children are listed under it, and the **Total** row stays what it was. A click on a figure still shows what is behind it (see [Contract billing and revenue recognition](/help/en/invoices/contract-billing-and-revenue-recognition)).

In **Reports** → **Library**, the reports *Aged receivables*, *Aged payables* and *Revenue by customer* carry the switch too once your organisation's copy of the country pack includes it: **Settings → Accounting** shows the pack version and offers the upgrade.

## Group by the top of a group in the report builder

In the [report builder](/help/en/reports/custom-reports), the dimension **Contact group (parent)** groups ledger lines under the **top** of each contact's group: under **Rows**, choose it for **Group by**, or add it as a **Dimension** column. A contact without a parent is its own group. The top is used, not the direct parent, so a group of three levels stays one row. Click a figure to see the ledger lines of every contact of that group.

## Send the group statement

1. In the parent's **Group** card click **Group statement**. **Reports** → **Statements** opens with the parent chosen and **Include the group** switched on. (You can also open the tab yourself, pick the parent and switch **Include the group** on; the switch shows for a contact that has contacts under it.)
2. The statement runs over every company of the group in one list: each line names its company above the description, the open items name theirs, and the card **Contacts on this statement** lists every company with its closing balance, the children indented under their parent.
3. **PDF** or **Excel** downloads the statement as one file titled *Group statement of account*, with a **Customer** column on every line and, after the closing balance, **Balance by customer** with each company of the group.
4. **Send by email** sends it as a PDF with your statement email template; it goes to the parent's address unless you type other recipients. The emailed file is titled *Group statement of account*, names the parent and how many customers sit beneath it, has a **Customer** column and ends with **Balance by customer**: every company of the group with its closing balance.

Switch **Include the group** off to read the parent's own statement.

## Include the group on a portal invitation

When you invite the parent's contact person to your [customer portal](/help/en/portal/customer-portal), tick **Include the group** in the dialog **Invite to the portal**: *The person also sees the records of the customers under this one.* That person then sees the invoices and quotes of every company of the group, each naming its customer, and the group statement. The person's row on the **Portal** card reads *Includes the group*.

Without the tick the parent's person sees the parent only. A child's person sees that child only, whatever the parent's person may see.

## Good to know

- Moving a customer to another parent changes the next report you open; no figure is stored per group.
- Open items, payment terms, credit limits and payment reminders stay per customer.
- The balances on the **Group** card are as of today. For another date use the ageing with **As of**.

## Walkthrough

1. Create (or open) *Gulf Group Holdings*, *Gulf Retail LLC*, *Gulf Logistics FZE* and *Gulf Foods LLC*.
2. Open *Gulf Retail LLC* → **Group and portal** → **Parent** *Gulf Group Holdings*: the toast reads *Parent saved*. Do the same for the other two.
3. Open *Gulf Group Holdings* → **Group and portal**: **Under this customer** lists the three companies with their balances, and **Group balance** is the parent's own balance plus theirs.
4. **Reports** → **Ageing**: note the four rows and the total. Switch **Roll up groups** on: *Gulf Group Holdings* shows the sum of the four, the three companies sit indented under it, and the total has not changed.
5. Back on the parent's **Group** card click **Group statement** → **Send by email**: the PDF, *Group statement of account*, lists every company's lines with their customer and ends with **Balance by customer**.
6. Invite the parent's contact person from the **Portal** card with **Include the group** ticked: in the portal they see the invoices of all four companies.

## API and assistants

`parentId` is read and written on the customer routes (`POST` and `PATCH /customers`; `null` takes the customer out of its group; `GET /customers?parentId=` lists the direct children). `GET /customers/{id}/children` answers the group with its balances. `rollUp=true` rolls up `GET /ledger/aged-receivables` and the library reports `aged_receivables`, `aged_payables`, their `_detail` reports and `customer_revenue` (`GET /reports/{key}`); `includeChildren=true` gives the group statement on `GET /customers/{id}/statement` and `POST /customers/{id}/statement/email`. Refusals: `409 contact_parent_cycle`, `409 contact_parent_too_deep`.

Assistants use `list_customer_children` for a group, `update_customer` with `parentId` to move a customer, `get_aged_receivables` and `run_report` with `rollUp`, and `get_customer_statement` and `email_customer_statement` with `includeChildren`.

## Related

- [Add a company or person](/help/en/contacts/add-a-contact)
- [Ageing and statements of account](/help/en/accounting/ar-ageing-and-statements)
- [The customer portal](/help/en/portal/customer-portal)
- [Custom reports and KPIs](/help/en/reports/custom-reports)
