Flexible Billing Demo

14 scenarios running against the real Stripe API. Each step streams live as it executes.

What Flexible Billing Adds to Cashier

Cashier already handles subscriptions, payments, and metered billing well. Flexible billing mode extends it with:

+ Hybrid subscriptions — fixed base plan + metered usage on one subscription
+ Multi-phase schedules — plan transitions happen automatically
+ Quotes — generate proposals that create subscriptions when accepted
+ Proration control — choose itemized or included discount display on invoices
+ Billing credits — issue credits, check balances, calculate coverage against usage
+ Usage thresholds — monitor consumption and track overage percentages
+ Rate cards — model tiered, package, and flat pricing locally
// One-line global opt-in
Cashier::defaultBillingMode('flexible');
// Or per subscription
$user->newSubscription('default')
->price($basePlan)
->meteredPrice($apiCalls)
->withBillingMode('flexible')
->create($paymentMethod);
Fully backwards compatible. Existing subscriptions stay on classic mode. Migrate individually with $subscription->migrateToFlexibleBillingMode() when ready, or set Cashier::defaultBillingMode('flexible') so all new subscriptions use it automatically.

Core Flexible Billing

1

Flexible Subscription

Ready

Create a subscription with billing_mode: flexible, verify on Stripe, clean up.

The foundation of everything. Any SaaS app that charges a monthly fee can benefit from the improved proration and invoice handling.

2

Hybrid Billing (Fixed + Metered)

Ready

Combine $29/mo base + $0.01/API call on one flexible subscription.

The killer feature. Think base plan + API overage charges, or a seat license + storage usage. Most modern SaaS needs this.

3

Proration Discounts

Ready

Compare itemized vs included proration modes.

Controls how mid-cycle upgrades appear on invoices. Itemized mode shows discount line items separately for full transparency.

4

Swap / Upgrade / Downgrade

Ready

Starter to Pro to Enterprise and back, all in flexible mode.

Proves billing mode survives plan changes. Users upgrade/downgrade freely and flexible mode stays active throughout.

5

Global Default Billing Mode

Ready

Cashier::defaultBillingMode('flexible') in action.

One line in your AppServiceProvider and every new subscription uses flexible billing automatically. No code changes elsewhere.

6

Cancel and Resume

Ready

Cancel with grace period, resume, verify billing mode preserved.

Grace periods work exactly the same in flexible mode. Resume preserves the billing mode so nothing breaks.

Subscription Schedules & Quotes

7

Multi-Phase Schedule

Ready

Create 2-phase schedule (Starter to Pro), then release.

Pre-plan subscription transitions. Useful for trial-to-paid, annual discount periods, or staged enterprise onboarding.

8

Quote Lifecycle

Ready

Create, finalize, accept a quote — subscription created automatically.

For B2B sales workflows. Generate a formal quote, let the customer review it, and when they accept it auto-creates the subscription.

9

Schedule from Subscription

Ready

Convert running flexible sub into a schedule (billing mode inherited).

Convert a running subscription into a managed schedule. Useful when a customer commits to a plan change at their next billing cycle.

Usage Billing, Credits & Pricing

10

Billing Credits

Ready

Add $100 credit, calculate against $150 usage, deduct $30.

Issue promotional credits, handle refunds as balance adjustments, or pre-pay for usage. Works with any subscription model.

11

Metered Usage Reporting

Ready

Create meter, report 350 usage events, track estimated charges.

Report consumption events to Stripe in real-time. Stripe aggregates them and includes the charges on the next invoice automatically.

12

Usage Thresholds

Ready

DB only Set threshold, check at 50/100/150%, track overage.

Monitor consumption against limits. Useful for alerting customers approaching their plan limits or calculating overage charges.

13

Rate Card Pricing

Ready

Local only Graduated tiered, volume, package, and flat rate calculations.

Model your pricing locally for display, comparison, or cost estimation without making Stripe API calls. Supports all common pricing models.

Migration (One-Way)

14

Classic to Flexible Migration

Ready

One-way Start classic, migrate via /migrate, swap price, cancel.

This is a one-way operation — once migrated, a subscription cannot go back to classic mode. Use this when you are ready to commit. Stripe provides a dedicated /migrate endpoint so you can upgrade subscriptions individually.

Built with Laravel 13 · Laravel Cashier · Stripe Flexible Billing
View the PR · Based on PR #1772 by @Diddyy