Skip to content

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.

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

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

  1. Every weekday morning ClickRuntime looks for approved, unpaid sales invoices in Xero.

  2. It picks those with a due date three days from today.

  3. Each one is re-sent to the customer using Xero's own invoice email, and a note is added to the invoice history.

  4. You get one email listing the invoices that were sent.

Before it runs live

  • Connect Xero

What you get

RunsOn a schedule
Remind customers before Xero invoices fall duetoday, 9:00Succeeded
Email · 3 invoices reminded before due dateSent through Xero today: INV-0412 Bluefin Labs: 2,400.00, due Thu 13 Nov INV-0415 Harbor & Co: 860.00, due Thu 13 Nov INV-0419 Ana Ruiz Design: 1,150.00, due Thu 13 Nov

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.
remind_customers_before_xero_invoices_fall_due.pyexample
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?
Xero's standard invoice email with the invoice attached and your online payment link, using the email template set up in your Xero organisation. Edit that template in Xero if you want reminder wording.
What if the due date falls on a weekend?
The automation runs on weekdays and looks exactly three days ahead, so an invoice due on a Sunday is reminded on Thursday. Ask your assistant to cover weekend due dates on Friday if you want them sent earlier.
Will a customer get the reminder twice?
No. Each invoice is remembered once reminded, and the note in its history shows the date it went out.
What permissions does it need?
accounting.transactions (read+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 “Remind customers before Xero invoices fall due” from your assistant

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