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

# How revenue is generated

> How Enso automatically generates revenue from invoice line items.

Most revenue is generated automatically. Whenever an invoice line item is
created or updated, Enso computes the `billed` revenue rows for that line item
from its **recognition rule** and the line item's amount and service period.

***

## When generation runs

* **Line item created / updated** — revenue is (re)synced for that line item.
* **Invoice sync** — revenue can be re-synced for every line item on an invoice.

Each run recomputes the periods and amounts and writes one revenue row per
recognition period (e.g. one row per month for a period-based rule).

***

## What gets recomputed

Re-syncing an invoice **replaces** the `billed` revenue for its line items —
existing `billed` rows are cleared and regenerated from the current amounts and
rule.

<Warning>
  Only `billed` rows are regenerated. `unbilled` and `deferred_without_date` rows
  are **preserved** across re-syncs — they are managed through their own flows
  ([unbilled](/docs/revenue-recognition/unbilled-revenue),
  [manual](/docs/revenue-recognition/manual-revenue)) — so a manual edit to a
  `billed` row can be overwritten by a later re-sync.
</Warning>

***

## The recognition period

For period-based rules, generation is driven by the line item's service window
(`fromDate` → `toDate`) and the invoice `date`. Revenue is not recognized before
the invoice date: any amount that would fall in months earlier than the invoice
date is carried forward into the invoice month.

See [Revenue rules](/docs/revenue-recognition/revenue-rules) for how each rule
distributes the amount across periods.
