Skip to content

Daily

Start the day with your delivery status counts

Each morning you see how many trackings are delivered, in transit or in exception.

Runs
Daily
Apps
AfterShip
AI
Not needed
Access
API key

Send this to your assistant

Create a ClickRuntime automation: every morning at 7am, count my AfterShip trackings updated in the last day by status and email me the totals, listing any in Exception.

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

Customer service teams of online shops that ship through many carriers use AfterShip to track parcels, but opening the dashboard each morning to see where everything stands is a chore. Packages sit in exception, such as a failed delivery attempt or an address problem, and no one sees them until the customer writes in. By then the parcel may be on its way back to the warehouse and the customer is angry.

Every day, the automation lists the trackings that were updated, groups them by tag (for example Delivered, InTransit, AttemptFail and Exception) and emails you the counts with the details of the problem ones. You see the state of all shipments in a single email.

It works for e-commerce support teams, fulfillment managers and anyone who answers the question where is my order every day.

What you get out of it

  • Support answers the question before it is asked

    With a list of exceptions each morning, your team can email customers about delays proactively. Fewer where-is-my-order tickets arrive, and the ones that do are easier to answer. Even a short apology and a new estimate keep the customer on your side.

  • Problem parcels are spotted while they can be saved

    A failed delivery attempt can often be resolved with a call to the carrier or a corrected address. Waiting until the parcel is returned makes it an expensive reshipment. A phone call to the carrier on the day of the failure often fixes what a returned parcel cannot.

  • Carrier performance becomes clear

    Counts of delivered, in-transit and exception parcels over several weeks show which carriers are reliable. Those numbers support conversations about switching or renegotiating. Those figures give you a factual basis to renegotiate rates or move volume to a better carrier.

  • Managers see volume at a glance

    The totals show how many parcels are in flight, which helps staffing in support and warehouse teams during peak season. It also shows when peak-season volume is building up before the queue reaches your support inbox.

  • A daily record for disputes

    If a customer claims a parcel never arrived, you have a dated record of its status from the carrier, useful in claims and chargeback responses. Dated carrier statuses help when you file an insurance claim.

How it works

What happens, step by step

  1. Every morning, ClickRuntime looks at every AfterShip tracking updated in the last day.

  2. It counts how many are delivered, in transit, out for delivery or in exception.

  3. You get an email with those counts, followed by the tracking number and order of each parcel in exception.

Before it runs live

  • Connect AfterShip

What you get

RunsDaily
Start the day with your delivery status countstoday, 9:00Succeeded
Email · Delivery statusDelivered: 64 · InTransit: 41 · OutForDelivery: 12 · Exception: 2 Exceptions: 1Z999AA10123456784 (ups) order #10388

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 AfterShip 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.
daily_delivery_status_digest.pyexample
from collections import Counter
from datetime import datetime, timedelta, timezone
from clickruntime import on_trigger, credentials, http, notify

@on_trigger
def run(event):
    since = (datetime.now(timezone.utc) - timedelta(days=1)).strftime("%Y-%m-%dT%H:%M:%SZ")
    trackings = http.get("https://api.aftership.com/tracking/2024-04/trackings",
                         headers={"as-api-key": credentials.secret("AFTERSHIP_API_KEY")},
                         params={"updated_at_min": since, "limit": 200}).json()["data"]["trackings"]
    counts = Counter(t["tag"] for t in trackings)
    exceptions = [f"• {t['tracking_number']} ({t['slug']}) order {t.get('order_id') or '-'}"
                  for t in trackings if t["tag"] == "Exception"]
    body = "\n".join(f"{tag}: {n}" for tag, n in counts.most_common())
    if exceptions:
        body += "\n\nExceptions:\n" + "\n".join(exceptions)
    notify.email_me(f"Deliveries: {len(trackings)} updated in the last day", body)
    return dict(counts)

FAQ

Common questions

Which AfterShip tags are included?
The digest groups by the status tag AfterShip assigns, such as InfoReceived, InTransit, OutForDelivery, AttemptFail, Delivered, AvailableForPickup, Exception and Expired. You can choose which ones to list in detail. Delayed and returned-to-sender parcels can be listed separately in the same email.
Does it include trackings from every carrier?
It covers trackings in your AfterShip account that were updated during the period, whatever the carrier. If you want to split the digest by carrier or by store, your AI assistant can group it that way.
How does it decide what updated today?
It lists trackings changed since the previous run, so a parcel that has not moved is not repeated. This keeps the email short even if you have thousands of open shipments. Parcels that stay in one state are reported when they first enter it.
What permissions does it need?
API key. 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 “Start the day with your delivery status counts” from your assistant

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