past_due and enters an automated payment recovery (dunning) flow: a fixed schedule of retries, plus an email to the customer with a hosted link to update their card. Most failures are transient (an expired card, a temporary decline), so recovery gives them a chance to fix it before anything is lost. The same card-update flow is reachable from the customer portal, so a customer who never opens the email can still fix it themselves.
The retry schedule
The first failed charge sets the invoice’s status so Bachs can retry it on a fixed cadence:- Retry 1: 1 day after the first failure
- Retry 2: 3 days after retry 1
- Retry 3: 5 days after retry 2
past_due and each failed attempt emits invoice.payment_failed and re-sends the customer email. A success at any point marks the invoice paid, reactivates the subscription (past_due → active), and emits invoice.paid.
If the third retry fails, recovery is exhausted.
When recovery is exhausted
What happens when retries run out is a per-account setting, so you can match your business.- Cancel (default)
- Mark unpaid
The subscription moves to
canceled with a cancellation reason of payment_failed, and Bachs emits customer.subscription.deleted. This is terminal: a later payment can’t revive it, and the customer starts a new subscription.Helping customers recover
The failed-payment email
On every failed charge, Bachs emails the customer to tell them the payment failed. While the subscription is still recoverable (past_due or unpaid), that email includes a button linking to a hosted “update payment method” page. The copy differs depending on whether retries are still pending or recovery has been exhausted.
The email is best-effort and never blocks billing; if it can’t be sent, retries still run on schedule.
The recovery link
The hosted page lets the customer enter a new card without you building any UI. Bachs mints the link on demand when the failed-payment email is sent:- It’s only created while the subscription is
past_dueorunpaid. - The link is valid for 30 days.
- When the customer completes it, Bachs saves the new card, charges the outstanding invoice, and on success reactivates the subscription (
past_due/unpaid→active).
Statuses at a glance
Related
Managing subscriptions
Change the plan, or cancel from the API.
Subscription webhook events
The
invoice.* and customer.subscription.* events recovery emits.
