Features
Subscriptions
Recurring billing that generates and charges an invoice automatically, every period.
A Subscription bills a customer on a repeating schedule — weekly, monthly, yearly — by automatically generating and paying an Invoice each period.
How it works
- Create a
Subscription with line items (product/price), a
customer_id, and adefault_payment_methodto charge automatically. - Retrieve a Subscription's current status, or list every Subscription.
- Each billing period, it generates an Invoice from those line items and attempts payment against the default payment method.
- You can pause, resume, or cancel it at any time, and for usage-based prices, report usage so the next invoice reflects it.
- Want to test a year of billing in minutes? Test Clocks let you fast-forward simulated time so you can watch a subscription renew, without waiting for real months to pass.
Subscription Schedules are not supported, so a change can't be planned ahead.
Change a plan when it should take effect by
updating the
subscription's line_items (proration_behavior decides how the rest of the
period is billed), and
preview the next
invoice first. To end a subscription on a date, create it with end_on or set
cancel_at_period_end. The subscription_schedule.* webhook events are
reserved and never sent.
Pausing and canceling
- Pause stops collecting payment until you resume: no invoice is collected, and
pause_collectionsays what happens to the paused periods' invoices (voidby default, orkeep_as_draft/mark_uncollectible) and when collection resumes. As on Stripe,statusstaysactivewhile collection is paused. - Cancel with
cancel_at_period_endkeeps the subscription running untilcancel_at. Canceling at once ends it now and drops a scheduled cancel:cancel_at_period_endreadsfalseandcancel_atnull, whilecanceled_atkeeps the time the scheduled cancel was asked for. cancellation_detailsis always returned;reason,feedbackandcommentare null until recorded.
Common use cases
- A SaaS monthly or annual plan that renews automatically.
- A metered API subscription where the bill depends on usage reported during the period.
- Giving a customer a free trial that transitions into a paid Subscription.