Skip to content

Every 15 minutes

Get an email when a payment fails or is cancelled

A failed or cancelled Mercury transaction reaches you within about 15 minutes, with the amount and counterparty.

Runs
Every 15 minutes
Apps
Mercury
AI
Not needed
Access
read-only token

Send this to your assistant

Create a ClickRuntime automation: every 15 minutes, check Mercury for transactions marked failed or cancelled and email me the counterparty, amount and date of each new one.

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 failed payment at a business bank is easy to miss. A vendor ACH that bounced because of a wrong routing number, a card payment declined for a subscription you rely on or a wire that was cancelled all show up as a status in a transaction list that nobody checks. The result is a supplier who thinks you did not pay, a service that gets switched off or a payroll contractor waiting for money that never left.

Every 15 minutes, ClickRuntime lists your recent Mercury transactions, filters for those with a failed or cancelled status, and sends an alert for any it has not reported before. Successful payments are ignored, so you hear only when something goes wrong.

It is meant for founders, finance leads and bookkeepers who want to know about a problem the same day.

What you get out of it

  • Suppliers are paid on time

    When a payment fails, you can fix the details and resend it the same day. A short delay is easier to explain than a late fee or a damaged relationship with an important vendor.

  • Critical services stay on

    A declined card for hosting or software can lead to a suspended account. Hearing about it within 15 minutes gives you time to update the payment method before anything goes offline.

  • Contractors and staff are not left waiting

    A failed payout to a freelancer means a person who is counting on that money. Quick notice lets you resolve it before they have to chase you for it. A prompt apology and a resend keeps their trust.

  • No daily bank check required

    Opening the banking portal each morning to scan statuses takes time and is easy to forget. The alert does that work and speaks up only when something fails. Someone who is already busy no longer has to remember to look, because a quiet inbox simply means nothing failed.

  • Clear record of problems

    Each alert shows what failed and when, which helps your accountant understand why a payment appears twice or why a vendor was paid late. Each alert names the payment, so your accountant can later explain a late or repeated payment without guessing.

  • Fewer awkward calls from vendors

    Nothing is more uncomfortable than a supplier asking where their money is. Fixing a failed payment before they notice keeps those relationships friendly and professional, and it keeps your reputation as a reliable payer intact.

How it works

What happens, step by step

  1. Every 15 minutes, ClickRuntime checks your Mercury accounts for transactions that failed or were cancelled.

  2. It skips any it has already told you about.

  3. You get one email listing each new problem with its date, counterparty, amount and status.

Before it runs live

  • Connect Mercury

What you get

RunsEvery 15 minutes
Get an email when a payment fails or is cancelledtoday, 9:00Succeeded
Email · Failed transactions1 Mercury transaction(s) failed or cancelled 2026-10-18 Northwind Logistics $3,250.00 failed

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 Mercury 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_transaction_alert.pyexample
from clickruntime import on_trigger, credentials, http, state, notify, report_fetched

API = "https://api.mercury.com/api/v1"

@on_trigger
def run(event):
    h = {"Authorization": f"Bearer {credentials.secret('MERCURY_TOKEN')}"}
    alerted = set(state.get("alerted") or [])
    bad = []
    for acct in http.get(f"{API}/accounts", headers=h).json()["accounts"]:
        for t in http.get(f"{API}/account/{acct['id']}/transactions", headers=h, params={"limit": 100}).json()["transactions"]:
            if t["status"] in ("failed", "cancelled") and t["id"] not in alerted:
                bad.append(t)
    report_fetched(len(bad))
    if not bad:
        return {"new": 0}
    notify.email_me(f"{len(bad)} Mercury transaction(s) failed or cancelled",
                    "\n".join(f"{t['createdAt'][:10]}  {t['counterpartyName']}  ${abs(t['amount']):,.2f}  {t['status']}" for t in bad))
    state.set("alerted", sorted(alerted | {t["id"] for t in bad})[-500:])
    return {"new": len(bad)}

FAQ

Common questions

Which statuses count as failed?
The check looks at transactions that Mercury reports as failed or cancelled. Pending transactions are left alone until their status changes, and completed ones are not included in the alert. That way you only hear about real problems that need attention. Cancelled payments are included because they often mean a payment needs to be set up again.
Will I get the same alert more than once?
No. Each transaction is remembered after it is reported, so you get one alert per failure even though the check runs every 15 minutes. A new failure will trigger its own alert. This holds even if the bank takes a while to update the transaction.
Does it need access to move money?
No. It only reads transactions, using a read-only Mercury API token. It cannot send payments or change anything in your account, and ClickRuntime holds the token as a secret. Anyone who sees the token cannot move your funds either, which keeps the setup low risk.
What permissions does it need?
read-only token. 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 checks. Checks that find nothing new 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 an email when a payment fails or is cancelled” from your assistant

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