Overview
Subscriptions in FlexPrice represent an ongoing billing relationship between a customer and a plan. They handle recurring charges, usage tracking, trial periods, and complex lifecycle management including pausing, cancellation, and plan changes.Subscription States
Subscriptions progress through different states during their lifecycle:Active
The subscription is currently active and billing normally. This is the primary operational state where usage is tracked and invoices are generated.
Trialing
The subscription is in a trial period. No invoices are generated during this time, but usage may still be tracked.
Paused
The subscription has been temporarily paused. Billing is suspended based on the pause configuration.
Subscription Structure
A subscription contains comprehensive billing and lifecycle information:Billing Cycles
Anniversary vs Calendar Billing
FlexPrice supports two billing cycle modes:- Anniversary Billing
- Calendar Billing
The billing anchor is set to the subscription start date. Each billing period begins on the same day as the subscription started.Example: Subscription starts on January 15th
- Period 1: Jan 15 - Feb 15
- Period 2: Feb 15 - Mar 15
- Period 3: Mar 15 - Apr 15
Billing Cadence
Determines when charges are applied:- in_advance: Bill at the start of each period (most common)
- in_arrears: Bill at the end of each period (usage-based pricing)
Trial Periods
Subscriptions can include trial periods where customers use the service without being charged:active status and billing begins.
Subscription Phases
Phases allow subscriptions to evolve over time with different configurations:- Introductory pricing periods
- Graduated pricing tiers
- Time-limited promotions
- Contract renewal tracking
Pausing Subscriptions
Subscriptions can be paused temporarily without cancellation:Cancellation
Immediate Cancellation
Cancels the subscription immediately:- Access ends immediately
- Proration may be applied based on
proration_behavior - A final invoice may be generated
Cancel at Period End
Schedules cancellation for the end of the current billing period:- Customer retains access through the paid period
- No refunds or proration needed
- Clean billing cycle completion
Commitments and Overages
Subscriptions can include minimum commitments with overage pricing:Commitment Amount
The minimum amount a customer commits to paying per commitment period (e.g., $10,000/year on a monthly subscription).
Overage Factor
Multiplier applied to usage beyond the commitment amount. A factor of 1.5 means overage usage costs 1.5x the base rate.
Proration Behavior
When subscriptions change mid-period, proration determines how to handle partial periods:- create_prorations
- none
Automatically creates credit/charge line items on invoices for unused time on the old plan and new charges for the new plan.
Line Items
Subscriptions contain line items representing individual charges:Payment Configuration
Payment Behavior
Controls how subscription payments are handled:default_active: Attempt to charge the default payment methodallow_incomplete: Allow subscriptions with failed payments to remain activeerror_if_incomplete: Subscription creation fails if payment failspending_if_incomplete: Keep subscription pending until payment succeeds
Collection Method
Determines invoice collection approach:charge_automatically: Automatically charge the payment method on filesend_invoice: Email invoice to customer for manual payment
Payment Terms
Defines when payment is due relative to invoice generation:15_NET, 30_NET, 45_NET, 60_NET, 75_NET, 90_NET
Invoicing Customer
Subscriptions support separate invoicing customers for hierarchical billing:- Parent companies to be invoiced for child subscriptions
- Centralized billing for organization hierarchies
- Department-level subscriptions with company-level invoicing