Why this matters
Failed payments are often recoverable churn. A dunning funnel shows whether users update cards, retries recover revenue, or accounts silently cancel.
What you get
- Recovery rate after failed invoices
- Time to recovery
- Cancellations after dunning
- Revenue at risk and recovered
Walk through it
How effective is our dunning flow?
I’ll stitch billing webhook events into a recovery funnel.
POST /v1/projects/:project_id/analytics/query {
project_id: "default",
hogql: "SELECT event, count(DISTINCT properties.invoice_id) AS invoices, sum(toFloat(properties.amount)) AS amount FROM events WHERE event IN ('invoice_payment_failed','payment_method_updated','invoice_payment_recovered','subscription_canceled') AND timestamp > now() - INTERVAL 60 DAY GROUP BY event ORDER BY invoices DESC"
}
The output
The agent returns recovery rate, lost revenue, and suggested actions such as improving retry timing or card-update emails.
Setting it up
Emit billing lifecycle events from Stripe or your subscription provider webhook handler.
Variations
- “Segment recovery by plan.”
- “Find accounts with repeated payment failures.”
- “Draft a Slack digest for at-risk revenue.”