On a schedule
Remind customers before Xero invoices fall due
Each weekday at 9am, unpaid Xero sales invoices due in 3 days are re-sent to the customer through Xero, with a history note on each invoice and a summary emailed to you.
- Runs
- On a schedule
- Apps
- Xero
- AI
- Not needed
- Access
- accounting.transactions (read+write)
Send this to your assistant
Create a ClickRuntime automation: every weekday at 9am, find unpaid Xero sales invoices due in exactly 3 days, resend each to the customer from Xero, add a history note, and email me the list.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Many late payments are not deliberate: the invoice was filed away and forgotten. A reminder a few days before the due date catches people while there is still time to pay on time.
This finds Xero sales invoices due in three days and re-sends them through Xero, so the customer gets the same branded email and payment link they already know. A history note on each invoice records that it went out.
It suits service businesses, agencies and freelancers on Xero who would rather prevent overdue invoices than chase them.
What you get out of it
Fewer invoices go overdue
A friendly nudge before the due date gets paid more often than a chase after it. You spend less time on awkward follow-ups.
Sent from Xero, not a new address
Customers get the invoice email and payment link from your Xero organisation, so the reminder looks like your normal billing.
A record on every invoice
The history note shows when the reminder was sent. Anyone looking at the invoice in Xero can see it.
One summary for you
You get a short email listing what went out, so nothing is sent without you knowing.
Works alongside overdue reminders
Pair it with an overdue reminder for invoices that slip past the due date, and the whole cycle runs without you.
How it works
What happens, step by step
Every weekday morning ClickRuntime looks for approved, unpaid sales invoices in Xero.
It picks those with a due date three days from today.
Each one is re-sent to the customer using Xero's own invoice email, and a note is added to the invoice history.
You get one email listing the invoices that were sent.
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 datetime import date, timedelta
from clickruntime import on_trigger, credentials, http, state, 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"}
DAYS_BEFORE = 3
@on_trigger
def run(event):
headers = xero_headers()
due = date.today() + timedelta(days=DAYS_BEFORE)
where = (f'Type=="ACCREC" AND AmountDue>0 AND DueDate==DateTime({due.year},{due.month},{due.day})')
invoices = http.get(f"{API}/Invoices", headers=headers, params={"Statuses": "AUTHORISED", "where": where}).json()["Invoices"]
done = set(state.get("reminded") or [])
sent = []
for inv in invoices:
if inv["InvoiceID"] in done:
continue
http.post(f"{API}/Invoices/{inv['InvoiceID']}/Email", headers=headers, json={}).raise_for_status()
http.put(f"{API}/Invoices/{inv['InvoiceID']}/History", headers=headers,
json={"HistoryRecords": [{"Details": f"Pre-due reminder sent ({DAYS_BEFORE} days before due date)"}]})
done.add(inv["InvoiceID"])
sent.append(f"{inv['InvoiceNumber']} {inv['Contact']['Name']}: {inv['AmountDue']:,.2f}, due {due:%a %d %b}")
state.set("reminded", list(done)[-2000:])
if sent:
notify.email_me(f"{len(sent)} invoices reminded before due date", "Sent through Xero today:\n" + "\n".join(sent))
return {"sent": len(sent)}FAQ
Common questions
What does the customer receive?
What if the due date falls on a weekend?
Will a customer get the reminder twice?
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 “Remind customers before Xero invoices fall due” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.