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.
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
Every 15 minutes, ClickRuntime looks for new Zendesk tickets it has not seen before.
AI reads each one and decides whether it is about a payment, and if so pulls out the order number.
The order is looked up in your Payments sheet to see whether it failed or was charged twice.
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
Build your own
Need it to work differently?
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
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?
What if the order is not in the sheet?
Does it change the payment sheet?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Draft replies to new Zendesk tickets and log them
Each new ticket gets a suggested reply as a private note, and every suggestion is logged in a sheet so you can see how often it was used.
See how it worksTurn support emails into Zendesk tickets and log them
Support emails arriving in Gmail become Zendesk tickets with a category, and each one is logged in a sheet.
See how it worksLog daily support numbers and churn signals to a sheet
Every day a row of ticket numbers goes into your metrics sheet, along with any customers whose tickets hint they might leave.
See how it worksKeep exploring
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.