B2B usage-based billing logic, explained.
Usage-based billing turns product activity into invoice-ready revenue through event ingestion, aggregation, rating, tax calculation, and audit trails.
Core mechanics
A reliable usage-based billing system needs idempotent event recording, deterministic period aggregation, customer-specific rating, invoice traceability, and operational exception review.
1
Usage event
Product emits customer activity with idempotency and meter metadata.
2
Rating engine
Floatless applies tiers, commits, credits, and billing-period rules.
3
Invoice state
Usage, subscriptions, tax, and adjustments become auditable invoice lines.
4
Revenue control
Finance reviews exceptions, payment state, exports, and audit trails.
await floatless.usage.record({
customerId: "cus_329",
meter: "api_calls",
quantity: 540,
timestamp: "2026-06-17T10:00:00Z",
idempotencyKey: "api_540_20260617"
});
await floatless.billing.preview({
customerId: "cus_329",
period: "2026-06"
});