Skip to content

On a schedule

Post overdue Xero invoices to Slack every weekday

Every weekday morning, your finance channel sees unpaid Xero invoices grouped by how late they are, with totals for each group.

Runs
On a schedule
Apps
Slack, Xero
AI
Not needed
Access
accounting.transactions.read; chat:write

Send this to your assistant

Create a ClickRuntime automation: each weekday at 9am, pull unpaid Xero invoices, group them into 1–7, 8–30 and 30+ days overdue, and post the list to #finance.

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

The aged receivables report in Xero is useful, but only to people who open it. In most small companies that's one person, and when they're on holiday nobody looks.

A short list in Slack each weekday puts overdue invoices in front of the whole finance team and account managers, grouped so the oldest debts stand out.

What you get out of it

  • Overdue invoices stay visible

    The list appears every weekday, so late payments can't drift unnoticed.

  • Oldest debts stand out

    Grouping by age shows where to spend chasing time first.

  • Account managers can help

    People who know the client see who's late and can raise it in their next conversation.

  • No Xero login needed

    Anyone in the channel can follow collections without access to the books.

How it works

What happens, step by step

  1. Each weekday at 9am, ClickRuntime asks Xero for approved sales invoices with money still owed.

  2. It keeps the ones past their due date and groups them into 1–7, 8–30 and over 30 days late.

  3. It posts each group, with customer names, amounts and a total, to #finance in Slack.

Before it runs live

  • Connect Slack, then invite the app to the channel (type /invite @ClickRuntime there)
  • Connect Xero

What you get

RunsOn a schedule
Post overdue Xero invoices to Slack every weekdaytoday, 9:00Succeeded
Slack · #finance8–30 days – 2,640.00 • Acme Ltd INV-0412: 1,800.00 • Northwind Ltd INV-0418: 840.00

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 Google Sheets
  • Combine it with other Slack and 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_xero_invoices_alert_in_slack.pyexample
from datetime import date
from clickruntime import on_trigger, credentials, http, notify
XERO = "https://api.xero.com/api.xro/2.0"
TENANT = "your-xero-tenant-id"

def xero(method, path, **kw):
    r = http.request(method, XERO + path, **kw, headers={"Accept": "application/json", "Xero-tenant-id": TENANT, "Authorization": "Bearer " + credentials.connection("xero", "company")})
    return r.raise_for_status() or r.json()

@on_trigger
def run(event):
    invoices = xero("GET", "/Invoices", params={"Statuses": "AUTHORISED", "where": 'Type=="ACCREC"'})["Invoices"]
    groups = {"1–7 days": [], "8–30 days": [], "30+ days": []}
    for inv in invoices:
        days = (date.today() - date.fromisoformat(inv["DueDateString"][:10])).days
        if days > 0 and inv["AmountDue"] > 0:
            groups["1–7 days" if days <= 7 else "8–30 days" if days <= 30 else "30+ days"].append(inv)
    lines = []
    for name, items in groups.items():
        if items:
            lines.append(f"*{name}* – {sum(i['AmountDue'] for i in items):,.2f}")
            lines += [f"• {i['Contact']['Name']} {i['InvoiceNumber']}: {i['AmountDue']:,.2f}" for i in items]
    notify.slack("\n".join(lines) or "No overdue invoices today :tada:", channel="#finance")
    return {k: len(v) for k, v in groups.items()}

FAQ

Common questions

Which invoices are included?
Approved sales invoices with an amount still due and a due date in the past.
Is it the same as Xero's aged receivables report?
It uses the same invoices, grouped by days past the due date, but in a short list rather than a full report.
What if nothing is overdue?
A one-line message says so, which is worth seeing too.
What permissions does it need?
accounting.transactions.read; chat: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 (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 “Post overdue Xero invoices to Slack every weekday” from your assistant

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