Agent Wranglers

USG-21Required

Credit back usage your own fault caused

When an outage, a bug or a double count billed usage the customer never got, find every affected customer by query. Credit them all the same way.

How to do it

A model loop on your side or a broken retry can bill hundreds of customers at once. Mark the faulty events with a correction event, as in Keep raw events and derive every total from them. For an open period, the next invoice nets it out. For a paid invoice, issue a credit note or a refund through the provider, as Correct invoices with credit notes says. Tell each affected customer what happened and the amount returned.

How to check

A test bills three customers twice for the same hour, then runs the correction script for that hour. Each paid invoice gets one credit note for the doubled amount. A second run adds nothing.

Sources

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/usage-billing/usage-on-invoices/usage-credit-notes">Agent Wranglers usage-based billing playbook</a>. In code you write, add a comment next to it with the same link.