CaptainYi logoCaptainYi
← Back to Tools

Xero Overdue Payment Tracker

Live

Fetches aged receivables from Xero, buckets invoices by aging period, and delivers a formatted Excel report via Lark Bot on a daily cron schedule.

This page shows simulated demo data for illustration purposes only.

How It Works

1

Xero API

Fetch aged receivables

2

Invoice Parser

Extract contacts, dates & amounts

3

Aging Calculator

Bucket: Current / <1M / 1M / 2M / 3M+

4

History Builder

On-time rate & avg days late per customer

5

Excel Generator

3-sheet workbook: Summary, Invoices, By Customer

6

Lark Bot

Auto-deliver via Bot API · runs on cron

AUD 48,350

Total Overdue

23.9

Avg Days Overdue

7

Overdue Invoices

AUD 12,400

Collected This Month

CustomerInvoice #IssuedDue DateDays OverdueAging BucketAmount Due (AUD)On-Time Rate
Richmond Hospitality Pty LtdINV-082115 Jan 202615 Mar 2026432 MonthsAUD 8,450.0042%
Southbank Catering GroupINV-083422 Jan 202622 Mar 2026362 MonthsAUD 12,300.0031%
St Kilda Food ServicesINV-08471 Feb 20261 Apr 2026261 MonthAUD 3,210.0058%
Fitzroy Provisions Co.INV-08525 Feb 20265 Apr 2026221 MonthAUD 5,880.0067%
Melbourne City CaterersINV-086110 Feb 202610 Apr 202617< 1 MonthAUD 2,100.0075%
Collingwood Kitchen SuppliesINV-086514 Feb 202614 Apr 202613< 1 MonthAUD 7,640.0083%
Northcote Bistro HoldingsINV-087117 Feb 202617 Apr 202610< 1 MonthAUD 8,770.0050%

Source Repository

ian60012/xeroinvoicetracker

Daily Xero aged receivables report — fetches unpaid invoices, generates Excel in Xero format, and delivers to Lark via Bot API. Dockerised, runs on cron.

Tech Stack

PythonXero APIpandasopenpyxlLark Bot APIDocker
View on GitHub →

The problem

Aged receivables in Xero are already a report. The report goes stale because someone has to export it, decide who to call, and remember what was promised last week. In a kitchen, a wholesale desk, or a small group of venues, that someone is also buying, rostering, or packing. The file is exported on Monday and ignored by Thursday.

Chasing from memory favours the loudest customer and the largest single invoice. A pattern of smaller invoices that are always a month late stays invisible. So does the customer who is already on a payment plan and should not receive another generic reminder.

The tracker on this page is a daily sort, not an automatic debt collector. It reads aged receivables, buckets them, writes a workbook, and delivers the file to the chat the team already opens. The public repository is ian60012/xeroinvoicetracker. The numbers in the demo are sample rows.

How the process works

The routine is short on purpose. A longer routine is the one that stops being run.

  1. 1

    Read Xero

    Pull open invoices and contacts for the organisation you named. Keep the scope to read access. The job stores its own token. People receive the report, they do not share a login.

  2. 2

    Keep the fields that change a phone call

    Contact, invoice number, issue date, due date, amount still owing, and status. Line items stay in Xero for disputes. Copying them into a second system is how the two copies drift.

  3. 3

    Bucket in language the team already uses

    Current, under one month, one month, two months, and three months or more. If your bookkeeper uses different names, the sheet should use those names. The buckets are labels, not a credit score.

  4. 4

    Rank inside the bucket

    Amount due, then days overdue. A large invoice that is a week late and a small invoice that is four months late are both on the sheet. Hiding the small one hides the pattern.

  5. 5

    Add a plain customer history

    A page by customer with recent on-time behaviour stops the meeting arguing from memory. It describes dates. It does not invent a rating.

  6. 6

    Deliver it on a weekday morning

    The reference build sends a three-sheet workbook through a Lark bot on a cron, after the previous day’s receipts are in Xero. Email or another chat is fine. Hourly is noise. Monthly is the stale report you already have.

Before and after

Before

  • Someone remembers to export aged receivables, or they do not.
  • The chase list is a highlight on a PDF, and the highlight is not shared.
  • Disputed invoices and ordinary late invoices look the same in the pile.

After

  • A workbook arrives without an export step, with totals by bucket and one row per open invoice.
  • The same file is what the meeting looks at, so two people are not working from two downloads.
  • Rows that must not be auto-chased can be marked and still reconcile to the Xero total.

The tool does not know that a buyer is on leave or that a credit note is about to be raised. Those calls stay with a person. The list they start from matches Xero that morning.

Questions

Will this email my customers?

Not in this design. It delivers a report to your team. Sending customer reminders is a separate decision, with a list of who must be left alone.

Does it match Xero’s aged receivables exactly?

It should tie to the open balances you pulled. If a tracking category or a contact group limits the report, the summary should say so, so nobody compares it to the unfiltered Xero total and calls it wrong.

Why Excel and a chat bot?

Because that is where the follow-up already happens. A dashboard nobody opens is a second stale report. The three sheets are summary, invoices, and by customer.

Can I see the code?

Yes. The repository linked on this page is public. It is a reference implementation, not a hosted product you log into.

If the Monday export is the process

Tell me which Xero organisation, which chat should receive the file, and which customers must never get an automatic nudge. The buckets should use the words your team already says.

Talk through the chase list