Case study · RAG and AI chatbots
PayRight: AI that checks every supplier invoice against the contract, with a human in the loop
A UK contract compliance and invoice assurance platform. AI extracts contract clauses, people confirm them, and every invoice is scored against contract and PO.

- Client
- PayRight, powered by GovernTerms (UK)
- Role
- AI full-stack developer
- Timeline
- – (4 months)
- Stack
PayRight, powered by GovernTerms, is a UK platform that checks supplier invoices against the contracts and purchase orders behind them. It finds billing discrepancies, potential overcharges and savings, and shows exactly why. From January to April 2026 I was its AI full-stack developer.
One principle shaped everything: PayRight is decision support, not an autopilot. It never approves, blocks or changes a payment on its own. AI finds and explains; a person confirms and decides.
The problem
Checking an invoice properly means reading the contract: the agreed prices, minimum commitments, notice periods, discounts and price-review terms, then comparing every invoice line with them and with the purchase order. Done by hand it is slow, so it mostly isn’t done, and overcharges slip through.
AI can read contracts quickly, but finance teams can’t act on a black box. Every finding has to be traceable to the clause it came from, and nothing should count until a person has checked what the AI extracted.
What I built
The workflow: AI identifies, a person confirms, the system validates
Upload contract
PDF, Word, Excel or scanned copies
AI extracts clauses
Pricing, discounts, commitments, with source references
Human confirms
Every clause approved, edited or rejected first
Upload PO and invoice
Linked to the confirmed contract
Validate and score
Expected total, variances, savings, accuracy score
That split is enforced in the product. A contract cannot be used for validation until every extracted clause has been reviewed.
Contract intelligence
Uploaded contracts go through document extraction and OCR, then AI pulls out the clauses that affect billing and turns legal language into structured rules: pricing, discounts, minimum commitments, notice periods, tolerances and service credits. Each clause keeps a reference back to its source: the document, page, section and the original text. In the review screen a person confirms, edits or undoes each one, or adds a clause the AI missed.
Invoice and PO validation
Invoices and purchase orders come in as PDF, CSV, Excel or JSON, with extracted data shown for checking before anything is processed. Each invoice is linked to a purchase order, and the PO to a contract.
The validation engine then calculates what the invoice should total from the confirmed clauses and the PO, and compares it line by line. It flags pricing variances, quantity mismatches, discount violations, contract validity issues, tolerance breaches and service credit conditions, then produces a report with the variance, the potential saving, an accuracy score and a plain-language summary. The reviewer approves or rejects; the platform only recommends.
Scoring, benchmarking and reports
Accuracy is scored at invoice, contract and supplier level. A dashboard tracks invoices processed, discrepancies, potential savings and accuracy over time, and ranks suppliers. Supplier benchmarking uses anonymised, derived metrics, so no customer’s financial data is exposed to anyone else.
For audit, each validation can be exported as a non-editable PDF assurance report with timestamps, version tracking, data completeness indicators, results, discrepancy explanations, the AI recommendations and an audit disclaimer.
Security and governance
Role-based access for admins, users and superusers, data isolated per customer, email verification at sign-in, and an audit log across every critical action.
Build log
Started
Began as the AI full-stack developer, building the platform with Claude Code.
Contracts and clauses
Document ingestion and OCR, AI clause extraction with source references, and the mandatory human confirmation workflow.
Validation and reporting
The validation engine comparing invoices with contracts and POs, accuracy scoring, supplier benchmarking, the dashboard and the PDF assurance reports.
Wrapped up
Handed over with the full contract-to-invoice workflow in place.
What this project shows
- AI that finance teams can trust. Every finding traces back to a clause, page and section, and nothing counts until a person confirms it.
- Document AI on messy inputs. Contracts, invoices and POs as PDFs, scans, Word, Excel and JSON, turned into structured, comparable data.
- Governance designed in, not added later. Human approval, audit logs, non-editable reports and privacy-preserving benchmarks from the start.
Have contracts, invoices or other documents your team checks by hand? See RAG development and custom AI chatbots, or book a call.





