%20(1).png)
Billing Mediation: What It Is, How It Works, and Why It Matters
What billing mediation is, why AI usage pushes it harder than traditional SaaS, the four functions, a worked event example, and build vs. buy guidance.
What billing management is, the five core functions of a billing management system, and where standard processes break down under usage-based pricing.
%20(1).png)
Our cancellation and invoicing flows were built by two different engineers months apart, and neither checked the other's state before running.
A customer canceled on the 3rd of the month. The invoicing job still ran on the 1st because its logic didn't account for a cancellation that had already occurred. The dispute came in before the bug report did.
That kind of failure is exactly what billing management, done properly, exists to prevent.
Billing management is the set of processes and systems a business uses to generate, deliver, collect, and reconcile charges accurately and on time. It covers everything from creating an invoice to handling a failed payment to reconciling what was collected against what was billed.
Done well, billing management keeps cash flow predictable and keeps customers from getting invoices that don't match what they agreed to. When done poorly, it produces exactly the kind of mismatch described above, where you have two systems that disagree about what a customer owes.
Most billing runs on three basic models, and many systems support a combination of all three.
One-time charges cover a single event, such as a setup fee, activation charge, or one-off purchase. There's no billing cycle, proration, or ongoing balance to manage. The charge happens once, and the billing system's work is complete.
Recurring charges are billed on a fixed schedule where the standard subscription fee is billed monthly or annually, regardless of how much the customer uses the product during that period.
This is the model most billing management systems were originally built around, with predictable amounts, predictable timing, and proration rules for mid-cycle upgrades or downgrades.
Usage charges grow with consumption and are billed after the fact. Billing is calculated from usage accumulated throughout the billing period.
This model requires the billing system to have accurate usage data before it can generate a charge. That data comes from somewhere upstream, like metering, event tracking, and aggregation, none of which billing management generates on its own.
A billing management system includes five core functions, even when a single tool handles all of them.
Most of these functions assume the inputs feeding them are already correct. When they're not, usage data that's late, duplicated, or misaligned, the problem shows up here first, even though it didn't start here.
The main difference between billing management and subscription management is scope.
Subscription management covers the customer lifecycle from plan selection through cancellation, including trials, upgrades, and downgrades.
Billing management handles the mechanics of turning what a customer owes into an actual invoice, payment, and collected charge.
In practice, most systems handle parts of both, and the split between them is not always clean.
Knowing which is which helps when something breaks. A bug in subscription management puts a customer on the wrong plan, while a bug in billing management produces the wrong invoice even when the underlying plan is correct.
For a flat-subscription product, billing management is handled almost entirely by finance and RevOps. Invoices are predictable, payment amounts are fixed, and the billing system rarely needs input from engineering beyond the initial integration.
That changes once usage and credits come into play. An invoice with a usage component needs line-item detail that traces back to product events, beyond just a plan name and a total.
Dunning logic that used to check a fixed amount now has to account for a continuously changing balance. Engineering ends up owning a meaningful share of billing management at that point, because the inputs billing depends on now live inside the product itself.
Most billing management systems communicate through webhooks. Events like invoice.created, payment_failed, and subscription.updated fire whenever something changes on the billing side, and handling these correctly is where most of the actual engineering work is needed.
A payment_failed webhook typically looks something like this:
{
"event": "payment_failed",
"account_id": "acct_88213",
"invoice_id": "inv_4471",
"amount_due": 249.00,
"attempt_count": 2,
"next_retry_at": "2026-07-18T09:00:00Z"
}
Processing this correctly requires a few things. First, the handler needs to be idempotent, since webhook providers generally guarantee at-least-once delivery, meaning the same event can arrive twice.
The product's internal view of the account, whether it's marked active, past due, or suspended, needs to update based on this event and stay aligned with what the billing system currently thinks.
And because webhooks can arrive out of order, the handler needs to check attempt_count or a timestamp instead of assuming events show up in the sequence they were generated.
I've seen the same three integration mistakes come up across different teams, different stacks, and the same root cause.
These failures are common when teams treat a billing integration as a one-time setup. In practice, it is an ongoing contract between two systems that keep changing.
Standard billing processes break under usage-based pricing because they assume fixed amounts and discrete plan changes. Usage-based pricing is continuous instead.
Proration creates a similar challenge. Standard logic calculates the difference when a customer moves between discrete plans during a billing cycle. Usage-based pricing changes continuously as consumption grows, which requires a running calculation throughout the period.
As billing becomes more complicated, most of the friction doesn't come from any single function breaking. It comes from the functions not sharing the same source of truth.
Multiple billing providers are introduced through acquisitions or new product lines. Product and pricing configuration lives in a spreadsheet separate from what billing charges.
Entitlements and user access get managed in yet another system entirely. Each piece works on its own, and none of them agree with each other.
A few capabilities address this directly:
This works alongside the core billing management functions covered earlier, addressing the fragmentation that arises when a company runs more than one product, billing provider, or customer-facing surface.
The proration and dunning problems above share a root cause. Billing management operates after usage has already happened and decides what to charge based on consumption that has already occurred. It doesn't make a real-time call on whether a request should be allowed.
That decision runs before billing management ever sees the event.
Stigg is the usage runtime for AI products. Entitlements, credits, usage limits, and spend governance are enforced synchronously in the request path. That's the layer that billing management depends on but doesn't provide on its own.
You don't have to adopt all of this at once. You start with the one piece your billing stack can't cover, whether that's credits, entitlement checks, or governance, and add the rest as you need it.
Everything upstream of the invoice is where the real decisions get made. See the Stigg docs for details on entitlements and usage-based governance.
A billing management system is software that automates processes such as generating invoices, processing payments, retrying failed charges, and reconciling billed amounts with collected amounts.
Not entirely. Billing management handles invoicing and collection well, but AI products with continuous, high-volume usage typically need an additional layer for real-time entitlement enforcement and spend governance.
No, not on its own. Billing management generates invoices and processes payments after usage has already occurred; stopping an overage before it happens requires a separate real-time entitlements or enforcement layer.
Billing management can track usage for invoicing purposes, but enforcing a hard limit, blocking a request once a customer hits their cap, is typically handled by a separate entitlements system rather than the billing system itself.
The main difference between billing management and entitlement management is timing. Billing management handles charges after usage occurs, while entitlement management decides whether a specific request is allowed before it happens.