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.
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
Every Monday morning ClickRuntime loads all unpaid sales invoices in Xero that are past their due date.
It groups them by customer and adds up what each one owes.
For each customer it looks up the contact person and phone number from Xero.
The list arrives by email, sorted by amount owed, ready to work through by phone.
Before it runs live
- Connect Xero
What you get
Build your own
Need it to work differently?
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
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?
Where does the phone number come from?
Does it change anything in Xero?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
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.
See how it worksSee the week's payments every Friday
A Friday email lists the payments Xero recorded this week and their total.
See how it worksGet a Monday list of bills falling due
You start the week knowing which supplier bills need paying in the next seven days.
See how it worksKeep exploring
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.