← Case studiesManaz Afzal · accounts payable
Accounting · document automation

Bills in. Xero drafts out.

A bill pipeline for a bookkeeping practice or finance team. It reads each supplier receipt, pulls out the supplier, date and total, runs five checks, and posts the bill to Xero as a draft. Anything that fails a check goes to a person, pre-filled.

Tested on 426 real receipts from ICDAR 2019 SROIE (Huang et al., 2019) after the rules were written on a separate 200. Run 18 Nov 2026, 23:59 Melbourne time.

SupplierMr. D.I.Y. (M) Sdn Bhd
Date17 Mar 2018
TotalRM 42.90
A printed till receipt from Mr. D.I.Y. with the supplier, date and total highlighted where the reader found them
Inbox

Every bill is typed in twice.

Supplier bills arrive as emails, scans and phone photos. Someone reads each one and keys the supplier, date and amount into the ledger, then someone else checks it at month end.

For a practice handling a thousand bills a month, at about 2 minutes each, that is around 33 hours of typing before any checking.

Read

The build

Four parts, all running on an ordinary computer with no paid service:

  • Reader: RapidOCR finds and reads each line of text on the receipt.
  • Extractor: rules that find the supplier (company suffixes such as Sdn Bhd, Ltd, Pty Ltd), the date in any of the common formats, and the total from the TOTAL, ROUNDED, NETT or GRAND TOTAL lines.
  • Checks: date found, total found, total taken from a total line, supplier read, and supplier already a contact in Xero.
  • Poster: each bill that passes is written in the Xero Accounting API format as an ACCPAY bill with status DRAFT, and as a row of Xero's bill import file. Nothing is approved automatically.

Xero draft bills (JSON, 99 bills) · Xero bill import (CSV)

Check

How it works

Bill arrivesemail, scan or photoReadRapidOCR on CPUExtractsupplier · date · totalCheckfive checksXero draftACCPAY bill, DRAFTReview queuepre-filled, a person confirmsany check fails

A bill reaches Xero only if all five checks pass. A new supplier always goes to a person first, so a misread name never creates a contact.

Post

What it means for the finance team

56%of receipts read with supplier, date and total all right (51%–61%), against 12% for a simple first-line, last-number rule
23%passed every check and went straight to a Xero draft
90%of those drafts were fully right (83%–95%)
10drafts carried an error, 8 of them in the total; each is still a draft awaiting approval

Per 1,000 bills, about 232 arrive as drafts ready to approve and the other 768 arrive pre-filled for review. At 15 seconds to approve a draft and 45 seconds to review a pre-filled bill, typing time falls from about 33 hours to 11.

Most bills went to review for one reason: the supplier was new. The contact list came only from the 200 receipts used to write the rules, so 72% of test suppliers were unknown. In a practice with a settled supplier list, the share posted directly would be higher.

Reconcile

Method, results and failure cases

Data and split

  • ICDAR 2019 SROIE task 3: 626 scanned receipts from Malaysian shops and restaurants, each labelled with company, date, address and total. Images and labels from the public SROIE repository.
  • Rules were written and tuned only on receipts 000–199 (200). The 426 receipts from 200 onward were run once for this page.
  • A field counts as right when the date matches the label exactly, the total matches to the cent, and the supplier matches after removing spaces and punctuation.
  • 95% bootstrap intervals over receipts.

Accuracy by field

Supplier
75%
Date
92%
Total
77%
All three
56%
this pipelinefirst-line, last-number rulesame extractor on the dataset's own text

Running the same extractor on the text supplied with the dataset gives 69% all right, against 56% from this pipeline's own reading: about 13 points are lost to reading the image, and the rest to the rules.

Why bills went to review

CheckReceipts that failed it
date found30
total found1
total from a TOTAL line57
supplier read1
supplier already in Xero305

A receipt can fail more than one check.

Findings

Totals are the hard field. Of 10 drafts with an error, 8 had the wrong total: the reader dropped a digit, or the rules picked the wrong amount line. Examples:
ReceiptRead asPrinted
20110.010.60
21311.610.45
3780.19RM 3.30
3891.19RM 21.00
3903.25RM 57.40
Characters that look alike. "D.I.Y." was read as "D.1.Y." and "I.I.Y."; the contact check matches suppliers by similarity, and an unmatched name always goes to review.
Speed. Reading took a median 1.2 s per receipt and 6.2 s at the 90th percentile on three CPU cores; at the median rate a thousand bills take about 21 minutes, unattended.
In detail

The problem in real terms

A bookkeeping practice with three to eight staff looks after 30 to 80 small-business clients on Xero. Bills reach it as forwarded emails, phone photos and Dext or Hubdoc uploads; each is keyed or corrected, coded, and checked again at BAS time, and month and quarter end bunch the work into a few days. Practices that automate capture describe saving between half a minute and two minutes a bill, and a bookkeeper looking after two to three times as many clients.

Team
Practice owner, two to six bookkeepers
Scale
Several hundred to a few thousand bills a month across clients
Systems
Xero, Dext or Hubdoc, a shared inbox, Excel for exceptions
Constraints
GST and BAS accuracy; client data under the Privacy Act; nothing approved without a person

Baselines

Simple rulePipelineSupplier75%Date92%Total77%All three56%
All three fields right on 56% of test receipts (95% CI 51%–61%) against 12% for the simple rule. The date is equally easy for both; the total is where the pipeline earns its place.
Supplier already in Xero305Total from a TOTAL line57Date found30Total found1Supplier read1
A receipt can fail more than one check. The supplier-contact check sends most bills to review, by design.

Tuning set against test set

MeasureRules written on (200)Test (426)
All three fields right49.0%55.9%
Sent straight to a Xero draft53.0%23.2%
Drafts fully right81.1%89.9%
Supplier already a contact72.0%28.4%
Reading time per receipt, median1.1 s1.2 s

The drop in drafts sent straight through, from 53% to 23%, is almost entirely the contact check: the supplier list came only from the 200 tuning receipts. Accuracy of what was sent held up (81% to 90%).

Assumptions

  • Two minutes to key a bill, 15 seconds to approve a draft and 45 seconds to review a pre-filled one.
  • Malaysian till receipts stand in for Australian supplier bills; tax invoices with ABN, GST and line items need more fields.
  • The Xero payloads follow the Accounting API and bill import formats; they were not posted to a live organisation.

What a practice would do next

  • Week 1: export each pilot client’s Xero contacts, so known suppliers pass the contact check.
  • Weeks 2 to 3: add ABN, GST and account-code fields; test on 300 of the practice’s own past bills.
  • Weeks 4 to 8: run for two or three clients alongside Dext or Hubdoc; drafts only, every one approved by a bookkeeper.
  • Then: compare keying time and corrections at the next BAS.
Notes

Limits

  • SROIE receipts are Malaysian till receipts in ringgit. Invoices with line items, purchase order numbers and GST need more fields and a fresh test.
  • The Xero files follow the Accounting API and bill import formats but were not posted to a live organisation for this study.
  • A larger reader or a layout model would cut misread totals; it would need retesting on the same split.

Run it yourself

# code MIT; SROIE images and labels from the public SROIE repository
git clone https://github.com/manazafzal/case-studies && cd case-studies/invoice-to-xero/code
pip install -r requirements.txt
python bills.py ./sroie/data ./out && python score.py ./out

Run 18 Nov 2026, 23:59 AEDT (Melbourne time) · seed 20261118

Sources

  1. Huang, Z. et al. (2019). ICDAR 2019 competition on scanned receipt OCR and information extraction. ICDAR. Data via github.com/zzzDavid/ICDAR-2019-SROIE.
  2. RapidOCR (RapidAI), PaddleOCR models in ONNX.
  3. Xero Accounting API: Invoices (Type ACCPAY) and the bill import template.