Dunning & recovery
Failed renewals are recoverable revenue. Larz chases them for you.
@app.schedule("0 9 * * *") class=com># daily 9am
class=kw>def dun():
app.money.run_dunning(grace_days=7, schedule=(0, 3, 7),
on_notify=lambda subject, sku, attempt: send_reminder(subject, attempt))
@app.money.on_payment_failed
class=kw>def dropped(subject, sku):
... class=com># lost after the grace period
When a subscription's term lapses without a renewal, Larz begins dunning: it notifies the
customer on each scheduled day, keeps access alive through grace_days, and only then
revokes and fires on_payment_failed. It's idempotent โ safe to run every day. A paid
renewal clears the dunning state automatically (or call
app.money.clear_dunning(subject, sku)).
Guide: Dunning in Python.