This article also covers
How to add usage charges to an invoice
How to Close a Pending invoice
Note : If you are using Product Catalog 2.0 with the new metered billing feature enabled, then it is possible to track the usage in Chargebee. Please refer to this link
Metered Billing is a feature that allows you to add usage-based charges to invoices, based on your customer’s usage at the end of the term (by listening to the pending_invoice_created event). Chargebee allows you to add these charges to the invoice via non-recurring addons or the Add Charge option.
As the usage based charges will need to be accounted for outside of Chargebee, the recommended approach is to use this feature via our APIs.
To handle this, you would need to keep a record of the customer’s usage at your end, and
- When the subscription comes up for renewal, Chargebee will create an invoice in the draft (Pending) state.
- This will fire the pending_invoice_created webhook, which you can listen to and update the usage charges to the invoice.
- The charges can be added to the invoice using the Add One-Time Charge to a Pending Invoice API.
- Another option of adding the charges are via the Add Non-Recurring Addon to a Pending Invoice API.
- Once the charges are added, you can Close the invoice using the Close a Pending Invoice API.
- When the invoice is closed, the status moves from Pending to Payment Due, which will make it available to your customers.
All of the above API actions can be performed via the UI as well.
The charges can only be added to the invoice after it is generated in the Pending state, so if you track usage charges on a daily basis, it is recommended to consolidate these charges and add it as a single line item at the term end.
Related Articles and Documentation