BILLING ENGINE

Execute the Math. Route the Revenue.

The Billing Engine ingests billable units, applies your active rate plans, manages prepaid wallets in real time, and generates pixel-perfect invoices — or exports pre-calculated line items directly to your ERP. Absolute financial accuracy at scale.

This is the execution layer. Metering captures the events. Pricing defines the rules. Billing does the math — rating, proration, drawdowns, discounts, tax, settlement — across a 10-stage deterministic pipeline. Use Aforo invoices natively, or route the calculated charges to QuickBooks, Xero, NetSuite, or SAP.

10-Stage Pipeline Sequencer
LIVE
Rate
Prorate
Commit
Discount
Wallet
Overage
Tax
Route
Settle
Dunning
PREPAID WALLET
$12,400
Balance remaining
INVOICE TOTAL
$0
Revenue collected
FINAL INVOICE
INV-2026-0412 — Acme Corp
SETTLED
Platform fee$2,000
Usage (1.2M calls)$4,832
Proration (upgrade)$603
Overage (160K tokens)$960
Discount (15%)−$1,259
Total$7,136
Architecture

Execute the Math. Automate the Collection.

INPUT 1
Metering Engine: Billable Units
Acme: 124K tokens
GlobalBank: 89K calls
DataSync: 312K events
INPUT 2
Pricing Studio: Active Offer Rules
Currency: USD
Overage: $0.003/call
Commit: $24K/yr
EXECUTION PLANE
Billing Engine: Apply Rules & Process Math
Wallet Mgmt
Overage Calcs
Proration
RateCommitDiscountTaxRouteSettle
OUTPUT A
Aforo Invoices
SETTLED
Platform + Usage + Overage$2,520
Tax (Vertex)$201
Discount (15%)−$378
Total$2,343
— OR —
OUTPUT B
ERP / General Ledger
SCHEDULED
QuickBooksPre-calculated line items
XeroPre-calculated line items
NetSuitePre-calculated line items
SAPPre-calculated line items

The Billing Engine is your deterministic revenue pipeline. It consumes processed usage data from the Metering Engine and applies the specific Offer rules defined in the Pricing Studio to calculate overages, manage wallets, and produce audit-ready output — either as native Aforo invoices with automated tax, or as pre-calculated line items exported directly to your ERP.

Four Execution Stages. Zero Manual Intervention.

The Billing Engine consumes metered events and Offer rules, then executes: rating, wallet management, overage enforcement, and invoice generation. Every stage is deterministic and produces audit-grade output.

Automated Rating & Proration

Raw metered events arrive already enriched with customer and subscription context. The Billing Engine applies the correct active Offer rules — per-unit rates, graduated tiers, volume thresholds — and calculates the charge. Mid-cycle upgrades, downgrades, and overage calculations are handled automatically with deterministic proration math. No spreadsheets. No Finance tickets.

Prepaid Wallet Management

Prepaid customers fund a wallet. Usage draws it down in real time with atomic escrow holds — pessimistic locking ensures no overdraft, no double-debit. Balance tracking updates per billing event, not per cycle. Automated threshold alerts at 75%, 90%, and 100% consumption. When exhausted, the engine blocks, throttles, or spills to arrears — based on the Offer configuration.

Native Invoicing & Automated Tax

At period close, the engine consolidates every charge — recurring fees, one-time charges, metered usage, proration adjustments, overage surcharges, and discounts — into a single finalized invoice. Tax is calculated automatically via integrated Vertex and Avalara tax engines for global compliance across jurisdictions. Failed payments trigger dunning sequences with configurable retry intervals and escalation rules.

Bring Your Own Billing (ERP Sync)

Already have a billing system? Aforo does the hard math — rating, proration, overage calculation, discount application, wallet drawdown — and exports pre-calculated, dollar-value line item records on a configurable schedule. Import directly into QuickBooks, Xero, NetSuite, or SAP. Your finance team keeps their existing tools and workflows. Aforo handles the usage-based complexity they cannot.

HOW IT WORKS

From metered usage to paid invoice in four stages

Every contract term is enforced by the pipeline. Every charge is auditable. Every invoice is deterministic.

Aggregate Usage Instantly

Metered events arrive pre-enriched with billing context

The metering engine delivers validated, enriched usage events tagged with customer, subscription, and rate plan. The billing pipeline aggregates by billing period, applies quota checks and rollover credits. No manual data export, no CSV reconciliation, no scripts.

Apply Custom Contract Terms

RateStage → CommitStage → DiscountStage

Six pricing models execute in the RateStage: per-unit, flat rate, percentage, included quota, graduated staircase, and volume-tiered. CommitStage enforces minimum spend true-ups and maximum spend caps. DiscountStage applies loyalty discounts and promotional pricing — all encoded in the rate plan, not in billing team spreadsheets.

Generate Tax-Compliant Invoices

TaxStage → RouteStage → SettleStage

Tax calculations applied per jurisdiction. The RouteStage decides the settlement path: postpaid customers receive invoices, prepaid customers see wallet drawdowns, hybrid customers split automatically. Every invoice carries line-item detail traceable to source events — ready for audit, ready for the customer portal.

Automate Collections & Reconciliation

Dunning scheduler + automatic recovery

Failed payments enter an automatic retry sequence with configurable intervals and escalation rules. Subscriptions suspend after maximum retries. Payment recovery triggers immediate reactivation. Finance sees a clean reconciliation report — settled, pending, recovered, and written-off — without chasing down individual transactions.

The billing pipeline, in detail

10 stages. Three settlement modes. Automatic recovery. Every charge auditable.

10-Stage Pipeline

Each stage executes in sequence. Every stage is deterministic, auditable, and generates structured logs for finance review.

Quota
Rollover
Aggregate
Allowance
Rate
Commit
Discount
Tax
Route
Settle

Invoice with Line Items

Graduated pricing, minimum spend true-ups, loyalty discounts, and tax — all computed by the pipeline.

INVOICE #INV-2026-0847
Acme Corp — Enterprise Plan
API calls (37.2K graduated)$284.00
Min. spend true-up$16.00
Loyalty discount (15%)-$45.00
Tax$25.50
Total$280.50

Prepaid Wallet & Escrow

Real-time balance tracking with atomic escrow holds. Auto-suspend when depleted, auto-resume on top-up.

PREPAID WALLET — DATASYNC
$2,450.00
$180.00 in escrow holds
Available: $2,270Held: $180

Dunning & Recovery

Automatic payment retry sequences with configurable intervals. Finance sees recovered revenue as a separate line.

DUNNING — GLOBALBANK INV-0812
Charge attempt
Mar 1
Failed
Retry (+3 days)
Mar 4
Failed
Retry (+7 days)
Mar 11
Recovered
$4,200 recovered automatically

Three Settlement Modes

Postpaid invoicing, prepaid wallet drawdowns, or hybrid split. One pipeline routes all three.

PostpaidUsage → Invoice
PrepaidUsage → Wallet
HybridWallet first → Invoice

Built for teams that own revenue operations

Different roles, same outcome: every contract term enforced, every charge accurate.

VP of Finance / CFO

Revenue accuracy and audit readiness

Our billing team spends 3 days per month reconciling invoices against usage data. We still find errors after invoices are sent.

WHAT THEY GET

Every invoice traces back to validated source events through 10 auditable stages

Minimum spend enforcement and discount application happen automatically — no spreadsheet overrides

Month-end close takes hours instead of days because the pipeline already reconciled everything

Head of Sales

Custom deal execution without billing bottlenecks

Every enterprise deal has custom terms — volume discounts, minimum commits, prepaid drawdowns. Our billing system can handle exactly one of these.

WHAT THEY GET

Six pricing models and configurable contract terms encoded directly in rate plans

Sales closes the deal, billing enforces the terms automatically — no handoff meetings

Prepaid, postpaid, and hybrid billing on the same customer without separate workflows

VP of Product

Launch new billing models without engineering

We want to offer consumption-based pricing but our billing system only does flat subscriptions. Engineering estimates 4 months to build usage billing.

WHAT THEY GET

Graduated, volume-tiered, percentage, and included-quota pricing — all available as pipeline configuration

New pricing models launch as rate plan changes, not engineering projects

Wallet-based prepaid credits ready out of the box for AI and compute products

0

Pipeline stages, fully automated

Zero

Manual billing interventions per month

0

Settlement modes (postpaid, prepaid, hybrid)

0%

Contract term enforcement rate

Your contracts deserve
a billing engine that enforces them.

Stop reconciling invoices manually. Stop missing contract terms. Start with a pipeline that turns every deal into accurate, auditable revenue.

Related Reading
CFO PlaybookASC 606 Spreadsheet Hell: Why Revenue Recognition Breaks at Scale
ProductAutomated Invoicing: From Contract to Cash in Under 60 Seconds