Skip to content

The moment it happens

Log failed Stripe payments to Google Sheets

Every failed Stripe payment is added to a Failed payments tab with the customer's email, amount, decline reason and a link to the payment.

Runs
The moment it happens
Apps
Google Sheets, Stripe
AI
Not needed
Access
Stripe webhook signing secret; Google Sheets read+write

Send this to your assistant

Create a ClickRuntime automation: when a Stripe payment fails, add a row to the Failed payments tab of my sheet with the date, customer email, amount, decline reason and a link to the payment in Stripe.

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

Failed payments are easy to miss. Stripe retries subscriptions on its own schedule and sends its own emails, but nobody on the team sees a list of who failed and why until revenue at the end of the month is lower than expected.

With this automation, every failed payment becomes a row in a sheet the moment it happens, with Stripe's decline reason in plain words and a link to open the payment in Stripe.

SaaS founders, membership sites and support teams use the sheet as a follow-up list: contact the customer, note the outcome in the next column, and see recovery rates over time.

What you get out of it

  • A follow-up list that builds itself

    Every failure is recorded with the customer's email, so someone can reach out the same day rather than at month end.

  • Decline reasons in plain words

    Codes such as insufficient_funds or expired_card tell you whether to send a card update link or wait for a retry.

  • One click to the payment

    The Stripe link on each row opens the exact payment for refunds, retries or notes.

  • Signature checked

    Only events signed by your Stripe account are accepted, so the sheet cannot be filled with fake rows.

  • Trends you can chart

    With months of failures in one tab, it is easy to see whether a card network or region causes more problems.

How it works

What happens, step by step

  1. You add a ClickRuntime trigger link as a webhook in Stripe for failed payments.

  2. When a payment fails, Stripe sends the event and ClickRuntime checks its signature.

  3. The customer's email, the amount, Stripe's decline code and message are read from the event.

  4. A row with a direct link to the payment is added to your Failed payments tab.

Before it runs live

  • Connect your Google Sheets account and pick the spreadsheets it may use
  • Connect Stripe
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Log failed Stripe payments to Google Sheetsjust nowSucceeded
Google Sheets · Billing › Failed payments2026-11-10 | anna@brightlabs.io | 49.00 USD | insufficient_funds | Your card has insufficient funds. | dashboard.stripe.com/payments/pi_3Qx…

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 Google Sheets and 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.
log_failed_stripe_payments_to_google_sheets.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from datetime import datetime, timezone
from clickruntime import on_event, credentials, verify, state

SHEET_ID = "your-spreadsheet-id"

@on_event
def handle(event):
    if not verify.stripe(event.body, event.header("Stripe-Signature"), credentials.secret("STRIPE_WEBHOOK_SECRET")):
        return {"ignored": "bad signature"}
    if state.get(f"seen:{event.json['id']}"):
        return {"duplicate": True}
    pi = event.json["data"]["object"]
    err = pi.get("last_payment_error") or {}
    email = pi.get("receipt_email") or (err.get("payment_method") or {}).get("billing_details", {}).get("email") or ""
    row = [datetime.fromtimestamp(pi["created"], timezone.utc).date().isoformat(), email,
           pi["amount"] / 100, pi["currency"].upper(), err.get("decline_code") or err.get("code") or "",
           err.get("message") or "", pi.get("customer") or "", f"https://dashboard.stripe.com/payments/{pi['id']}"]
    build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False) \
        .spreadsheets().values().append(spreadsheetId=SHEET_ID, range="Failed payments!A:H",
                                        valueInputOption="USER_ENTERED", body={"values": [row]}).execute()
    state.set(f"seen:{event.json['id']}", True)
    return {"logged": pi["id"]}

FAQ

Common questions

Which Stripe event should I select?
payment_intent.payment_failed covers card payments, Checkout and subscription invoices, because they all run through payment intents. Selecting only that event keeps the log free of noise.
Will a retried payment show up twice?
Each failed attempt is its own event, so a subscription that fails three times gets three rows. That is useful for seeing which customers keep failing; filter by customer ID to group them.
Can it email the customer too?
Yes. Ask your assistant to add a short email to the customer with a link to update their card, or a daily email to you listing the day's failures.
What permissions does it need?
Stripe webhook signing secret; Google Sheets read+write. 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 “Log failed Stripe payments to Google Sheets” from your assistant

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