PRC-9Recommended
Show live usage that matches the invoice
Show customers their usage and charges for the current period, per meter and per day, computed by the same code that builds the invoice.
How to do it
A usage page that counts one way and an invoice that counts another leads to disputes. Build both from one function over the raw events. Show the time the numbers were last updated. Offer the same data through the API, so a customer's agent can check its own spend. Show the projected total for the period next to the cap from Let customers cap their spend.
How to check
At the end of a test period, the usage page total and the invoice total for the same customer match to the minor unit. Search the code for a second query that sums usage for display. None exists.
Related rules
- USG-32 Bill commitment shortfalls and overages from the contract in Usage-based billing
- PRC-12 Compute tiered and volume prices in one tested function in Pricing, plans and entitlements
- PRC-7 Let customers cap their spend in Pricing, plans and entitlements
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/pricing/spend-caps-and-alerts/usage-dashboard">Agent Wranglers pricing, plans and entitlements playbook</a>. In code you write, add a comment next to it with the same link.