Skip to content

Every 15 minutes

Check payment complaints against your payments sheet

Tickets about payments are matched to your payments sheet, and the genuine problems are raised to urgent and flagged in Slack.

Runs
Every 15 minutes
Apps
Google Sheets, Zendesk
AI
Yes, uses the built-in AI allowance
Access
Zendesk agent; sheet viewer

Send this to your assistant

Create a ClickRuntime automation: every 15 minutes, look at new Zendesk tickets. If one is about a payment problem, find the order number and look it up in my Payments sheet. If the payment really failed or was charged twice, set the ticket to urgent and post it to #billing.

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 small subscription company keeps its payment records in a Google Sheet that finance updates from the bank and the payment provider. When a customer writes in about a double charge or a failed payment, the agent has to ask finance to check. Half the time the payment was fine and the customer was looking at a pending authorisation; the other half, a real refund is needed and every hour counts.

Checking each payment complaint against the sheet as it arrives separates the real problems from the false alarms, so billing spends its time on the customers who were actually charged wrongly.

What you get out of it

  • Real problems get handled first

    Genuine double charges and failures go to the top of the queue, while mistaken complaints get a normal answer.

  • Fewer questions to finance

    Agents see the payment status on the ticket instead of messaging finance for every complaint.

  • Billing hears straight away

    Confirmed problems reach the #billing channel within minutes, with the order and amount already looked up.

  • Works with the records you already keep

    The sheet finance maintains stays the source of truth; no new billing system is needed.

How it works

What happens, step by step

  1. Every 15 minutes, ClickRuntime looks for new Zendesk tickets it has not seen before.

  2. AI reads each one and decides whether it is about a payment, and if so pulls out the order number.

  3. The order is looked up in your Payments sheet to see whether it failed or was charged twice.

  4. Confirmed problems are set to urgent with a private note showing the payment row, and posted to your #billing Slack channel.

Before it runs live

  • Connect your Google Sheets account and pick the spreadsheets it may use
  • Connect Zendesk

What you get

RunsEvery 15 minutes
Check payment complaints against your payments sheettoday, 9:00Succeeded
Slack · #billing💳 #9204 order NW-10442 is duplicate (£89.00), Northwind Traders

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
  • Change what the AI looks for, or how it writes the result
  • Add another app, for example also send it to Slack
  • Combine it with other Google Sheets and Zendesk 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.
escalate_payment_issues_checked_against_a_sheet.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, report_fetched, http, credentials, ai, state, notify

ZD, AGENT = "https://yourcompany.zendesk.com/api/v2", "you@yourcompany.com"

def zd(method, path, **kw):
    r = http.request(method, ZD + path, auth=(f"{AGENT}/token", credentials.secret("ZENDESK_API_TOKEN")), **kw)
    return r.raise_for_status() or (r.json() if r.content else None)


sheets = lambda: build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).spreadsheets()
SHEET_ID = "your-spreadsheet-id"

@on_trigger
def run(event):
    seen = set(state.get("seen") or [])
    new = [t for t in zd("GET", "/search.json", params={"query": "type:ticket created>1hours"})["results"] if t["id"] not in seen]
    report_fetched(len(new))
    if not new:
        return {"summary": "No new tickets"}
    rows = {r[0]: r for r in sheets().values().get(spreadsheetId=SHEET_ID, range="Payments!A2:D").execute().get("values", []) if r}
    for t in new:
        res = ai.generate(f"{t['subject']}\n{t['description'][:1500]}", system="Is this about a payment problem? Extract the order number if any.",
                          json_schema={"type": "object", "properties": {"payment": {"type": "boolean"}, "order": {"type": "string"}}},
                          max_output_tokens=40).json
        row = rows.get(res.get("order", ""))
        if res["payment"] and row and row[3].lower() in ("failed", "duplicate"):
            zd("PUT", f"/tickets/{t['id']}", json={"ticket": {"priority": "urgent", "comment": {"body": f"Payments sheet: {', '.join(row)}", "public": False}}})
            notify.slack(f"💳 #{t['id']} order {row[0]} is {row[3]} ({row[2]})", channel="#billing")
        seen.add(t["id"])
    state.set("seen", sorted(seen)[-2000:])
    return {"checked": len(new)}

FAQ

Common questions

How does it find the order number?
AI reads the ticket and pulls out the order or invoice number the customer mentions, then looks for it in the sheet.
What if the order is not in the sheet?
The ticket gets a private note saying no matching payment was found, so the agent knows to ask the customer for more detail.
Does it change the payment sheet?
No. It only reads the sheet. Finance stays in charge of the records.
What permissions does it need?
Zendesk agent; sheet viewer. Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly 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 “Check payment complaints against your payments sheet” from your assistant

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