Skip to content

The moment it happens

Draft chargeback evidence from the order and customer emails

When a chargeback arrives, you get an email with a draft evidence summary built from the WooCommerce order and your Gmail history with the customer.

Runs
The moment it happens
Apps
Gmail, WooCommerce
AI
Yes, uses the built-in AI allowance
Access
Woo read; gmail.readonly

Send this to your assistant

Create a ClickRuntime automation: when Stripe posts a dispute, find the WooCommerce order and my Gmail threads with that customer, and email me a draft dispute response written by AI.

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

Winning a chargeback means proving the customer ordered, received and was told about the product. That proof is split between the store's order record and the email thread where they asked about delivery or thanked you. Gathering it by hand takes an hour per dispute, so many small disputes are simply accepted as losses.

Pulling the order and the email history together the moment a dispute opens, with a first draft of the response, makes it worth contesting the disputes you can win.

What you get out of it

  • Contest more disputes

    When the evidence is gathered for you, fighting a $60 chargeback becomes worth the ten minutes it takes.

  • Meet the deadline

    The draft arrives the day the dispute opens, well inside the response window.

  • Nothing gets missed

    Customer emails confirming delivery or acknowledging terms are found by searching their address, not by memory.

  • A clear, consistent case

    AI organises the facts in the order reviewers expect: what was bought, when it shipped, what the customer said.

How it works

What happens, step by step

  1. Stripe sends each new dispute to your automation's link.

  2. ClickRuntime finds the matching WooCommerce order by the customer's email address.

  3. It searches your Gmail for recent messages with that customer.

  4. AI writes a draft evidence summary from the order and the email extracts.

  5. The draft is emailed to you to review and submit.

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 WooCommerce
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Draft chargeback evidence from the order and customer emailsjust nowSucceeded
Email · Dispute draftDispute evidence draft: buyer@acme.com ($89.00) – Order #10422 delivered 2 Oct; customer confirmed receipt by email on 3 Oct.

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 WooCommerce 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.
build_dispute_evidence_from_orders_and_emails.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_event, credentials, http, notify, ai

STORE = "https://shop.example.com/wp-json/wc/v3"

@on_event
def handle(event):
    dispute = (event.json or {})["data"]["object"]
    email = dispute.get("evidence", {}).get("customer_email_address") or dispute.get("billing_details", {}).get("email", "")
    auth = (credentials.secret("WOO_KEY"), credentials.secret("WOO_SECRET"))
    orders = http.get(f"{STORE}/orders", auth=auth, params={"search": email, "per_page": 3}).json()
    gmail = build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
    ids = gmail.users().messages().list(userId="me", q=f"from:{email} OR to:{email}", maxResults=5).execute().get("messages", [])
    snippets = [gmail.users().messages().get(userId="me", id=m["id"], format="metadata").execute()["snippet"] for m in ids]
    facts = [f"Order #{o['number']} {o['date_created'][:10]} ${o['total']} status {o['status']}: "
             + ", ".join(li["name"] for li in o["line_items"]) for o in orders]
    draft = ai.generate("Draft concise chargeback evidence for reason '" + dispute.get("reason", "") + "' using only these facts.\n"
                        "Orders:\n" + "\n".join(facts) + "\nEmails:\n" + "\n".join(snippets), max_output_tokens=700).text
    notify.email_me(f"Dispute evidence draft: {email} (${dispute['amount'] / 100:.2f})", draft)
    return {"orders": len(orders), "emails": len(snippets)}

FAQ

Common questions

Does it submit the evidence to Stripe?
No. It emails you a draft. You check it, attach documents and submit it yourself.
Which emails does it look at?
Gmail messages from or to the customer's email address, most recent first. Only short extracts are sent to AI.
What does the Stripe webhook need?
In Stripe, add a webhook for charge.dispute.created pointing at your automation's link, and turn on Stripe signature checking in your ClickRuntime dashboard.
What permissions does it need?
Woo read; gmail.readonly. 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 for each event the app sends.
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 “Draft chargeback evidence from the order and customer emails” from your assistant

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