Skip to content

On a schedule

Get overdue invoices in Slack by age

Each morning Slack lists invoices overdue by 7, 14 and 30 days, without repeating ones already flagged at that stage.

Runs
On a schedule
Apps
Xero
AI
Not needed
Access
accounting.transactions.read

Send this to your assistant

Create a ClickRuntime automation: every day at 8am, post Xero sales invoices that are overdue to #accounts in Slack, grouped into 7, 14 and 30 days late.

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

Chasing late payers is an unpleasant job that most people put off. A customer invoice reaches 7 days overdue and nobody notices, then 14 days, then 30, and by then the polite email is now a hard conversation. Meanwhile the invoices at each stage need different actions, and nobody keeps track of which have already had a reminder.

Each morning, the automation gets all authorised invoices where an amount is still due, works out how many days each is late, and picks out those crossing the 7, 14 and 30 day thresholds. Invoices already announced at a given tier are skipped, and the rest go into a Slack post.

It is useful for credit controllers and small teams where one person doubles as finance and sales. Collections become a short daily routine in place of an occasional dreaded project.

What you get out of it

  • Reminders go out at the right moment

    A 7-day nudge is friendly and a 30-day one is firmer. Seeing which tier each invoice reaches tells you which tone and which action fits that customer. Matching tone to age keeps good customers happy and gives slow ones a clear signal.

  • Nothing is announced twice

    Remembering which invoices have been alerted at each threshold means the channel shows a customer only when they cross a new tier, rather than repeating the same line daily. A tidy channel means people keep reading it instead of tuning it out.

  • Cash flow improves with consistency

    Chasing every invoice at the same point in its life tends to shorten the average time to payment, which keeps working capital from being tied up with slow payers. Faster collection means less borrowing and less stress about covering your own bills.

  • The morning list is short and actionable

    Instead of a long aged debtors report, you read a few names and amounts that crossed a line overnight, and can start the day with three phone calls. Short lists get done, while long reports get postponed until something goes wrong.

  • Escalation becomes a shared process

    The team sees the same tiers, so a sales rep knows to step in when a key customer reaches 30 days, rather than hearing about it from finance after the fact.

How it works

What happens, step by step

  1. Every morning at 8, ClickRuntime pulls the approved Xero invoices that still have money owing.

  2. It works out how many days late each one is and groups them into 7, 14 and 30 days overdue.

  3. It skips any invoice already flagged at that stage, so you only hear about it again when it moves into the next group.

  4. The grouped list goes to your Slack channel with the invoice number, customer, amount and days late.

Before it runs live

  • Connect Xero

What you get

RunsOn a schedule
Get overdue invoices in Slack by agetoday, 9:00Succeeded
Slack · #accounts*14+ days late* INV-0412 Northwind Traders: 2,350.00 (17 days) INV-0418 Acme Ltd: 980.00 (15 days)

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

API = "https://api.xero.com/api.xro/2.0"

def xero_headers():
    token = credentials.connection("xero", "work")
    tenant = http.get("https://api.xero.com/connections", headers={"Authorization": f"Bearer {token}"}).json()[0]["tenantId"]
    return {"Authorization": f"Bearer {token}", "xero-tenant-id": tenant, "Accept": "application/json"}

@on_trigger
def run(event):
    params = {"Statuses": "AUTHORISED", "where": 'Type=="ACCREC" AND AmountDue>0'}
    invoices = http.get(f"{API}/Invoices", headers=xero_headers(), params=params).json()["Invoices"]
    alerted = state.get("alerted") or {}
    tiers = {30: [], 14: [], 7: []}
    for inv in invoices:
        late = (date.today() - date.fromisoformat(inv["DueDateString"][:10])).days
        tier = next((t for t in tiers if late >= t), None)
        if tier and alerted.get(inv["InvoiceID"], 0) < tier:
            tiers[tier].append(f"{inv['InvoiceNumber']} {inv['Contact']['Name']}: {inv['AmountDue']:,.2f} ({late} days)")
            alerted[inv["InvoiceID"]] = tier
    lines = [f"*{t}+ days late*\n" + "\n".join(rows) for t, rows in tiers.items() if rows]
    if lines:
        notify.slack("Overdue invoices\n" + "\n".join(lines), channel="#accounts")
    state.set("alerted", alerted)
    return {"posted": sum(len(r) for r in tiers.values())}

FAQ

Common questions

Can I change the 7, 14 and 30 day thresholds?
Yes. They are just numbers in the logic, so you can use 3, 10 and 45, or add a 60-day tier. Tell your AI assistant to set the days that match your payment terms and approve the change.
Does it count days from the due date or the invoice date?
It counts from the due date, which is when the customer was meant to pay. An invoice on 30-day terms is not overdue at day 30 from issue, only after the due date passes, and this matches how most credit teams work.
What about invoices with partial payments?
It uses the amount still due. A part-paid invoice stays in the list with its remaining balance, so you are chasing only the unpaid portion, and a fully paid invoice drops out immediately. Only the unpaid portion counts toward the overdue amount.
What permissions does it need?
accounting.transactions.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 (on a schedule). 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 “Get overdue invoices in Slack by age” from your assistant

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