Skip to content

Every 10 minutes

Email billing about payment tickets as they arrive

New tickets about payments are tagged urgent in Zendesk, and your billing team gets an email about each one straight away.

Runs
Every 10 minutes
Apps
Gmail, Zendesk
AI
Yes, uses the built-in AI allowance
Access
Zendesk read+write; gmail.send

Send this to your assistant

Create a ClickRuntime automation: every 10 minutes, check new Zendesk tickets. If AI says a ticket is about a payment, refund or charge, tag it billing, set it to urgent and email billing@ with the details.

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

At a subscription company, billing questions arrive in the same Zendesk queue as everything else, but the billing team works from email and the payment provider's dashboard, not Zendesk. Payment tickets wait for a support agent to notice them and forward them, and customers who were charged wrongly wait longer than anyone.

Spotting payment tickets as they arrive and emailing billing directly cuts out the hand-off, so money problems are fixed first.

What you get out of it

  • Money problems are handled first

    Charges, refunds and failed payments are marked urgent the moment they arrive.

  • Billing stays in their own tools

    The billing team gets an email with the details and a link, without needing a Zendesk seat.

  • No manual forwarding

    Agents no longer have to notice payment tickets and pass them on.

  • Tagged for reporting

    Every payment ticket carries a billing tag, so you can count them and spot trends such as a rise in failed renewals.

How it works

What happens, step by step

  1. Every 10 minutes, ClickRuntime picks up tickets created or changed in Zendesk since its last check.

  2. AI reads each new ticket and decides whether it is about a payment.

  3. Payment tickets are tagged billing and set to urgent in Zendesk.

  4. An email with the ticket link and the customer's message goes to your billing address from your Gmail.

  5. It remembers where it got up to, so no ticket is escalated twice.

Before it runs live

  • Connect Google through your own Google app (a one-time, 10-minute setup), so it works with your own Gmail
  • Connect Zendesk

What you get

RunsEvery 10 minutes
Email billing about payment tickets as they arrivetoday, 9:00Succeeded
Email · billing@Payment ticket #9417: Charged twice for the Acme Pro annual plan. Customer: finance@acme.example

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 Gmail 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_related_tickets.pyexample
import base64
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, report_fetched, http, credentials, ai, state

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)


def send_gmail(to, subject, text):
    raw = base64.urlsafe_b64encode(f"To: {to}\r\nSubject: {subject}\r\nContent-Type: text/plain; charset=utf-8\r\n\r\n{text}".encode()).decode()
    build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).users().messages().send(userId="me", body={"raw": raw}).execute()

@on_trigger
def run(event):
    seen = set(state.get("seen") or [])
    new = [t for t in (page := zd("GET", "/incremental/tickets/cursor.json", params={"cursor": state.get("cursor")} if state.get("cursor") else {"start_time": 0}))["tickets"]
           if t["id"] not in seen and t["status"] == "new"]
    report_fetched(len(new))
    if not new:
        return {"summary": "No new tickets"}
    for t in new:
        label = ai.generate(f"{t['subject']}\n{t['description'][:1500]}", system="Reply yes if this is about a payment, charge, refund or invoice, else no.",
                            max_output_tokens=3).text.strip().lower()
        if label.startswith("yes"):
            zd("PUT", f"/tickets/{t['id']}", json={"ticket": {"priority": "urgent", "additional_tags": ["billing"]}})
            send_gmail("billing@yourcompany.com", f"Payment ticket #{t['id']}: {t['subject']}",
                       f"https://yourcompany.zendesk.com/agent/tickets/{t['id']}\n\n{t['description'][:1500]}")
        seen.add(t["id"])
    state.set("seen", sorted(seen)[-2000:])
    state.set("cursor", page["after_cursor"])
    return {"checked": len(new)}

FAQ

Common questions

How does it know a ticket is about payments?
AI reads the subject and message and decides whether it is about a charge, refund, invoice or failed payment. Customers describe these in many ways, which is why rules alone miss so many.
Who receives the email?
Whichever address you name, such as a billing team inbox. It is sent from your Gmail.
What does the email contain?
The ticket number and link, the customer, the subject and the first part of their message.
What permissions does it need?
Zendesk read+write; gmail.send. 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 “Email billing about payment tickets as they arrive” from your assistant

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