Skip to content

Hourly

Get warned when payments look unusual

You're told when today's payments drop sharply or refunds spike compared with a normal day.

Runs
Hourly
Apps
Stripe
AI
Not needed
Access
read

Send this to your assistant

Create a ClickRuntime automation: every hour, compare today's Stripe charges and refunds with my usual levels for that day of the week, and email me if payments drop by half or refunds double.

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 checkout bug appears after a deploy on a Saturday. Payments quietly drop to a third of the normal rate, and nobody notices until Monday because nothing is technically broken: no errors, no alarms, just fewer orders. The opposite also happens, with a burst of refunds from a product defect or a card-testing attack that floods Stripe with small charges within minutes.

Every hour, ClickRuntime counts today's charges and refunds so far, compares them with the average for the same day of the week stored from previous runs and sends an alert when the figures deviate beyond the threshold you set. Quiet hours still count as normal when your business has quiet periods, because the comparison is against the same day.

It suits shops and SaaS teams that cannot watch Stripe all day but cannot afford a silent outage either.

What you get out of it

  • Silent checkout failures are caught within hours

    A problem that produces no error message shows up as a number that is too low. An hourly check finds it on Saturday afternoon, not Monday, which can save an entire weekend of lost sales.

  • Fraud and card testing surface quickly

    Card testers fire a lot of small charges in a short time, which pushes the count well above normal. An alert gives you time to enable Stripe Radar rules or block the source before fees and disputes pile up.

  • Refund waves are noticed while they can be stopped

    A sudden rise in refunds usually points to a product, shipping or billing problem. Seeing it the same afternoon lets you pause promotions or fix the cause before many more customers are affected.

  • Comparing to the same weekday avoids false alarms

    A Sunday is not a Tuesday. Because the baseline is the average for the same day of the week, normal weekend dips do not trigger alerts, so the ones you do get deserve attention.

  • You gain a record of unusual days

    Each alert notes what was normal and what happened, which gives you a history of incidents. When you review reliability or explain a revenue dip to stakeholders, the evidence is already there.

How it works

What happens, step by step

  1. Every hour, the automation counts today's Stripe charges and refunds so far.

  2. It compares them with what is normal for this day of the week and time of day, based on earlier weeks.

  3. If payments drop sharply or refunds spike, you get an email, such as "charges 11 vs usual 26 by 2pm on a Tuesday".

Before it runs live

  • Connect Stripe

What you get

RunsHourly
Get warned when payments look unusualtoday, 9:00Succeeded
Email · Unusual Stripe activity todaycharges 11 vs usual 26 by 2pm on a Tuesday

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

  • Run it at a different time, more or less often, or only on weekdays
  • 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.
payment_anomaly_alert.pyexample
from datetime import datetime, timezone
import stripe
from clickruntime import on_trigger, credentials, state, notify

@on_trigger
def run(event):
    stripe.api_key = credentials.secret("STRIPE_API_KEY")
    now = datetime.now(timezone.utc)
    start = int(now.replace(hour=0, minute=0, second=0, microsecond=0).timestamp())
    charges = sum(1 for c in stripe.Charge.list(created={"gte": start}, limit=100).auto_paging_iter() if c.paid)
    refunds = sum(1 for _ in stripe.Refund.list(created={"gte": start}, limit=100).auto_paging_iter())
    key = f"{now:%a}-{now.hour}"  # usual counts by this hour on this weekday
    usual = state.get("usual") or {}
    base = usual.get(key)
    alerts = []
    if base and base["charges"] >= 4 and charges < base["charges"] / 2:
        alerts.append(f"charges {charges} vs usual {base['charges']:.0f}")
    if base and refunds >= 2 and refunds > base["refunds"] * 2:
        alerts.append(f"refunds {refunds} vs usual {base['refunds']:.0f}")
    if alerts and state.get("alerted_day") != now.date().isoformat():
        notify.email_me("Unusual Stripe activity today", "\n".join(alerts))
        state.set("alerted_day", now.date().isoformat())
    usual[key] = {"charges": charges if not base else base["charges"] * 0.75 + charges * 0.25,
                  "refunds": refunds if not base else base["refunds"] * 0.75 + refunds * 0.25}
    state.set("usual", usual)
    return {"charges": charges, "refunds": refunds, "alerts": alerts}

FAQ

Common questions

How does it decide that something is unusual?
It keeps a running average per day of the week for charge and refund counts. When the current count deviates from that average by more than the percentage you set, for example 50 percent, it sends an alert. You choose the threshold.
Will it send alerts overnight or during quiet hours?
It runs every hour, so it can alert at any time. Because it compares with the typical figure for that day, a small shop that normally sees no sales at 3 a.m. will not trigger. You can also limit alerts to business hours.
What does the alert message contain?
It shows the current charge and refund counts, the stored average they are compared against, the percentage difference and a link to the Stripe dashboard. That gives you enough to judge in seconds whether to investigate or ignore it.
What permissions does it need?
read. 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 each time it runs (hourly). Checks that find nothing to do and stop right away aren't counted.
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 warned when payments look unusual” from your assistant

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