Auto-complete pending invoices when wallet is topped up
B
Bolat Kazybayev
Problem Statement
When a billing period starts and a customer's wallet has insufficient balance:
- Lago generates an invoice and deducts available credits
- Invoice status remains pending
- A transaction of type invoiced is created for the deducted amount
- After automatic wallet top-up (via saved card), the invoice remains pending
Requested Feature
Automatically complete pending invoices once wallet balance becomes sufficient:
- Deduct the remaining amount from the wallet
- Create a second invoiced transaction for the remaining credits
- Update invoice status from pending to succeeded
Current Workaround
Manually voiding credits, adding metadata (invoice ID link), and updating invoice status to succeeded