SimpleTexting recovery SMS for failed Stripe payments
When a Stripe charge or invoice payment fails, send the customer a personalized SimpleTexting recovery SMS and log the attempt on their HubSpot contact.
Build me an agent workflow that runs SMS-first dunning on failed Stripe payments, before our email retry cadence takes over.
Trigger: a Stripe webhook on the events invoice.payment_failed and charge.failed. Treat both as the same recovery flow.
When the webhook fires, do the following:
1. Use Stripe Retrieve Charge to pull the amount, currency, last payment method (brand and last 4 if available), failure reason, and attempt count. If the event was invoice.payment_failed, also resolve the underlying charge from the invoice so we have the same fields. Capture the invoice id so we can de-dupe later.
2. Use Stripe Retrieve Customer to get the customer's email, name, and phone number on the Stripe customer object.
3. Use HubSpot Get Contact (lookup by email, idProperty=email) to find the matching contact. Read first name, plan tier (a custom property on the contact), phone number, the SMS opt-out / unsubscribed status, and recent notes that mention prior payment issues.
4. Decide whether to send. Skip silently (no SMS, no note, no error) if any of these are true: the contact has no phone number on file in either HubSpot or Stripe, the contact is opted out of SMS, or a HubSpot note already exists for this invoice id (one SMS per invoice maximum). Prefer the HubSpot phone if both are present.
5. Draft a short, friendly recovery SMS tailored to the situation. Use the customer's first name, the failed amount, and the card brand + last 4 if available. Tone rules:
- First failure (attempt count = 1 and no prior payment-issue notes): warm nudge. Acknowledge cards fail for harmless reasons, ask them to update the card, keep it light.
- Repeat failure (attempt count > 1 or prior payment-issue notes exist): firmer ask with a specific next step ("please update your card by [date] to avoid losing access"). Still polite, never aggressive.
Keep the message under 320 characters, no emojis unless the plan tier is consumer/self-serve, and always sign off with the company name. Do not include a raw URL unless the user provides a billing portal link.
6. Send the SMS using SimpleTexting Send Message to the chosen phone number. Use mode=AUTO.
7. Log the outcome on the HubSpot contact using HubSpot Create Note, associated to the contact. The note body should include: the Stripe invoice id, the failed amount and currency, the failure reason, the attempt count, the exact SMS text that was sent, the timestamp, and a suggested follow-up date (48 hours later if first failure, 24 hours if repeat). This note is also what future runs check to enforce the one-SMS-per-invoice rule.
Error handling: if SimpleTexting Send Message fails (e.g. 422 invalid number, 403 opted out), do not create the note. If HubSpot Create Note fails after the SMS was sent, retry the note creation so the audit trail is preserved. Log skipped runs (no phone, opted out, duplicate invoice) without raising an error.
Out of scope: do not send any emails, do not pause subscriptions, do not modify the customer in Stripe. This workflow is only SMS plus a HubSpot note.
Additional information
What does this prompt do?
- Catches every failed Stripe charge or invoice the moment it happens, before your email dunning cadence kicks in.
- Pulls the amount, attempt count, and customer details from Stripe, then enriches with the matching HubSpot contact for name, plan, and any prior payment history.
- Writes a personalized recovery text. Warm and friendly on a first failure, firmer with a specific next step on repeat failures.
- Sends the SMS through SimpleTexting and logs a clean recap on the HubSpot contact so your CSMs see what happened and what was sent.
- Respects opt-outs and missing phone numbers, and never sends more than one recovery text per failed invoice.
What do I need to use this?
- A Stripe account where you can add a webhook for failed payments.
- A SimpleTexting account with an approved API token and a sending number.
- A HubSpot account so the agent can look up the contact by email and add a follow-up note.
How can I customize it?
- Adjust the tone and wording of the recovery text for first-time versus repeat failures, or by customer plan tier.
- Change what shows up in the HubSpot note, such as the next retry date or who should follow up.
- Add filters so the workflow only texts certain plan tiers, certain amounts, or skips test transactions.
Frequently asked questions
Will this text the customer before Stripe's own email retries go out?
What happens if the customer has no phone number on file or opted out?
Can the same customer be texted twice for the same failed invoice?
Does this work for both subscription invoices and one-off charges?
Do I need HubSpot for this to work?
Stop letting failed payments slide into silence.
Connect Stripe, SimpleTexting, and HubSpot once, and every failed charge gets a personal text before email even fires.