Rating and Billing Data Flow

Usage and pricing plans rated into charges, aggregated, invoiced, and posted to the ledger

Rating and Billing Data Flow Usage and pricing plans rated into charges, aggregated, invoiced, and posted to the ledger 01 / Sources 02 / Rate 03 / Aggregate 04 / Invoice 05 / Post Usage Events · metered stream · 01 / Sources · at-least-once Usage Events metered stream at-least-once Pricing Plans · rate cards · 01 / Sources · versioned Pricing Plans rate cards versioned Rating Engine · pure function · 02 / Rate · deterministic Rating Engine pure function deterministic Rate Events · priced lines · 03 / Aggregate · append-only Rate Events priced lines append-only Aggregator · per account / period · 03 / Aggregate · grouped Aggregator per account / period grouped Invoice Builder · billing run · 04 / Invoice · idempotent Invoice Builder billing run idempotent Promos & Discounts · campaign rules · 04 / Invoice · adjustments Promos & Discounts campaign rules adjustments Invoice · customer document · 05 / Post · immutable Invoice customer document immutable Ledger · fee postings · 05 / Post · double-entry Ledger fee postings double-entry metered usage events rate cards config rate events append-only replayable read deterministic period charges grouped adjustments promos invoice doc immutable fee postings double-entry Legend primary data policy / PII async batch data store

Deterministic Rating

  • • Usage and versioned rate cards are the only rating inputs
  • • The engine is a pure function: same inputs replay to the same charges
  • • Rate events are append-only so a billing run can be recomputed

Config vs Runtime

  • • Pricing plans are declarative data, not code in the engine
  • • New plans and promos ship without redeploying the rater
  • • Aggregation groups priced lines per account and period

Posting and Adjustments

  • • Invoice assembly is idempotent per account and billing period
  • • Discounts and disputes enter as explicit adjustments
  • • Fees post to the double-entry ledger, never mutated in place