Home›Telecom›Revenue›Billing← All modules
Revenue · BSS module

Billing Module

The Billing module orchestrates the monthly invoice lifecycle — from scheduling bill runs and generating invoices to delivering documents and recording charges for reporting.

Bill Cycle Scheduling Invoice Generation Weighted Distribution Charge Accounting Document Generation Handoff to Collection
On this pageAt a glanceBill Cycle — Key MilestonesBilling Pipeline — End-to-EndComponent ResponsibilitiesStorage & PersistenceDesign PrinciplesWhere AI helpsStandards

At a glance

Runs bill cycles and produces accurate invoices from recurring, one-time and usage charges.

Key data

Bill cycleInvoiceCharge lineBilling account

Receives from

  • Rating
  • Order management
  • Product catalog
Billing

Sends to

  • Collection & dunning
  • Payments
  • Document management
  • Finance

Bill Cycle — Key Milestones

Monthly billing cycle dates and their purpose

Test Bill Run
Configurable day — current month
Trial run for verification before final invoice
Final Bill Run
Configurable day — following month
Actual invoice generation for all accounts
Bill Period
First → Last day of usage month
Usage period covered by the invoice
Payment Due Date
Configurable day — current/next month
Deadline for subscriber to settle the invoice
Invoice Delivered
Shortly after generation
PDF invoice sent to subscriber
Handoff to Collection
At payment due date
Overdue invoices passed to Collection module

Billing Pipeline — End-to-End

From rated usage data through invoice generation and document delivery

Rating Output
Monthly usage summaries from Rating module in data store
Data Store
→
1
Bill Scheduler
Checks cycle dates daily. Distributes accounts to event bus using weighted algorithm.
Data StoreEvent Bus
→
2
Bill Generation
Generates invoice. Aggregates recurring, usage and one-time charges with tax.
Data StoreEvent Bus
→
3
Bill Accounting
Stores charge breakdown in search store. Source for billing reports.
Search StoreInternal API
→
4
Bill Invoice
Manages invoice lifecycle. Links payment method. Tracks invoice status.
Data Store
→
5
Bill Document Generation
Generates PDF invoice. Notifies subscriber. Stores document.
Data StoreEvent Bus
→
Collection Module
Invoices handed off to Collection & Dunning module at payment due date
Separate Module
Input
Schedule
Generate
Account
Invoice
Document
Handoff

Component Responsibilities

Detailed function of each service in the Billing module

Bill Scheduler

Stage 1 — Orchestrate
  • Daily batch job checks bill cycle configuration for run dates
  • Triggers Test Bill Run and Final Bill Run on configured dates
  • Reads account list from billing scheduler document
  • Distributes accounts to event bus partitions using weighted load-balancing
  • Weight based on active line count per account — prevents partition overload
  • Updates last-processed date to prevent duplicate runs on same day
  • Handles failure with exponential retry and resume logic
Data StoreEvent Bus

Bill Generation

Stage 2 — Generate
  • Consumes account details from event bus
  • Aggregates all charges for the bill period: recurring, rated usage, one-time, installments
  • Applies tax rules to taxable charge components
  • Generates invoice document per billing account
  • Sends invoice data to Accounting via internal API
  • Triggers document generation for PDF creation
  • Handles large accounts with child invoice documents
Data StoreEvent Bus

Bill Accounting

Stage 3 — Account
  • Receives invoice data from Bill Generation via internal API
  • Stores account, line and charge breakdown in search store
  • Prevents duplicate entries using account + usage month + subscriber key
  • Provides data source for billing and sales reports
  • Supports on-demand re-run with overwrite of existing records
Search StoreInternal API

Bill Invoice

Stage 4 — Invoice Lifecycle
  • Manages invoice state: generated → delivered → paid / overdue
  • Links subscriber payment method to invoice for collection
  • Tracks reissue count for payment slip re-generation
  • Exposes invoice query APIs to care and self-care portals
  • Passes overdue invoices to Collection module at due date
Data StoreREST API

Bill Document Generation

Stage 5 — Document
  • Generates printable invoice PDF from invoice charge data
  • Applies localised templates for language and formatting
  • Stores generated document in document management store
  • Triggers notification service to deliver invoice to subscriber
  • Supports on-demand reprint and reissue requests
Data StoreEvent Bus

Handoff to Collection

Module Boundary
  • At payment due date, unpaid invoices are passed to the Collection & Dunning module
  • Invoice status updated: pending → overdue
  • Payment method and invoice details passed to Collection service
  • Billing module has no further responsibility once handed off
  • Collection & Dunning module manages all subsequent recovery steps
Module Boundary

Storage & Persistence

How and where the Billing module stores its data

Document Data Store

Operational billing data
  • Bill cycle configuration and run dates
  • Billing account scheduler list
  • Invoice documents per billing account
  • Scheduler job status and last-run tracking

Search & Analytics Store

Reporting & accounting
  • Invoice charge breakdowns per account
  • Tax amounts per service and charge type
  • Source data for billing and sales reports
  • Supports account + month + subscriber dedup

Async Event Bus

Inter-service communication
  • Bill generation trigger channel (per account)
  • Document generation notification channel
  • Accounting notification channel
  • Invoice handoff channel to Collection

Document Store

Generated invoice files
  • PDF invoice documents per subscriber
  • Versioned for reprint and reissue
  • Accessible via document management service

Design Principles

Key architectural decisions behind the Billing module

Weighted Account Distribution

Bill Scheduler uses a weighted min-heap algorithm to distribute accounts to event bus partitions based on active line count. This prevents large multi-line accounts from overloading single partitions and ensures consistent invoice generation throughput across all Bill Generation instances.

Configurable Bill Cycle

Bill run dates, test run dates, payment due dates and usage periods are all driven by a centralised cycle configuration document. Relative date expressions (e.g. last day of month, Nth day of next month) make the cycle flexible and configurable without code changes.

Clean Module Boundary

The Billing module's responsibility ends at invoice delivery. Overdue management, dunning and payment processing are handled by the separate Collection & Dunning module. This separation keeps billing logic focused and allows collection policy to evolve independently.

AI opportunity
Where AI helps
Pre-billing validation

Machine learning flags unusual bills before they are sent. See the AI for Pre-Billing Validation page.

Bill explanation

Generative AI explains bill changes to customers and care agents in plain language.

More in 30 AI & ML use cases and AIOps for BSS.

Key business processBilling Operations→
Standards & references
TMF678Customer Bill Management API
TMF666Account Management API
eTOMBilling and revenue management processes