Subscriptions
A subscription tracks what a customer pays you, how often, and what happens when any of that changes mid-cycle.
Changing a subscription
When you update a subscription’s items, Stripe can credit the unused portion of the old price and charge for the new one. This behaviour is set per subscription with proration_behavior, and the default is create_prorations only on some update paths.
Reacting to changes
Subscription lifecycle events arrive as webhooks. Handle them idempotently — Stripe retries a failed delivery with exponential backoff for up to three days.
# listen for the events that change what you bill stripe listen --events customer.subscription.updated
Trials
A subscription can start in a trial. Three days before it ends, Stripe sends customer.subscription.trial_will_end so you can prompt for a payment method.