Automation
A payment verification system
AI reads every supplier invoice and checks it against Xero before a payment leaves the bank. Anything that doesn't match, such as a changed bank account number, is flagged, and nothing is paid until a reviewer releases the batch. Built for a group of 17 companies.
Built forA business group made up of 17 companies.
The process, mapped
- 1
Pull the batch from Xero
- 2
Read each invoice
- 3
Compare every field
- 4
Hold what doesn't match
- 5
Reviewer decides
- 6
Release and report
The problem
The group pays its suppliers through Xero, in batches. Before a batch goes to the bank, every payment in it has to be checked against the supplier's invoice. Is it the right bank account? The right amount? The right invoice?
Across 17 companies that is a lot of invoices. In its first six weeks the system read more than 1,500 of them.
A mistake on any one of them, or a changed bank account number, means money goes to the wrong place.
The process
I worked through the check with the group's financial controller. We listed every field that has to match, what counts as a match, and which differences are serious enough to stop a payment.
What I built
Reading the invoices
- The reviewer picks a company and a payment date. The system pulls that day's payment batch from Xero.
- AI reads the invoice attached to each bill, whether it is a PDF or a photo taken on a phone.
Checking every field
- The system compares the invoice with the payment, field by field: bank account, amount, invoice number, payee, tax and due date.
- Small differences can be accepted by the reviewer, who has to give a reason. Serious ones cannot be accepted by anyone. The bill has to be fixed, or the payment taken out of the batch.
Release, with a record
- Only the authorised reviewer can release a batch. When they do, a report is emailed that lists every payment, every difference, and who decided what.
How it works now
Every payment is checked the same way, every time, and there is a record of each decision.
The system only reads from Xero. It never changes anything there or at the bank.
How it was built
Techniques
- Xero integration (API)
- Reads payment batches, bills and supplier details directly from Xero. Read only.
- AI document extraction
- AI reads each invoice, whether a PDF or a photo, and returns the same set of fields every time.
- Image clean-up
- Phone photos are straightened and resized before they are read.
- Rule-based checks
- The comparison is done by fixed rules, not by AI, so the same invoice always gets the same result. Each company sets how strict each rule is.
- Role-based access
- Only the authorised reviewer for a company can release its payments. The database enforces this, not just the screen.
- Audit log
- Every action is recorded with who did it and when.
Tools
- Next.js
- Supabase
- Claude
- Xero
- Resend
Next project
A product research system→