Skip to content

On a schedule

Get a weekly overdue call list from Xero by email

Every Monday an email lists customers with overdue Xero invoices, largest balance first, with contact name, phone number, invoice count and oldest days late.

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

Send this to your assistant

Create a ClickRuntime automation: every Monday at 8am, email me a call list of Xero customers with overdue invoices, sorted by total overdue, with contact person, phone, number of invoices and how late the oldest one is.

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 payments works best when you start with the customers who owe the most and have been late the longest. Xero's aged receivables report has the numbers but not the phone numbers next to them.

This groups every overdue Xero sales invoice by customer each Monday and emails a ranked list with the contact person and phone number. It is a call sheet you can work through in one sitting.

It suits owners and bookkeepers at small firms who handle credit control themselves and want a short, focused list each week.

What you get out of it

  • Biggest balances first

    Sorting by amount owed puts the calls that matter most at the top. Ten minutes of calls can clear most of the money.

  • Phone number on every line

    No more opening each contact in Xero to find a number. The list is ready to use on your phone.

  • One line per customer

    A customer with several overdue invoices shows up once with the total, so you can raise them all in one conversation.

  • Missing details made visible

    Customers without a phone number in Xero are marked, which nudges you to tidy up contact records.

  • Read-only

    The automation reads invoices and contacts only. Nothing in your books changes.

How it works

What happens, step by step

  1. Every Monday morning ClickRuntime loads all unpaid sales invoices in Xero that are past their due date.

  2. It groups them by customer and adds up what each one owes.

  3. For each customer it looks up the contact person and phone number from Xero.

  4. The list arrives by email, sorted by amount owed, ready to work through by phone.

Before it runs live

  • Connect Xero

What you get

RunsOn a schedule
Get a weekly overdue call list from Xero by emailtoday, 9:00Succeeded
Email · Overdue call list: 5 customers, 18,640.001. Bluefin Labs: 9,200.00 across 3 invoices, oldest 47 days late Call: Maya Chen, +44 20 7946 0123 2. Harbor & Co: 4,860.00 across 2 invoices, oldest 21 days late Call: Sam Patel, +44 161 496 0456 3. Kestrel Media: 2,150.00, 1 invoice, 9 days late Call: no phone in Xero (accounts@kestrel.media)

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.
get_a_weekly_overdue_call_list_from_xero_by_email.pyexample
from collections import defaultdict
from datetime import date
from clickruntime import on_trigger, credentials, http, notify

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):
    headers = xero_headers()
    params = {"Statuses": "AUTHORISED", "where": 'Type=="ACCREC" AND AmountDue>0'}
    owed = defaultdict(lambda: {"total": 0.0, "count": 0, "late": 0, "name": ""})
    for inv in http.get(f"{API}/Invoices", headers=headers, params=params).json()["Invoices"]:
        late = (date.today() - date.fromisoformat(inv["DueDateString"][:10])).days
        if late <= 0:
            continue
        o = owed[inv["Contact"]["ContactID"]]
        o["name"] = inv["Contact"]["Name"]
        o["total"] += inv["AmountDue"]
        o["count"] += 1
        o["late"] = max(o["late"], late)
    if not owed:
        notify.email_me("No overdue invoices", "Nothing is overdue in Xero this week.")
        return {"customers": 0}
    lines = []
    for n, (cid, o) in enumerate(sorted(owed.items(), key=lambda x: -x[1]["total"]), 1):
        c = http.get(f"{API}/Contacts/{cid}", headers=headers).json()["Contacts"][0]
        phone = next((" ".join(filter(None, [p.get("PhoneCountryCode"), p.get("PhoneAreaCode"), p.get("PhoneNumber")]))
                      for p in c.get("Phones", []) if p.get("PhoneNumber")), None)
        person = " ".join(filter(None, [c.get("FirstName"), c.get("LastName")])) or c["Name"]
        invs = f"across {o['count']} invoices, oldest" if o["count"] > 1 else "1 invoice,"
        lines.append(f"{n}. {o['name']}: {o['total']:,.2f} {invs} {o['late']} days late\n"
                     f"   Call: {person + ', ' + phone if phone else 'no phone in Xero (' + c.get('EmailAddress', 'no email') + ')'}")
    total = sum(o["total"] for o in owed.values())
    notify.email_me(f"Overdue call list: {len(owed)} customers, {total:,.2f}", "\n".join(lines))
    return {"customers": len(owed), "total": total}

FAQ

Common questions

Why a call list rather than more reminder emails?
After a couple of emails, a phone call is usually what gets an overdue invoice paid. This list gives you the people to call and the numbers in one place.
Where does the phone number come from?
From the contact record in Xero. If a customer has no phone saved, the list shows their email instead so you know to add one.
Does it change anything in Xero?
No. It only reads invoices and contacts. Add notes or payment plans in Xero yourself after each call.
What permissions does it need?
accounting.transactions.read, accounting.contacts.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 a weekly overdue call list from Xero by email” from your assistant

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