Skip to content

Daily

Hear when daily sales look unusual

You get an email on mornings when yesterday's sales were far above or below normal.

Runs
Daily
Apps
QuickBooks
AI
Not needed
Access
read

Send this to your assistant

Create a ClickRuntime automation: every morning at 7am, total yesterday's QuickBooks invoices and sales receipts, compare it with the 30-day average, and email me if it differs by more than 30%.

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

A normal Tuesday brings in about $4,000 of invoices and cash sales. On the Tuesday the website checkout breaks or a big client orders three times as much, nobody notices until the monthly report, because daily totals are not something anyone watches in QuickBooks. Both a collapse and a spike deserve a same-day look.

Each morning, ClickRuntime totals yesterday's invoices and sales receipts from QuickBooks, compares the figure with the daily totals it has stored over recent weeks, and emails you only if yesterday falls outside the normal band. On ordinary days you hear nothing, so an email means something unusual happened.

Retailers, subscription sellers and any business with steady daily volume benefit most, since deviation is easy to define when the baseline is stable, and who cannot afford to learn about a bad day from the monthly close.

What you get out of it

  • Broken checkout flows are found fast

    A sudden drop in sales often means a payment page, a form or a store integration stopped working. Seeing it the next morning limits the loss to a day instead of a month of missed orders.

  • Big wins get acknowledged

    An unusually high day might be a large client order or a promotion landing. Knowing it happened lets you thank the customer, check stock and make sure fulfillment keeps up.

  • Suspicious entries get a look

    A spike can also come from a duplicate import or a mistaken entry. Spotting it early means correcting the books before they are used in a report, a tax calculation or a bank discussion.

  • Silence means normal

    You are only emailed on exceptions, so there is no daily report to skim and ignore. The alert keeps its value because it only appears when the numbers deserve attention. Alerts you only see when needed get read.

  • The baseline builds from your own history

    Comparison uses totals the automation has stored from previous days, so a business with high weekday volume and quiet weekends is judged against itself, not against a generic number. A quiet shop and a busy one each get judged fairly.

How it works

What happens, step by step

  1. Every morning, ClickRuntime adds up yesterday's invoices and sales receipts in QuickBooks.

  2. It compares the total with the average of the last 30 days, which it keeps up to date each run.

  3. If yesterday was more than 30% above or below normal, you get an email with the total, the average and the difference. On a normal day nothing is sent.

Before it runs live

  • Connect QuickBooks

What you get

RunsDaily
Hear when daily sales look unusualtoday, 9:00Succeeded
Email · Unusual sales dayInvoices + sales receipts: $1,140.00 30-day average: $3,820.00 Difference: -70%

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 QuickBooks 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_sales_anomaly_alert.pyexample
from datetime import date, timedelta
from clickruntime import on_trigger, credentials, http, state, notify

REALM_ID = "1234567890"
API = f"https://quickbooks.api.intuit.com/v3/company/{REALM_ID}"

def qb(method, path, **kw):
    headers = {"Authorization": f"Bearer {credentials.connection('quickbooks', 'company')}", "Accept": "application/json"}
    resp = http.request(method, f"{API}{path}", headers=headers, params={"minorversion": 73, **kw.pop("params", {})}, **kw)
    resp.raise_for_status()
    return resp.json()

def query(sql):
    return qb("GET", "/query", params={"query": sql})["QueryResponse"]

@on_trigger
def run(event):
    day = (date.today() - timedelta(days=1)).isoformat()
    invoices = query(f"select * from Invoice where TxnDate = '{day}'").get("Invoice", [])
    receipts = query(f"select * from SalesReceipt where TxnDate = '{day}'").get("SalesReceipt", [])
    total = sum(i["TotalAmt"] for i in invoices) + sum(r["TotalAmt"] for r in receipts)
    history = state.get("history") or []
    average = sum(history) / len(history) if history else None
    state.set("history", (history + [total])[-30:])
    if average and abs(total - average) / average > 0.3:
        notify.email_me(f"Unusual sales day: ${total:,.2f} on {day}",
                        f"Invoices + sales receipts: ${total:,.2f}\n30-day average: ${average:,.2f}\n"
                        f"Difference: {(total - average) / average:+.0%}")
    return {"total": total, "average": average}

FAQ

Common questions

How does it decide that a day is unusual?
It keeps a record of recent daily totals and flags a day that falls outside a band around the typical figure, such as more than a set percentage above or below the average. You choose how wide that band is.
Are weekends and holidays handled differently?
They can be. A shop that does nothing on Sundays would alert every Monday if all days were treated alike. Comparing each day with the same weekday in previous weeks avoids that, and you can tell the setup which days to skip.
Does it include refunds and credit memos?
The total is built from invoices and sales receipts. Refund receipts and credit memos are separate transaction types in QuickBooks and can be subtracted if you want net sales rather than gross. Say which you prefer.
What permissions does it need?
read. 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 “Hear when daily sales look unusual” from your assistant

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