Skip to main content

Overview

The billing lifecycle describes how customer subscriptions progress from creation through renewal, upgrades, cancellation, and expiration. Autumn handles all the complexity of managing this lifecycle automatically.

Subscription States

Customer subscriptions (CustomerProduct) go through several states:

State Definitions

trialing
  • Customer is in free trial period
  • Full access to features
  • No payment required yet
  • Automatically transitions to active when trial ends
active
  • Subscription is active and paid
  • Customer has full access
  • Recurring billing happens automatically
past_due
  • Payment failed but subscription still active
  • Stripe retries payment automatically
  • Customer may have limited access (configurable)
  • Transitions to unpaid after max retry attempts
canceled
  • Subscription is canceled but still active until period end
  • Customer retains access until ended_at timestamp
  • No renewal will occur
unpaid
  • Payment failed after all retry attempts
  • Subscription is effectively ended
  • Customer loses access
ended
  • Subscription fully terminated
  • No access to features
  • Can be reactivated by attaching a new product

Billing Cycles

Billing cycles determine when customers are charged:

Subscription Billing

Recurring charges happen at the interval defined in the price:
Annual billing:

Billing Anchor

The billing anchor determines when the first charge occurs and sets the cycle:
By default, the billing anchor is set to the subscription start time. You can customize it to align billing across multiple subscriptions or to a specific day of the month.

Usage Billing

Usage-based charges are billed at the end of each period:
Prepaid usage is billed upfront:

Subscription Creation

When a customer subscribes via /attach:

1. Product Attachment

2. Checkout Flow

For paid products, Autumn returns a Stripe Checkout URL:
Redirect the customer to complete payment:

3. Subscription Activation

After successful payment:
  1. Stripe sends webhook to Autumn
  2. Autumn creates CustomerProduct record with status: "active"
  3. Customer gets immediate access to features
  4. Entitlements are activated

Free Trials

Free trials give customers temporary access before payment:
Trial timeline:
Disable free trial for specific customers:
Customers can only use each free trial once. If they previously trialed a product, they’ll be charged immediately on re-subscription.

Upgrades and Downgrades

Autumn automatically handles plan changes:

Upgrade (to higher-priced plan)

What happens:
  1. Proration calculated: Customer gets credit for unused time on Starter
  2. Immediate charge: Prorated amount for Pro plan
  3. Access granted: Instant access to Pro features
  4. Billing aligned: Next charge on original billing date
Example:

Downgrade (to lower-priced plan)

What happens:
  1. Schedule change: Downgrade scheduled for end of billing period
  2. Continued access: Customer keeps Pro until period ends
  3. No immediate charge: Credit applied to next invoice
  4. Switch occurs: Starter plan activates on renewal date
Downgrades are scheduled (not immediate) to ensure customers get the full value of what they paid for.

Add-ons

Add-on products can be attached alongside base plans:
Customer now has:
Billing:
  • Both subscriptions bill independently
  • Can have different billing cycles
  • Can be canceled independently

Cancellation

Two types of cancellation:

1. End of Period Cancellation

Timeline:
Customer product state:

2. Immediate Cancellation

Customer product state:

Payment Failures

When a payment fails:

1. Initial Failure

2. Automatic Retries

Stripe automatically retries failed payments:
  • Retry 1: After 3 days
  • Retry 2: After 5 days
  • Retry 3: After 7 days
  • Retry 4: After 9 days

3. Successful Retry

4. Final Failure

Configure dunning emails in Stripe to automatically remind customers about failed payments.

Invoices

Autumn generates invoices for all charges:
Invoice line items:
Example invoice:

Subscriptions Object

Autumn tracks Stripe subscriptions:
Autumn uses this to:
  • Track billing periods
  • Aggregate usage across multiple features
  • Sync with Stripe subscription lifecycle

Next Steps