Skip to Content
Paycose Docs
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 to past_due and 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_due subscription. The default, as on Stripe, cancels it (cancellation_details.reason payment_failed, subscription.canceled). The other choices mark it unpaid, which a payment of the open invoice brings back to active, or leave it past_due. Either way the invoice stays open, so it can still be paid. Countries created before this setting existed keep unpaid.
  • Authentication needed. When the charge needs the customer, for example for 3-D Secure, invoice.payment_failed and invoice.payment_action_required are both published, a retry is planned as for a decline, and the subscription moves to past_due.

On this page