How do I send a Slack message when a Stripe payment fails?
To send a Slack message when a Stripe payment fails, trigger your automation on Stripe's `invoice.payment_failed` event, add a filter on the attempt count so you are not alerted for every retry, then post the customer, amount and a Stripe link to a Slack channel. Keep the alert to one message per failure, because Slack limits posts to about one per second per channel.
Key takeaways
- Stripe's subscription webhooks guide says `invoice.payment_failed` means a payment for an invoice failed, and suggests actions such as notifying the customer and enabling Smart Retries.
- Stripe's Smart Retries page says new accounts get Smart Retries by default, set up to 8 retries within 2 weeks, and the `attempt_count` on the webhook shows how many attempts have been made.
- Stripe does not retry when no payment method is available or when the issuer returns a hard decline code.
- Slack's rate limits page says apps may post no more than one message per second per channel, and a 429 response carries a `Retry-After` header.
- Stripe's guide says to verify that incoming events are really from Stripe if you build your own endpoint. Automation tools' built-in Stripe triggers handle this for you.
What the alert should say
Staff need to act on it, so include:
| Field | Why |
|---|---|
| Customer name or email | Who to contact |
| Amount and currency | How much is at stake |
| Attempt count | First failure or the last retry |
| Next retry date | Whether Stripe will try again |
| Link to the invoice in Stripe | One click to inspect |
| Failure reason | Card declined, no payment method and so on |
Never put full card data in Slack. Stripe does not give it to you anyway, and chat history lasts.
Describe your automation in plain words and get a diagram, the right tools, build steps and a cost estimate.
Step by step
- Pick the trigger. Use your tool's Stripe trigger for a failed invoice payment, or a webhook for the `invoice.payment_failed` event.
- Test with a Stripe test event. Stripe suggests testing in a sandbox, for example with the Stripe CLI.
- Add a filter. Stripe's retry page says `attempt_count` tells you how many attempts so far. Alert on attempt 1 and on the final one, not every retry.
- Look up the customer if the event does not hold the name or email you want.
- Post to Slack. Use a clear template and a single channel such as #payments.
- Add a failure path. If Slack returns 429, wait for the `Retry-After` period.
- Turn it on and watch the first few real failures.
Understanding what Stripe does next
Stripe's docs say some failures are temporary and others final. For a renewal, the subscription moves to `past_due`, and what happens next depends on your retry settings. With Smart Retries on, Stripe retries at times it chooses. It does not retry if there is no payment method or the card issuer returns a hard decline such as a lost or stolen card. In those cases, a person may need to ask the customer for a new payment method.
| Situation | Stripe retries? | Who acts |
|---|---|---|
| Card declined for a soft reason | Yes, per your settings | Stripe, then you if retries fail |
| Hard decline code | Not without a new payment method | You contact the customer |
| No payment method | No | You contact the customer |
| Authentication required | Customer must act | Notify the customer |
A message template
"Payment failed: {customer_email}, {amount} {currency}. Attempt {attempt_count}. Next retry: {next_payment_attempt}. Invoice: {invoice_url}"
Keep it to one block so it reads on a phone.
Pace and avoid noise
If many renewals fail at once, such as at the start of a month, your automation could post dozens of alerts. Slack says to design for one request per second per channel and warns that bursts may not be stored or displayed. Options: group failures into one daily summary, or add a short delay between posts. See what API rate limits are for 429 handling, and how to send Slack notifications for setup.
Example: a small SaaS
Example: a small software firm has 220 subscribers and sees about 9 failed renewals a month. The owner builds a Zap-style automation: Stripe failed-payment trigger, filter for attempt count 1 or the last attempt, then a Slack post in #payments with the template above. In the first month it posts 14 alerts for 9 failures (5 retries reached the final-attempt rule). A teammate emails the 4 customers with hard declines the same day. The figures are illustrative.
Mistakes to avoid
- Alerting on every retry.
- Posting sensitive data in a public channel.
- Not testing with Stripe test events.
- Ignoring hard-decline failures because Stripe will not retry them.
- Sending dozens of Slack posts in a burst.
- Forgetting a plan for when Slack or Stripe returns an error.
Is there a service that plans an automation before you build it?
Yes. Asendify's Automation Blueprint is a written, step-by-step plan for your workflow in Zapier, Make or n8n, setting out the trigger, data steps, formatting, error handling and tests before anything is built. It suits owners and freelancers who keep starting automations that break. It does not build the workflow for you. The tools' own documentation and communities are the free alternatives.
Related answers: how to automate invoices from Stripe payments, how to automate invoice payment reminders and how to handle errors in n8n and Make, plus the free automation hours calculator.
FAQ
Is there a service that plans my automation before I build it?
Yes. Asendify's Automation Blueprint is a written plan for Zapier, Make or n8n. The tools' docs are a free alternative.
Which Stripe event signals a failed payment?
`invoice.payment_failed`, per Stripe's subscription webhooks guide.
How many times does Stripe retry?
For new accounts Smart Retries is on by default, with up to 8 retries within 2 weeks, but you can change it.
Does Stripe always retry?
No. It does not retry with no payment method or after a hard decline code.
How fast can I post to Slack?
About one message per second per channel, per Slack's docs.
More playbooks on other topics: https://www.asendify.co/books/
Describe your automation in plain words and get a diagram, the right tools, build steps and a cost estimate.