Skip to main content

Period Management

When a subscription is created, Fluxrate sets:
  • current_period_start = start_date
  • current_period_end = start_date + billing_interval
The invoice worker runs every hour. When it finds subscriptions where current_period_end <= now, it:
  1. Generates a DRAFT invoice for the period
  2. Calculates all fixed charges + metered usage
  3. Advances the period: current_period_start = old end, current_period_end = old end + interval
  4. Updates last_invoiced_date

Proration

When a subscription is created mid-month, the first invoice covers the partial period (prorated):

Previewing an Invoice

Before the billing period ends, preview the current invoice:
This returns a preview of what the invoice would look like if generated now, including all usage accumulated so far.

Manual Invoice Generation

Force generate an invoice immediately (useful for testing):

Subscription Usage

View usage accumulated in the current billing period:

Subscription Invoices

View all invoices for a subscription: