Skip to content

Daily

Make follow-up coupons for unfinished orders

Each evening, customers with pending orders get a unique coupon and you get the list to follow up.

Runs
Daily
Apps
WooCommerce
AI
Not needed
Access
read+write

Send this to your assistant

Create a ClickRuntime automation: every evening at 7pm, find WooCommerce orders left pending for more than 2 hours, create a single-use 10% coupon for each customer, and email me the names, emails and codes.

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

In a WooCommerce shop many customers get as far as checkout, then leave. Some orders sit as pending or failed, because the card was declined or the person got distracted. Each is a customer who wanted the product. Without follow-up that money is gone, and writing to each person by hand with a custom discount is more admin than a small shop can keep up with.

Each day the automation lists orders still in a pending or failed status, skips any it has already handled, creates a unique coupon code for each one in WooCommerce, and emails you the list with the customer's details and the code. You then send a short personal note offering the discount.

It fits shops with fewer than a few dozen incomplete checkouts a day, where a personal message still pays.

What you get out of it

  • Recover sales that were nearly made

    These customers already chose products and entered details. A small incentive and a nudge convert a share of them, which is cheaper than winning a new buyer through ads. Even a modest recovery rate adds up over a month.

  • Unique codes prevent leaks

    Each coupon is unique to one customer, so it cannot be shared on a deal site. You give the discount only to the person who earned it. Without that, a code posted on a coupon site can eat margin on sales that would have happened anyway.

  • One list instead of hunting through orders

    The email collects everyone to contact in one place, so following up takes minutes rather than scanning the order list for failed payments. That alone can save a quarter of an hour each day for a small team with several other jobs.

  • No repeat contact

    Orders already handled are skipped on later runs, so a customer does not receive three coupons for the same abandoned order. Otherwise the same unfinished order could be flagged day after day, and the customer would be written to repeatedly.

  • Learn why people drop off

    If many failed orders share a payment method or a shipping country, you spot a real problem to fix, rather than just a discount to offer. A shared cause is more valuable than any single recovered sale, since fixing it helps every future buyer.

How it works

What happens, step by step

  1. Once a day, ClickRuntime looks in WooCommerce for orders left pending or failed for more than two hours.

  2. It skips any order it has already made a coupon for.

  3. For each new one it creates a single-use 10% coupon that only works for that customer's email address.

  4. You get an email listing each customer and their coupon code, ready to send in a follow-up.

Before it runs live

  • Connect WooCommerce

What you get

RunsDaily
Make follow-up coupons for unfinished orderstoday, 9:00Succeeded
Email · Abandoned-order coupons- Dana Fox <dana@acme.example>: COMEBACK-3F9A1C

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

  • Run it at a different time, more or less often, or only on weekdays
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other 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.
abandoned_cart_coupons.pyexample
import secrets
from datetime import datetime, timedelta, timezone
from clickruntime import on_trigger, credentials, http, state, notify

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

@on_trigger
def run(event):
    auth = (credentials.secret("WC_CONSUMER_KEY"), credentials.secret("WC_CONSUMER_SECRET"))
    cutoff = (datetime.now(timezone.utc) - timedelta(hours=2)).strftime("%Y-%m-%dT%H:%M:%S")
    orders = http.get(f"{STORE}/orders", auth=auth,
                      params={"status": "pending,failed", "before": cutoff, "per_page": 100}).json()
    handled = set(state.get("handled") or [])
    lines = []
    for o in orders:
        email = o["billing"]["email"]
        if o["id"] in handled or not email:
            continue
        code = f"COMEBACK-{secrets.token_hex(3).upper()}"
        http.post(f"{STORE}/coupons", auth=auth, json={
            "code": code, "discount_type": "percent", "amount": "10",
            "usage_limit": 1, "email_restrictions": [email]}).raise_for_status()
        lines.append(f"- {o['billing']['first_name']} {o['billing']['last_name']} <{email}>: {code}")
        handled.add(o["id"])
    state.set("handled", sorted(handled)[-1000:])
    if lines:
        notify.email_me(f"{len(lines)} abandoned-order coupons created", "\n".join(lines))
    return {"coupons": len(lines)}

FAQ

Common questions

Does it email the customer automatically?
No. It creates the coupons and emails you the list so you can decide whom to contact and what to say. That keeps tone personal and avoids sending discounts to people with a genuinely failed fraud check.
What discount value does the coupon carry?
Whatever you choose, such as ten percent or a fixed amount, with an expiry date and usage limit of one. Tell your AI assistant the terms you want and they will be shown for approval first.
Which orders count as abandoned?
Orders whose status is pending payment or failed. Orders cancelled by the customer, or on hold for a bank transfer, are different statuses, so ask for them to be included if you want them in the list.
What permissions does it need?
read+write. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (daily). Checks that find nothing to do 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 “Make follow-up coupons for unfinished orders” from your assistant

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