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.
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
Stripe sends each new dispute to your automation's link.
ClickRuntime finds the matching WooCommerce order by the customer's email address.
It searches your Gmail for recent messages with that customer.
AI writes a draft evidence summary from the order and the email extracts.
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
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 Gmail and WooCommerce 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_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?
Which emails does it look at?
What does the Stripe webhook need?
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
Match refund requests to orders and confirm by email
Each refund request is matched to its WooCommerce order, a note is added to the order, and the customer gets a confirmation email with the order details.
See how it worksGet a weekly email on what reviews say about each product
Every Monday you get an email summarising last week's product reviews: the mood for each product, recurring complaints and suggestions to act on.
See how it worksKeep WooCommerce prices in line with your main store
Prices in your WooCommerce store follow your main Shopify store by SKU, and you get an email listing every price that changed.
See how it worksKeep exploring
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.