Skip to content

The moment it happens

Tag orders when your delivery service updates

When your delivery service reports a status, the matching order gets a tag like delivered.

Runs
The moment it happens
Apps
Shopify
AI
Not needed
Access
write_orders

Send this to your assistant

Create a ClickRuntime automation: give me a link my delivery app can send updates to. When it reports a status, add a matching tag like delivered or delayed to the Shopify order.

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

Shopify knows when an order was fulfilled, but it has no idea whether the parcel reached the customer. Carriers and local delivery services know, and they report events such as out for delivery, delivered, failed attempt or returned to sender. Support staff then check a separate tracking site for every complaint, and operations cannot filter Shopify orders to see which ones are stuck. A customer asks where their package is, and the agent has to go and find out.

Whenever your delivery service sends a status event, ClickRuntime receives it, finds the matching Shopify order by its reference and adds a tag such as delivered, failed-delivery or returned. Because Shopify lets you filter the Orders list by tag, the status becomes searchable right inside the admin where your team already works.

It is a good fit for stores using a local courier or a delivery platform that supports webhooks.

What you get out of it

  • Support answers without leaving Shopify

    A customer writes in, the agent opens the order and sees a failed-delivery tag. The answer is one click away instead of a trip to a courier portal and a copied tracking number.

  • Problem deliveries can be listed at once

    Filtering orders by a failed-delivery tag gives a full list of parcels needing a call or a re-send, so the team works through them in a batch rather than as scattered complaints.

  • Customers are contacted proactively

    Tagged failures let you reach out before the customer complains, with a new delivery date or a refund offer, which turns a bad experience into evidence that you pay attention.

  • Delivered orders are provably closed

    A delivered tag with the event time supports disputes. When a buyer claims a parcel never arrived, you have a recorded carrier confirmation attached to the order, with a timestamp.

  • Other automations can build on tags

    Once orders carry a delivery tag, other rules can use it, such as asking for a review three days after delivery or flagging orders that stay out for delivery too long.

How it works

What happens, step by step

  1. When your delivery service reports a status update, ClickRuntime receives it straight away.

  2. It finds the matching Shopify order.

  3. A tag such as delivered or delayed is added to the order.

Before it runs live

  • Connect Shopify
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Tag orders when your delivery service updatesjust nowSucceeded
Shopify · Order #1048Tag added: delayed

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
  • 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 Shopify 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.
tag_orders_from_delivery_events.pyexample
from clickruntime import on_event, credentials, http, log

STORE = "your-store.myshopify.com"

def gql(query, variables=None):
    resp = http.post(f"https://{STORE}/admin/api/2025-07/graphql.json",
                     headers={"X-Shopify-Access-Token": credentials.connection("shopify", "store")},
                     json={"query": query, "variables": variables or {}})
    resp.raise_for_status()
    return resp.json()["data"]

TAGS = {"delivered": "delivered", "delayed": "delayed", "exception": "delivery-issue", "out_for_delivery": "out-for-delivery"}

@on_event
def handle(event):
    update = event.json or {}
    tag = TAGS.get(update.get("status"))
    if not tag:
        return {"tagged": False}
    orders = gql("query($q: String!) { orders(first: 1, query: $q) { nodes { id } } }",
                 {"q": f"name:{update['order_number']}"})["orders"]["nodes"]
    if not orders:
        log.warning("order not found", {"order": update.get("order_number")})
        return {"tagged": False}
    gql("mutation($id: ID!, $tags: [String!]!) { tagsAdd(id: $id, tags: $tags) { userErrors { message } } }",
        {"id": orders[0]["id"], "tags": [tag]})
    return {"tagged": True, "tag": tag}

FAQ

Common questions

How does it find the right order?
It matches on a reference your delivery service returns, usually the Shopify order number or ID passed when the shipment was created. If the service sends a different reference, the match can use that field, as long as it is stored on the order.
What happens if the event is for an unknown order?
If no Shopify order matches, nothing is tagged and the event is recorded in the run log. You can then look at the logged payload to see whether the courier sent a different number or the order belonged to another store.
Does adding a new tag remove the old one?
By default a new status is added alongside earlier tags, which keeps a visible history such as out-for-delivery then delivered. If you prefer only the latest status, the old status tag can be removed each time a new one arrives.
What permissions does it need?
write_orders. 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 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 “Tag orders when your delivery service updates” from your assistant

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