An accounting outsourcing firm handling 4,200 documents per month across 180 SMB clients in London and Kyiv was spending roughly 3,400 staff-hours per month on manual data entry. Each document required an accountant to open the PDF or photo, read the supplier name, invoice number, line items, VAT amount, and payment date, then key it into Xero or a 1C-compatible spreadsheet. Errors appeared in 2-4% of fields -- enough to trigger HMRC scrutiny letters. The seasonal VAT quarter spike forced temporary staff hires that compressed margin and introduced inconsistency. Automating the document processing pipeline changed the economics of the business fundamentally.
GPT-4o Vision: How Document Parsing Actually Works
Traditional OCR reads pixel patterns to reconstruct characters. If the font is unusual, the scan is skewed, or the document is a photograph of a paper invoice under office lighting, OCR degrades. GPT-4o Vision reads the document as a human would -- understanding layout, context, and abbreviations in context.
For each uploaded document the pipeline does:
1. Convert to image if PDF (pdf2image library)
2. Pass to GPT-4o Vision with a structured extraction prompt listing target fields
3. Receive structured JSON: supplier, invoice_number, date, line_items, vat_amount, total, currency, payment_terms
4. Confidence scoring: each field gets a score 0.0-1.0 based on model certainty
5. Fields below 0.90 confidence go into a 'needs review' queue; fields above 0.90 are written automatically
6. UK path: Xero API sync with MTD digital link chain; UA path: 1C-compatible XML export
Making Tax Digital: The UK Compliance Layer
Making Tax Digital (MTD) for VAT has been mandatory for UK VAT-registered businesses above the 90,000 GBP threshold since April 2022. MTD requires digital record-keeping and submission via MTD-compatible software -- no copy-pasting from spreadsheets.
InvoiceAI writes directly to Xero via the Xero API, which is an HMRC-recognised MTD-compatible software. Every transaction carries a digital audit trail from document receipt to Xero record, satisfying MTD's requirement for a maintained digital link between source data and the VAT submission. For clients on spreadsheets, the system exports an MTD-compliant CSV for HMRC's free bridging tool -- no accounting software upgrade required.
Handling Edge Cases
Handwritten text: GPT-4o Vision reads handwriting with high accuracy; the confidence scoring catches genuine ambiguities. Mixed languages: Cyrillic and Latin in the same session, no configuration needed. Low-quality scans: documents below minimum resolution are flagged before reaching the model, prompting re-upload. Partially cut-off invoice numbers go to the review queue with the specific uncertain field highlighted.
The design principle: the system never silently fails. Every document either succeeds fully, succeeds partially with flagged fields, or is clearly queued for human attention.
Results After 14 Months
For the London/Kyiv accounting firm: document processing time 8 minutes to 25 seconds (-95%), data entry errors 2.4% to 0.02% (-99%), documents handled per accountant per day 28 to 91 (x3.2 capacity), temporary VAT-quarter staff 4-6 people to zero, client count 180 to 241 (same permanent team), HMRC compliance letters received 7 in prior 12 months to zero.
For UK and Ukrainian accounting firms, the MTD compliance angle alone often justifies the investment -- HMRC penalties for MTD non-compliance start at 200 GBP per quarter and the risk compounds with scale.
Related Codeworth Services
Need Help with Implementation?
The Codeworth team is ready to implement these ideas in your project. Free consultation.
Discuss the ProjectCo-founder of Codeworth with 7 years of UK fintech ML experience. Specialises in credit scoring with FCA compliance, ensemble methods including XGBoost and LightGBM, and ML experiment management via Python and MLflow. Has built production systems for credit decisioning processing millions of applications annually under FCA oversight. Holds deep knowledge of FCA model explainability requirements and Consumer Duty documentation standards.