Text customers when Stripe payments fail and alert your billing team

When a Stripe payment fails, text the customer a tap-to-pay link and post a structured alert in your billing Slack channel so nothing slips.

Deterministic Code
StripeTwilioSlack BotFinanceOperationsNotifications & Alerts
PromptCreate

Build me a deterministic code workflow that runs SMS dunning on Stripe failed payments and alerts our billing team in Slack. No reasoning needed — every step is fixed.

Trigger: a Stripe webhook for invoice.payment_failed (and optionally charge.failed as well). The workflow should fire once per webhook event.

Step 1 — Look up the customer. Take the customer ID from the webhook payload and call Stripe's Retrieve Customer to fetch their name, email, and stored phone number. From the same webhook payload, capture the failed amount, the invoice number, the hosted invoice URL, and the current attempt count.

Step 2 — Send the customer an SMS via Twilio (only if a phone number is present on the customer). Use Twilio's Send a Message operation to send a friendly text that includes the customer's first name, the failed amount formatted as currency, the invoice number, and the hosted invoice URL so they can update their card in one tap. Example tone: "Hi {first_name}, your payment of {amount} for invoice {number} didn't go through. Update your card here: {hosted_invoice_url}." If the customer has no phone number on file, skip the SMS step silently and continue.

Step 3 — Always post a structured alert to our billing Slack channel using Slack Bot's Send a Message. The message should include the customer name, the failed amount, the attempt count, whether the SMS went out or was skipped, and a clickable link to the Stripe invoice so finance can follow up if the SMS retry doesn't work.

Configuration the user should be able to set up front: the Slack channel ID, the Twilio sending phone number, and which Stripe events to subscribe to (invoice.payment_failed only, charge.failed only, or both). Keep the flow deterministic — no LLM calls, no judgement, just fetch and notify.

What does this prompt do?

  • Listens for failed Stripe charges and invoice payments the moment they happen.
  • Texts the customer a friendly SMS with their first name, the failed amount, the invoice number, and a one-tap link to update their card.
  • Posts a structured alert to your billing Slack channel with the customer, amount, attempt count, and a direct link to the Stripe invoice.
  • Runs the same way every time, so a failed payment never sits unnoticed in your dashboard.

What do I need to use this?

  • A Stripe account where you can see and manage customers and invoices.
  • A Twilio account with an SMS-capable phone number to send the texts from.
  • A Slack workspace and a channel where your billing or finance team watches alerts.

How can I customize it?

  • Rewrite the SMS copy to match your brand voice, or switch the channel mix to SMS only, Slack only, or both.
  • Point the alert at a different Slack channel, or route high-value customers to a separate channel.
  • Choose which failures trigger the workflow: failed invoice payments, failed one-off charges, or both.

FAQs

What happens if Stripe doesn't have the customer's phone number?
The SMS step is skipped automatically and the Slack alert still goes out, so your team always sees the failure and can follow up another way.
Will it fire on every retry attempt or only the first one?
Every retry attempt. The Slack alert includes the attempt count, so finance can decide whether to wait for Stripe to retry or step in.
Does this replace Stripe's built-in dunning emails?
No, it runs alongside them. Stripe still sends its retry emails. This adds a faster SMS nudge to the customer and an internal alert for your team.
Can I send WhatsApp instead of SMS?
Yes. Twilio supports WhatsApp, so you can swap the channel without rebuilding the workflow.
Where do customer replies to the text go?
Replies land in your Twilio inbox. If you want a teammate or an AI to read them, you can add a follow-up workflow that listens for incoming messages.

Related templates

Rank your Intercom queue by what each customer pays you

See every open conversation next to that customer's plan, monthly value and unpaid invoices, so the expensive account never sits waiting all morning.

Intercom
Stripe
App
Review desk for portal forms your team still fills in by hand

Stage a batch of filings overnight, then approve each completed form from a screenshot before anything is ever submitted.

Kernel
Google Sheets
Slack Bot
App
Client-by-client cold email pipeline review for agencies

Pick a client and a date range to see sent, replies, meetings booked and the real deal value your cold email produced, campaign by campaign.

Instantly
HubSpot
Slack Bot
App
Catch the trials quietly dying before the card gets charged

Open one desk each morning to see every account still in a trial, ranked by how much money is at stake against how little they have actually used.

Intercom
Stripe
General Input Database
App
Audit what Intercom's Fin AI actually resolved before you pay

Review every conversation Fin closed as resolved, judge which ones actually stuck, and see what the gap is worth against your bill.

Intercom
Google Sheets
Slack Bot
App
One triage console for every Jira service desk queue

Merge your IT, HR and Facilities queues into one list ranked by SLA time left, then reply, change status and escalate without ever opening Jira.

Jira Service Management
Jira
Slack Bot
App

Stop chasing failed payments by hand.

Connect Stripe, Twilio, and Slack once, and every failed payment triggers a friendly text to the customer and a clean alert for your billing team.