Invoice Lifecycle
Invoice Statuses
| Status | Description |
|---|---|
DRAFT | Newly created. Editable. Not visible to customer. |
OPEN | Finalized and emailed to customer. Awaiting payment. |
PAID | Payment recorded. Immutable. |
VOID | Cancelled permanently. No payment collected. |
UNCOLLECTIBLE | Bad debt. Written off. |
How Invoices are Generated
The invoice generation worker runs every hour. When a subscription’scurrent_period_end has passed:
- Collects all active charges on the plan
- For fixed charges: Adds the flat amount (prorated if mid-period)
- For usage charges: Queries
UsageEventrecords, applies the meter’s aggregation type, multiplies by unit price - Calculates tax based on customer and org billing address
- Creates
Invoicerecord with statusDRAFT - Creates
InvoiceLineItemrecords for each charge - Sets
scheduled_finalize_at = now + 1 hour
The 1-Hour Grace Period
After invoice creation, there’s a 1-hour review window before finalization. Use this time to:- Review the invoice for accuracy
- Adjust line items if needed
- Void the invoice if there was an error
DRAFT to OPEN and emails the customer.
Manual Control
You can also manually finalize an invoice:Tax Calculation
Fluxrate calculates tax automatically based on:- Customer billing address (country, state)
- Organization billing address
- Applicable tax rates
Tax calculation requires the customer to have at minimum a
billing_address_country. Configure this in the customer’s profile.Invoice Numbering
Invoice numbers follow the format:INV-{YEAR}-{SEQUENCE} (e.g., INV-2025-0042).