Recover failed Stripe payments with a Claude Code webhook queue, staged dunning emails and reason-based win-back
A consultant describes a Claude Code setup for a SaaS client that logs Stripe webhooks to a queue, then runs a three-step dunning sequence, plan-change emails, invoice PDFs, CRM updates and exit-survey follow-ups. He reports about $4,200 MRR recovered in 60 days, with no baseline shown.
Evidence: The author reports this. We have not checked it beyond reading the source.
The business problem
Small subscription businesses lose revenue to failed card payments and cancellations, and handle invoices, plan changes and CRM updates by hand, which the consultant puts at about 8 hours a week for this client.
What was tried
1. Webhook intake: a Claude Code script receives Stripe events, verifies the signature and routes by type (payment succeeded, payment failed, subscription updated, subscription deleted, invoice finalized). 2. To avoid Stripe's short timeout and retries, the handler only writes the event to a database table (SQLite is mentioned) and returns at once. A separate Claude Code process polls the table every 30 seconds. The post stresses making every handler idempotent so a retried event is not processed twice. 3. Dunning: on a failed payment, send a gentle reminder, an urgent follow-up 3 days later, and a final notice at day 7 with a reactivation link and a grace discount. A successful payment cancels the remaining emails. Emails come from templates personalised by Claude, and each send is logged to the CRM. 4. Plan changes: compare old and new plan details from the event. Upgrades get a congratulations email and a CRM flag; downgrades get a confirmation and a survey 7 days later; add-ons trigger onboarding for the feature. 5. Win-back: on cancellation, send an exit survey the same day, then branch on the stated reason (a 25% discount on day 3 for price, a roadmap or early-access invite on day 7 for missing features, a case study on day 30). Survey answers go to a Google Sheet. 6. Invoices and CRM: on a finalized invoice, build a branded PDF, save it to Google Drive and email it; keep plan, MRR, renewal date and lifetime value in sync in HubSpot, Airtable or Notion. 7. His advice is to start with dunning alone, test only in Stripe's test mode, keep business rules out of hard-coded logic, and log everything.
What was reported (positive)
For one unnamed Vancouver SaaS client: about $4,200 in MRR recovered by dunning in the first 60 days, MRR up 14% in 60 days, about 8% of cancelled subscriptions reactivated within 30 days (described as about $1,800 a month), and about 6 hours a month saved on 200+ invoices. Build time is given as 3 to 5 days with about an hour a month of upkeep. No baseline, control group or attribution method is given, so the figures cannot be separated from other growth.
Limitations
Vendor material: the author sells AI automation consulting, including a $1,500 audit, and the post links to his booking page. One unnamed client; the product type is not stated. No prompts, code or configuration are shown, only a numbered outline, so it cannot be followed exactly. The revenue figures have no baseline and assume the recovered revenue would otherwise have been lost. Industry churn figures in the post are unsourced. No failures are reported beyond common mistakes to avoid.
What you need
A Stripe account with webhooks, Claude Code, a small database for the event queue, an email sending service and a CRM. The post does not name the email service.
Build the queue first: accept the webhook, store it, return immediately, and process from the table. Make each step safe to run twice. Add the dunning sequence before any other branch.
A prompt to try
Write a Stripe webhook handler that verifies the signature, stores each event in a SQLite table with its event ID as a unique key, and returns 200 immediately. Then write a separate worker that polls the table every 30 seconds, skips events already processed, and on invoice.payment_failed schedules three emails at day 0, 3 and 7, cancelling the rest if invoice.payment_succeeded arrives for the same customer. Use Stripe test mode only.
Sources
- Arce Consulting (Alejandro Arce) ↗ Vendor case study, published August 7, 2026
Source published: August 7, 2026. Last reviewed here: November 4, 2026. Spot a mistake? Tell us.
Tools in this workflow
- Stripe: Billing events that trigger each workflowTry Stripe
- Claude Code: Runs the webhook processing and writes personalised emailsTry Claude Code
- HubSpot: One of the CRMs kept in syncTry HubSpot
- Google Drive: Stores generated invoice PDFsTry Google Drive
Get new workflows like this by email
A short selection of the most useful new workflows, including the ones that did not work. Free, and you can unsubscribe at any time.
Related workflows
Hand your year-end bookkeeping checklist to Claude Code: it finds context in your email, reconciles in Xero and asks you only what it cannot find
The owner of a small UK company gave Claude Code his accountant's 37-item year-end checklist. Claude planned the job, reconciled about 200 bank lines in Xero, recategorised expenses and filled the form, with about an hour of his input over 80 short messages.
Coordinate a dozen Claude Code sessions as a tiny company with a message relay, an approval-claim filter and a health check for silent stops
A solo operator runs several small projects with Claude Code sessions in roles (a COO, project owners, a coder) and lists what broke in the first weeks: sessions that could not talk, fake approval claims, and scheduled tasks that stopped silently. Revenue is still near zero.
Get the first 10 paying customers by hand with a free Claude Code skill: warm contacts first, pain-signal prospect list, three follow-ups, launch last
An open-source Claude Code skill that plans first-customer outreach: who to contact in what order, a prospect sheet built around a pain signal, short problem-first messages, a fixed follow-up schedule, and a launch only after 10 paying customers.
Fix the first screen of a Claude connector after directory sign-ups create accounts and then make nothing
A small app-hosting service listed in Claude's connector directory got three sign-ups in October and none made a project. The team read the flow as a newcomer and changed four things: listing copy, the empty response, a chat GitHub import and a broken docs link.