Diagrams
Subscription renewal
How the billing engine renews a subscription, collects the invoice and retries a failed payment.
This is the renewal of a subscription billed by the platform's own billing engine. A subscription on a provider that bills natively, such as Stripe, renews at the provider and reaches the platform as provider webhooks instead.
What to rely on
- Draft first. At the period end the scheduler creates a draft invoice and advances the
period. The invoice is finalized an hour later, or at once if you call
invoice.finalize. - Off-session charge. Finalizing plans the first payment attempt immediately, against the default payment method.
- Retries. A declined payment publishes
invoice.payment_failed, moves the subscription topast_dueand retries on the country's schedule: by default 3, 5 and then 7 days after the previous attempt, four attempts in all. You change the schedule in the dashboard under Applications → Failed payments, 1 to 8 retries of 1 to 60 days each. - After the last retry the country's final action applies to the
past_duesubscription. The default, as on Stripe, cancels it (cancellation_details.reasonpayment_failed,subscription.canceled). The other choices mark itunpaid, which a payment of the open invoice brings back toactive, or leave itpast_due. Either way the invoice staysopen, so it can still be paid. Countries created before this setting existed keepunpaid. - Authentication needed. When the charge needs the customer, for example for 3-D
Secure,
invoice.payment_failedandinvoice.payment_action_requiredare both published, a retry is planned as for a decline, and the subscription moves topast_due.