> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hyperline.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Consolidated invoicing

> Merge a customer's subscription invoices billed on the same day into one consolidated invoice, so they receive and pay a single invoice instead of many.

Consolidated invoicing groups a customer's subscription invoices that fire on the same day into a single aggregated invoice. Each source invoice is held until Hyperline merges them into one consolidated invoice, which is then finalized, numbered and charged as usual.

Use this when a customer has several subscriptions billing on the same day (for example, multiple product lines or seats renewing together) and you'd rather send them one invoice than several.

## How it works

* Consolidation is a per-customer setting (`Consolidate invoices` toggle on the customer).
* Each eligible invoice is grouped by the day it was scheduled to bill, in the customer's timezone.
* Once the day has fully elapsed, Hyperline merges every held invoice for that day into a single new invoice — the **aggregate** — and marks the source invoices as **Consolidated**.
* The aggregate is what gets finalized, numbered and charged. Source invoices never receive a number of their own.

### What's eligible

Only invoices that meet all of these are held for consolidation:

* The customer has `Consolidate invoices` enabled.
* The invoice comes from a subscription (one-off invoices, documents and credit notes are excluded).
* The invoice is not from an external source (imported invoices go through their own flow).
* The invoice is of type `invoice` (credit notes and other document types are excluded).

Ineligible invoices follow the normal lifecycle unchanged.

### Grouping by day

Invoices are grouped by their **billing date** in the customer's timezone:

* Bill-in-advance invoices group on the period start.
* Bill-in-arrears invoices group on the period end.
* Backdated subscriptions (a subscription created after its start date) group on the day they *would have* billed, not the day the catch-up invoice was actually emitted.

This means a subscription starting July 1 but created on July 10 lands in the July 1 group, not July 10.

### The merge

Hyperline waits until:

1. The consolidation day has fully elapsed in the customer's timezone, and
2. There are no pending renewals or in-flight invoices for that day still to land.

Once both conditions are met, all held invoices for the day are merged into a single aggregate invoice:

* Every line item from every source invoice is copied over, prefixed with the source subscription name so you can trace what came from where.
* Line-item amounts, tax rate, tax amount, discounts, proration and debit/credit sign are preserved verbatim. The aggregate total equals the sum of the source invoices.
* The aggregate carries no `subscriptionId` of its own (it spans several), so it is never itself held for consolidation.

If only one invoice was held for the day, no aggregate is created — the lone invoice is released and finalized directly, so it never gets stuck waiting.

## Enable consolidated invoicing for a customer

The toggle lives on the customer page, in the **Advanced** section of the customer edit form.

<Steps>
  <Step title="Open the customer">
    Go to **Customers** and select the customer.
  </Step>

  <Step title="Edit the customer">
    Open the customer edit form and scroll to the **Advanced** section.
  </Step>

  <Step title="Turn on `Consolidate invoices`">
    Enable the toggle labelled **Consolidate invoices**. From this point on, new subscription invoices for this customer will be held until the daily merge.
  </Step>
</Steps>

The current state is shown on the customer panel as a tag (**Enabled** / **Disabled**) next to the `Consolidate invoices` label, alongside the other invoicing settings.

<Note>
  You can turn consolidated invoicing off at any time — but if the customer has invoices currently held (`Pending consolidation`), you'll need to let those merge (or delete them) before the toggle takes effect on new invoices.
</Note>

## Invoice statuses

Consolidated invoicing introduces two invoice statuses in addition to the [standard ones](./overview#invoice-status):

`Pending consolidation` The invoice is held, waiting for the daily merge. It has no invoice number yet and hasn't been charged. Only action available: **delete** (see below).

`Consolidated` The invoice was merged into an aggregate. It links to the aggregate invoice via `linkedInvoiceId`. The source is kept for record-keeping but the aggregate is what's charged.

Both statuses appear in the invoice list and on the invoice detail page.

## The invoice detail page

Hyperline surfaces the consolidation relationship directly on the invoice page:

* **On a `Consolidated` source invoice**: a callout at the top of the page links to the aggregate the invoice was merged into.
* **On an aggregate invoice**: a callout at the top of the page shows the number of source invoices consolidated into it and links to the filtered list of those sources.

## Actions on held invoices

A `Pending consolidation` invoice is an internal, un-numbered state — it isn't a document to send. The available actions are limited on purpose:

* **Delete** is allowed, so you can drop an invoice out of the day's group before it merges (for example, if the underlying subscription change was wrong).

## Stuck consolidations

A group won't merge until the day is complete. Hyperline waits on:

* Any subscription renewal for that day that hasn't fired yet.
* Any peer invoice for the same day still in `grace_period`, `draft` or otherwise in-flight.

## Consolidated invoicing and organisation-based billing

Consolidated invoicing composes with [organisation-based billing](../customers/organisation-based):

* If the customer is an org **child**, the aggregate is routed to the parent following the child's org invoicing configuration (`Individual invoices` → `Charged on parent`, `Grouped` → `Pending parent concat`). The parent collects payment as usual.
* If only a single invoice ends up being held for the day, that lone invoice is routed to the parent directly rather than being finalized standalone.

## Notes and limitations

* Consolidation happens at most once per customer per calendar day (in the customer's timezone). Two subscriptions billing on the same day are merged; two subscriptions billing a day apart are not.
* Held invoices don't get an invoice number — numbering is assigned to the aggregate when it's finalized. Your invoice number sequence is unaffected by consolidation (only the aggregate consumes a number).
* Credit notes are never held for consolidation and follow the normal flow.
* Tax is copied per-line from the source invoices rather than re-resolved by the tax engine, so the aggregate total is guaranteed to equal the sum of the sources.
