Skip to content

The moment it happens

Get alerted when a payment fails

Each failed charge or invoice payment shows up in Slack with the customer, amount and reason.

Runs
The moment it happens
Apps
Stripe
AI
Not needed
Access
read (Charges, Invoices, Customers); webhook endpoint created by user

Send this to your assistant

Create a ClickRuntime automation: when a Stripe payment or invoice fails, post the customer, amount and failure reason to #billing in Slack.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

A card declines for a customer with an annual plan, Stripe retries on its schedule, and the finance lead only hears about it when the dunning emails start generating support tickets. Meanwhile, an expired card, insufficient funds and a fraud decline all look the same in a list of failed charges, even though each needs a different response from your team.

As soon as Stripe emits a payment failed event, ClickRuntime verifies the webhook signature so only genuine events count, then posts to Slack with the customer, amount and the decline reason, such as card_declined or insufficient_funds. Your team sees what failed and why within seconds of it happening.

It is a good fit for SaaS teams that want a human to step in on larger accounts while automatic retries handle the rest.

What you get out of it

  • High-value customers get a personal touch

    A failed 2,400 dollar annual renewal deserves a phone call, not just an automated email. The alert lets your team reach out immediately instead of waiting for retries to run out.

  • Decline reasons guide the right response

    An expired card needs an update link, insufficient funds may resolve on payday, and a suspected fraud decline needs care. Seeing the reason in the message means the first reply is the correct one.

  • Revenue is protected from silent leaks

    Involuntary churn from failed payments often outweighs voluntary cancellations. Seeing failures as they occur gives you a chance to rescue subscriptions before access is cut off. That keeps card problems from turning quietly into lost subscriptions on your biggest accounts.

  • Checkout bugs surface fast

    Ten failures in an hour with the same error code usually point to a technical issue rather than customers. A noisy channel is an early sign that something is wrong in your integration.

  • Signature checking keeps the feed trustworthy

    Only events that pass Stripe's signature verification produce a message, so a forged request cannot spam the channel or create false alarms for your team. Your team can trust that every message reflects something real that happened in Stripe.

How it works

What happens, step by step

  1. The moment a charge or invoice payment fails in Stripe, ClickRuntime is told about it.

  2. It checks that the message really came from Stripe before doing anything.

  3. It posts an alert to your Slack channel with the customer, amount and the reason the payment failed.

Before it runs live

  • Connect Stripe
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Get alerted when a payment failsjust nowSucceeded
Slack · #billing:warning: Payment failed: Northwind Traders · 249.00 USD · Your card has insufficient funds.

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Act only on the items that match your own rules, and skip the rest
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Stripe steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
failed_payment_alert.pyexample
import stripe
from clickruntime import on_event, credentials, notify, verify

@on_event
def handle(event):
    if not verify.stripe(event.body, event.header("Stripe-Signature"), credentials.secret("STRIPE_WEBHOOK_SECRET")):
        return {"ignored": "bad signature"}
    obj = event.json["data"]["object"]
    stripe.api_key = credentials.secret("STRIPE_API_KEY")
    customer = stripe.Customer.retrieve(obj["customer"]) if obj.get("customer") else {}
    if event.json["type"] == "invoice.payment_failed":
        amount, reason = obj["amount_due"], (obj.get("last_finalization_error") or {}).get("message") or "card declined"
    else:
        amount, reason = obj["amount"], (obj.get("last_payment_error") or {}).get("message") or "unknown"
    notify.slack(f":warning: Payment failed: {customer.get('name') or customer.get('email') or 'unknown customer'} · "
                 f"{amount / 100:,.2f} {obj['currency'].upper()} · {reason}", channel="#billing")
    return {"type": event.json["type"]}

FAQ

Common questions

Does it alert on every retry, or only the first failure?
Stripe sends an event each time an attempt fails, so you can see successive retries as separate messages. If you only want the first failure per invoice, a condition on the attempt count keeps later retries quiet.
Which Stripe permissions or webhook setup are needed?
You add a webhook endpoint in the Stripe dashboard that listens for invoice.payment_failed or payment_intent.payment_failed. Creating endpoints needs an account admin or developer role. The signing secret is stored as a secret.
Can I post only failures above a certain amount?
Yes. Add a minimum, for example 500 dollars, and smaller failures are skipped while large ones still reach the channel. Tell your assistant the threshold and approve the updated condition before it takes effect. Smaller failures can go to a separate channel instead.
What permissions does it need?
read (Charges, Invoices, Customers); webhook endpoint created by user. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run for each event the app sends.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Get alerted when a payment fails” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.