
Billing mediation: definition, functions and how it works
Between your customers' usage and their invoice sits a step nobody sees. It decides whether the invoice is right.
Billing mediation is a technical layer at the heart of the billing systems of telecom operators, energy suppliers, IoT providers and, more and more, software vendors that charge for artificial intelligence on a consumption basis.
Its job is simple to describe: collect the raw usage data produced by networks, meters, devices or applications, clean it, convert it into a common format, and hand it to the rating engine that will put a price on it. Simple to describe, much harder to do when the data runs to millions of records a day and arrives in different formats, late, duplicated or incomplete.
This guide explains what billing mediation is, why no usage-based billing works without it, its seven functions, the data it processes in each industry, how it relates to rating and billing, the choice between real time and batch, the controls you need and how to choose a solution.
For the bigger picture, see also our guide to usage-based billing.
Contents
- What is billing mediation?
- Why no usage-based billing works without mediation
- The 7 functions of billing mediation
- Usage data by industry
- Mediation, rating, billing: who does what?
- Real time or batch processing?
- Rejections, controls and KPIs
- How to choose a billing mediation solution
- Frequently asked questions about billing mediation
- The most accurate invoice starts long before billing
What is billing mediation?
Billing mediation is the set of processes that turn raw usage data, coming from heterogeneous technical sources, into clean, uniform consumption records that the billing system can use. It collects, normalizes, validates, deduplicates, enriches, aggregates and distributes usage before any price is applied.
In telecoms, the raw data is called CDRs (Call Detail Records): each call, text or data session generates a record produced by a piece of network equipment. By extension, people talk about CDRs, EDRs (Event Detail Records) or simply usage events for any consumption data, whatever the industry.
Mediation sits between two worlds that do not speak the same language:
- the technical world: switches, gateways, smart meters, sensors, cloud platforms, APIs, AI models. Each produces its own data, in its own format, at its own pace;
- the commercial world: customers, contracts, offers, prices, invoices. It needs to know who consumed what, when, and under which subscription.
Mediation is the translator between the two. It is also why the term is used: the layer mediates between systems that would otherwise never understand each other.
Why no usage-based billing works without mediation
As soon as part of the price depends on consumption, the invoice depends on data produced outside the billing system. That data is never ready to use: multiple formats, duplicates, gaps, records with no customer attached and very high volumes. Mediation fixes these problems before they reach the invoice.
In a simple subscription model, the invoice amount is known in advance: a monthly price times the number of seats. Usage-based pricing changes that. Here are the problems mediation solves, in every industry:
- Many formats. An operator receives data from its voice, mobile data and messaging equipment and from its roaming partners. An energy supplier receives meter readings and load curves. A SaaS vendor receives API call logs and token counters. None of these is the format of the pricing engine.
- Duplicates. The same event can be sent twice, after a network outage or a reloaded file. Without deduplication, the customer pays twice, and eventually complains.
- Gaps. A file never arrives, a source goes down, a record is truncated. Without completeness checks, the usage is never billed: pure loss.
- Data with no customer. Equipment identifies a line, a meter, a device or an API key, not a contract. Each usage record must be linked to the right customer and subscription.
- Volumes. Usage data runs to millions or billions of records. Processing it by hand is impossible; processing it badly is expensive.
Mediation is therefore the first line of defense against revenue leakage: usage lost before rating will never be caught by billing, because billing never knew it existed.
The 7 functions of billing mediation
Billing mediation performs seven functions in a logical order: collection, normalization, validation, deduplication, enrichment, aggregation and distribution. Each answers one question, from "did we receive everything?" to "who needs this data next?".
Not every mediation product splits its processing the same way, but the same core functions appear everywhere.
1. Collection
Mediation picks up data where it is produced: files dropped by equipment, continuous streams, API calls, database reads, messages from a queue. It must know which sources are expected and how often, and flag those that go silent.
2. Normalization
Each source has its own format: delimited text files, binary formats from telecom equipment, structured messages from cloud platforms. Normalization converts them all into a single common format that the rest of the chain understands.
3. Validation
Each record is checked: mandatory fields present, plausible dates, consistent quantities, known identifiers. Invalid records are not thrown away: they are set aside with the reason for rejection, to be corrected and reprocessed.
4. Deduplication
Mediation detects records already received, based on a unique key (an event ID, or a combination of source, timestamp and identifier), and drops them. This is one of the most sensitive functions: too strict and it deletes real usage; too loose and it bills twice.
5. Enrichment
A raw record says "line X consumed Y" or "API key Z sent N requests". Enrichment adds what billing needs to know: the customer, the subscription, the plan, the geographic zone, the type of service, sometimes the time zone or the applicable tax. It relies on reference data: the product catalog, the inventory of lines or meters, customer accounts.
6. Aggregation
Billing every event one by one does not always make sense. Aggregation groups records: all data sessions in an hour, all requests in a day, all readings from a meter over a month. It reduces the volumes to rate and prepares quantities that read well on the invoice.
7. Distribution
Finally, mediation sends the prepared records to their destinations: first the rating engine, and depending on the case a data warehouse, a fraud detection tool, a partner settlement system or an analytics tool.
| Function | Question it answers | Risk if done badly |
|---|---|---|
| Collection | Did we receive all the expected data? | Usage never billed |
| Normalization | Can the rest of the chain read the data? | Mass rejections, manual work |
| Validation | Is the data plausible? | Wrong invoices |
| Deduplication | Has this usage already been counted? | Double billing, complaints |
| Enrichment | Which customer and plan does this usage belong to? | Usage billed to the wrong customer, or not at all |
| Aggregation | In what form should this usage be rated? | Unmanageable volumes, unreadable invoices |
| Distribution | Who needs this data? | Downstream systems out of sync |
Usage data by industry
Mediation was born in telecoms, but every industry that bills on consumption needs it. What changes is the nature of the data: CDRs in telecoms, readings and load curves in energy, device events in IoT, API calls in software and tokens in AI.
Telecoms: CDRs
The historical case. Every call, text, data session or value-added service generates a CDR. Operators also receive data from roaming and interconnection partners. The constraints: very high volumes, vendor-specific formats and, for prepaid services, the need to decrement balances in real time. Online charging protocols such as Diameter, used in mobile networks, are part of the landscape. See our guide to telecom billing and BSS.
Energy: meter readings and load curves
An electricity or gas supplier receives meter readings, load curves (consumption per time interval), and estimated data later replaced by actual data. The constraints: readings that arrive late or are corrected afterwards, prices that vary by hour or season, and true-ups. Mediation must handle estimated, actual and corrected data without mixing them up.
IoT: device events
An IoT service provider bills connectivity, the number of active devices, the messages sent or the data transmitted. The constraints: a very large number of devices, each producing little data, and devices that change status (activated, suspended, terminated). See our guide to IoT billing.
Software, cloud and AI: API calls and tokens
Software vendors and cloud providers increasingly bill on consumption: API calls, storage, compute and now the tokens consumed by AI features. The constraints: data coming both from the vendor's platform and from AI model providers, purchase costs that must be matched to the usage resold, and customers who want to follow their consumption in near real time.
Mediation, rating, billing: who does what?
Mediation prepares usage and links it to a customer, without knowing prices. Rating applies the contract's pricing rules to each usage record. Billing brings together rated usage, subscription fees, discounts and taxes, and issues the invoice. Each step depends on the quality of the one before.
| Building block | What it receives | What it produces | Question it answers |
|---|---|---|---|
| Mediation | Raw data from technical sources | Clean usage records linked to a customer | What was consumed, and by whom? |
| Rating | Usage records | Priced consumption lines | How much does it cost under the contract? |
| Billing | Priced lines, subscriptions, discounts | Invoices, credit notes | What does the customer owe, and when? |
Mediation does not know prices. It only knows that usage happened, when, and for whom.
Rating applies the contract rules: unit price, tiers, included allowances, caps, time-of-day or destination rates. It turns "3 gigabytes" into "$4.50".
Billing gathers the rated lines, subscription fees, discounts and taxes, and issues the invoice on schedule.
Why does the distinction matter? Because a perfect rating engine will never fix usage that was lost or double-counted upstream. And because different teams own each step: mediation is often run by technical teams close to the network or platform, rating and billing by product, marketing and finance teams.
In many legacy architectures, mediation is a separate product, bought from a specialist vendor and connected to billing through file exchanges. Modern monetization platforms tend to embed it as a module, on the same platform as rating and billing, which cuts the number of interfaces to maintain and reconciliations to run. For the overall view, see our guide to billing.
Real time or batch processing?
Batch mediation processes accumulated data at set intervals and suits monthly invoicing. Real-time mediation processes each event as it arrives and is required for prepaid, usage caps, alerts, customer usage dashboards and AI cost control. Most companies need both, with the same rules.
Batch processing
Data is accumulated and processed at regular intervals: hourly, nightly, monthly. This is the historical mode, robust and economical, suited to monthly invoices where nobody needs to know consumption to the minute. It remains the most common for meter readings, partner data and true-ups.
Real time
Each event is processed as soon as it arrives, usually through APIs or continuous streams. It is essential in several situations:
- prepaid: the balance must be decremented as usage happens and the service blocked when it runs out;
- caps and alerts: warning a customer at 80% of their allowance, or suspending a service before a large overage;
- customer visibility: showing today's consumption in a customer portal or admin console;
- AI cost control: a vendor paying for tokens from its model provider wants to know quickly when a customer consumes far more than expected.
| Batch | Real time | |
|---|---|---|
| Rhythm | Hourly, nightly, monthly | Every event |
| Typical uses | Monthly invoices, readings, partners, true-ups | Prepaid, caps, alerts, dashboards, AI |
| Benefits | Robust, economical, easy to replay | Responsiveness, overage control, better customer experience |
| Limits | No immediate view of consumption | More demanding infrastructure and monitoring |
The right answer is not one or the other: it is a mediation layer that handles both modes with the same rules, so that the consumption shown in real time and the consumption billed at month end are identical.
Rejections, controls and KPIs
Billing mediation is judged by what it lets through and what it loses. Three controls matter most: managing rejected records so none disappear, checking completeness so every expected source arrives, and reconciling volumes end to end, from records received to records billed.
Managing rejections
Rejected records (unreadable format, unknown customer, inconsistent data) must never vanish. Good practice is to:
- isolate them in a rejection queue, with the precise reason;
- group them by cause, to fix the source rather than individual records;
- reprocess them automatically once the cause is removed, for example when a new customer is created in the reference data;
- set a time limit beyond which an unresolved rejection is escalated to an owner.
Checking completeness
The hardest question is not "is this data right?" but "did we receive everything?". Completeness checks compare what is expected with what arrived: number of files per source and period, file sequence numbers, volumes compared with history, sources that stayed silent.
Reconciling end to end
Gaps hide between steps. End-to-end reconciliation compares volumes at each stage: records received, validated, rejected, deduplicated, rated, billed. Everything that comes in must end up somewhere. This is the basic principle of revenue assurance.
| KPI | What it measures |
|---|---|
| Rejection rate per source | Data quality of each source |
| Age of pending rejections | The team's ability to clear anomalies |
| Duplicate rate detected | Reliability of source transmission |
| Silent sources | Expected files or streams not received |
| Gap between volumes received and billed | Losses along the chain |
| Delay between usage and rating | Freshness of available data |
These KPIs only have value if they are tracked regularly and every gap has an owner.
How to choose a billing mediation solution
Three approaches exist: in-house scripts, a generic data integration tool, or mediation embedded in the billing platform. Whatever the choice, check source variety, batch and real-time support, configuration without code, deduplication and rejection handling, enrichment, scalability, traceability and integration with rating and billing.
| Approach | Principle | Limits |
|---|---|---|
| In-house development | Scripts and data jobs written by internal teams | Quick at first, hard to maintain and control as sources and offers multiply |
| Generic data integration tool | An extract-and-transform tool configured for usage data | Knows nothing about customers, offers or billing logic; deduplication and rejections must be built |
| Mediation embedded in the billing platform | A mediation module sharing the billing catalog and customer data | Requires a platform able to handle the company's volumes and sources |
Whatever the approach, check:
- source variety: files, streams, APIs, databases; the formats specific to your industry;
- both processing modes: batch and real time, with the same rules;
- configuration: can you add a source or a rule through configuration, or does each one need development?
- deduplication and rejections: configurable deduplication key, rejection queue, reprocessing;
- enrichment: direct access to the product catalog and contracts, to link each usage record to the right subscription;
- scalability: ability to absorb current volumes and peaks, then your growth;
- traceability: for any invoice line, the ability to find the raw records that produced it;
- downstream integration: rating, billing, payment, accounting.
The last criterion is often decisive. Every interface between two products is a chance to lose or duplicate data, and one more reconciliation to run every month.
Where Opencell fits
Opencell is an open source monetization platform with a built-in mediation module on the same platform as the product catalog, rating, billing and payment. The module converts many CDR types into a common data type for rating and billing, handles deduplication, transformation and formatting, and is configured through dedicated APIs or an admin interface. It processes files in batch or events in real time through APIs, collects events, streams, batches or database records, supports the Diameter protocol for operators and handles complex energy mediation scenarios.
Born in telecoms in 2007, Opencell manages €14 billion in revenue for around fifty customers, including Orange Business, Engie, TotalEnergies, OVHcloud and La Poste.
Frequently asked questions about billing mediation
What is billing mediation?
It is the step that collects raw usage data produced by networks, meters, devices or applications, converts it into a common format, checks it, removes duplicates, links it to the right customer and passes it to the rating engine.
What is a CDR?
A CDR (Call Detail Record) is a record produced by telecom equipment for each call, text or data session: number, date, time, duration, volume, type of service. By extension, the term covers any usage record intended for billing.
What is the difference between mediation and rating?
Mediation prepares usage data and links it to the customer, without knowing prices. Rating then applies the contract rules (unit price, tiers, allowances) to give each usage record an amount.
Does mediation need to run in real time?
Not always. Batch processing is enough for a classic monthly invoice. Real time becomes necessary for prepaid, usage caps, alerts, customer usage dashboards and AI cost control. Many companies need both.
Do software vendors need billing mediation?
Yes, as soon as they bill on consumption: API calls, storage, compute or AI tokens. The data comes from their platform and sometimes from third-party providers, and must be deduplicated, linked to the right contract and matched to purchase costs.
What happens to a record rejected by mediation?
It must never be deleted. It goes into a rejection queue with its reason, is corrected or reprocessed automatically once the cause is removed, and is tracked until resolved. A forgotten rejection is usage that will never be billed.
Is billing mediation the same as ETL?
No. A generic ETL tool extracts and transforms data, but it does not know customers, offers or billing rules. Billing mediation adds deduplication, enrichment with contract data, rejection management and completeness controls designed for billing.
Do you need a separate mediation product?
Not necessarily. Mediation can be a dedicated product or a module embedded in the billing platform. Embedding it reduces interfaces, makes it easier to link usage to offers and simplifies end-to-end controls.
The most accurate invoice starts long before billing
Billing mediation is invisible to customers and often to management. Yet it decides whether every usage-based invoice is right: whatever it loses is never billed, whatever it counts twice ends up as a complaint.
Key takeaways:
- billing mediation turns raw usage data into clean, uniform records linked to the right customer,
- its seven functions run from collection to distribution, through deduplication and enrichment,
- it matters in telecoms, energy, IoT, cloud and now AI,
- it must process batch and real time with the same rules,
- its reliability is measured through rejections, completeness and end-to-end reconciliation.
Usage that never reaches the invoice is revenue that does not exist.
Go further with Opencell
Opencell is an agile, open source monetization platform that automates quote-to-cash, from quote to cash collection, for subscription and usage-based services. Born in telecoms in 2007, it manages €14 billion in revenue for around fifty customers.
Billing on usage, with consumption data coming from many sources?



