The moment it happens
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.
- Runs
- The moment it happens
- Apps
- Gmail, WooCommerce
- AI
- Optional
- Access
- Woo read/write; gmail.send
Send this to your assistant
Create a ClickRuntime automation: when my helpdesk sends a refund ticket to this link, find the WooCommerce order by order number or email, add a note to it, send the customer a confirmation email with the order details, and tell #support.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Refund requests arrive as free-text emails: some with an order number, most without. Each one means searching the store, adding a note so the team knows, and writing back to reassure the customer. On a busy week the replies slip, and customers escalate to a chargeback.
Looking up the order and confirming receipt straight away buys time to decide on the refund properly, while the customer knows their request was received.
What you get out of it
Customers hear back immediately
A prompt confirmation with their order details reduces follow-up emails and chargebacks from people who think they were ignored.
The order carries the history
A note on the WooCommerce order shows anyone looking at it that a refund was requested, and when.
Less searching
Staff start with the order already found instead of hunting by email address.
The team sees the queue
A Slack message in #support makes each request visible so it's picked up.
How it works
What happens, step by step
Your helpdesk sends each new refund ticket to your automation's link.
ClickRuntime picks out the order number, or the customer's email address, and finds the order in WooCommerce.
It adds a note to the order saying a refund was requested.
It emails the customer from your Gmail address confirming the request, with the order details.
It posts the request to #support in Slack.
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
import re, base64
from email.message import EmailMessage
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_event, credentials, http, notify
STORE = "https://shop.example.com/wp-json/wc/v3"
@on_event
def handle(event):
t = event.json or {}
email, text = t.get("requester_email", ""), f"{t.get('subject', '')} {t.get('description', '')}"
num = re.search(r"#(\d{3,})", text)
auth = (credentials.secret("WOO_KEY"), credentials.secret("WOO_SECRET"))
orders = http.get(f"{STORE}/orders", auth=auth, params={"include": num.group(1)} if num else {"search": email, "per_page": 1}).json()
if not orders:
notify.slack(f"Refund request from {email}: no order found, please check", channel="#support")
return {"found": False}
o = orders[0]
http.post(f"{STORE}/orders/{o['id']}/notes", auth=auth, json={"note": f"Refund requested via ticket {t.get('id')}"})
items = "\n".join(f"- {li['quantity']} x {li['name']}" for li in o["line_items"])
msg = EmailMessage()
msg["To"], msg["Subject"] = o["billing"]["email"], f"We've received your refund request for order #{o['number']}"
msg.set_content(f"Hi {o['billing']['first_name']},\n\nWe've received your request for order #{o['number']} "
f"placed {o['date_created'][:10]}:\n{items}\n\nWe'll get back to you within 2 working days.")
gmail = build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
gmail.users().messages().send(userId="me", body={"raw": base64.urlsafe_b64encode(msg.as_bytes()).decode()}).execute()
notify.slack(f"Refund request for order #{o['number']} (${o['total']}) confirmed to customer", channel="#support")
return {"found": True, "order": o["number"]}FAQ
Common questions
What does the customer's email say?
Can it read refund requests straight from Gmail?
What if the order can't be found?
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 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.
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 worksEmail suppliers a reorder when stock runs low
When a product drops below 10 units, its supplier gets a reorder email from your Gmail and your team hears about it in Slack.
See how it worksKeep exploring
Set up “Match refund requests to orders and confirm by email” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.