In Chargebee, if an invoice contains only metered items and the first invoice is generated in the Pending state, there is a limitation when attempting to delete or void the invoice. Once deleted or voided, it cannot be regenerated via the UI or API.
Why This Happens
Metered items: These are usage-based items (e.g., data consumption, number of transactions) that accumulate over time and are billed at the end of a billing period.
Pending state: This is the state in which an invoice is created, but not yet finalized or paid. If deleted or voided in this state, it cannot be regenerated, as it is tied to the usage data of the previous term.
Alternate Solution: Adding a Non-Metered Item to Regenerate the Invoice
To work around this limitation and regenerate the invoice, you will need to add a non-metered item to the invoice. This could be any item that is not based on usage, such as a fixed-price add-on or a one-time fee.
Steps to regenerate the invoice:
Add a Non-Metered Item: Create a non-metered add-on (such as a fixed-price charge or a setup fee). The amount can be set to $0.
Hide Zero-Value Items: Once you have added the $0 non-metered item, hide items with zero value from the invoice using the below setting. Navigate to Settings > Configure Chargebee > Billing LogIQ > Zero Value Line Items.
Regenerate the Invoice: After making these changes, the system will allow you to regenerate the invoice from the UI.