Invoices
Finalize Invoice
Use when locking an invoice for payment (e.g. after review). Once finalized, line items are locked; invoice can be paid or voided.
POST
Path Parameters
The unique identifier of the invoice to finalize
What Happens When You Finalize an Invoice
Finalizing an invoice performs the following actions:- Locks the invoice: The invoice status changes from
DRAFTtoFINALIZED - Freezes line items: No further modifications can be made to line items or amounts
- Generates invoice number: A human-readable invoice number is assigned (if not already present)
- Sets finalization timestamp: The
finalized_attimestamp is recorded - Enables payment: The invoice becomes eligible for payment processing
Invoice Finalization Workflow
Once an invoice is finalized, it cannot be edited. Only payment status can change. If you need to modify a finalized invoice, you must void it and create a new one.
Response
Confirmation message indicating successful finalization
After Finalization
Once an invoice is finalized, you can:- Collect payment: Use the Attempt Payment endpoint to charge wallet credits
- Update payment status: Mark the invoice as paid via payment gateway integration
- Void the invoice: If needed, use the Void Invoice endpoint
- Send to customer: Trigger invoice communication via webhook or email
- Download PDF: Generate and retrieve the invoice PDF
Common Use Cases
Manual Invoice Review
Manual Invoice Review
For one-time invoices or complex billing scenarios, you may want to review draft invoices before finalizing them:
- Create invoice in draft status
- Review line items and amounts
- Make any necessary adjustments
- Finalize when ready
Subscription Billing
Subscription Billing
For automated subscription billing, invoices are typically finalized automatically:
- Billing cycle triggers invoice generation
- Invoice created and finalized in one step
- Payment collected automatically (if configured)
Usage-Based Billing
Usage-Based Billing
For metered billing, finalization marks the end of the usage collection period:
- Usage accumulated during billing period
- At period end, create draft invoice
- Verify usage calculations
- Finalize to lock usage amounts