---
title: "AP invoice coding and matching"
role: controller
slug: invoices
status: ready today
updated: 2026-08-28
canonical: https://aiagents.construction/roles/controller/invoices/
---

## The job

The controller at a US general contractor doing about $5–10M a year — often the owner wearing an accounting hat, or one person who also runs payroll, deposits checks, and chases lien waivers on Friday. There is no AP clerk whose only job is coding bills. Invoices arrive as PDF attachments. If the first pass is slow, bills sit in the inbox, cost reports lie, or someone pays the wrong job.

This job is **use an agent**, not build a model. The controller already has a desk: email, the PDF, a commitment list (purchase orders and subcontracts), a job cost code list, and a spreadsheet or accounting package they already pay for. The agent sits in the **extract-match-propose** step only. It does not release payment. It does not swear a lien affidavit. It does not file taxes.

Without an agent the work is still the same: open the invoice, find the job and the commitment, pick a cost code, enter the bill, route for approval, pay when a person says so.

**What lands in the inbox.** Two shapes show up every week:

- **Supplier / vendor invoices** — a plain invoice for materials, rental, or services. Header (vendor, invoice number, date, amount due), line items, and maybe a PO number. AIA’s own payment write-up draws the line: an invoice *requests* payment; a pay application *documents how the amount was calculated* against a schedule of values.
- **Subcontractor pay applications** — often [AIA G702–1992](https://help.aiacontracts.com/hc/en-us/articles/1500009308242-instructions-g702-1992-application-and-certificate-for-payment) (Application and Certificate for Payment) plus [G703–1992](https://learn.aiacontracts.com/articles/gc-pay-apps-g702-and-g703/) (Continuation Sheet). Official AIA: G702 and G703 are the industry standard for monthly progress releases; they tie to A101 (owner–contractor) and flow down to A401 (contractor–subcontractor). G702 summarizes original contract sum, change orders, work completed and stored to date, retainage, prior payments, and current amount due. G703 breaks the contract sum into portions of the Work per the schedule of values. The contractor signs G702 (notarized when required); the architect’s Certificate for Payment on the same form is a different seat when the GC is billing the owner — on a *sub* package the GC’s controller is reading the sub’s application, not certifying the owner’s.

**Why matching matters.** Official AIA counsel on [A201–2017 § 9.2](https://learn.aiacontracts.com/articles/6508414-what-is-a-schedule-of-values-and-why-is-it-important-to-a-contractor/) (Mike Koger, AIA, Esq.): where the Contract is a stipulated sum or GMP, the Contractor submits a schedule of values allocating the entire Contract Sum to portions of the Work before the first Application for Payment; unless the Architect objects, that schedule is the basis for reviewing Applications for Payment. § 9.3.1: at least ten days before each progress payment date, the Contractor submits an itemized Application prepared in accordance with the schedule of values, notarized if required, **supported by data the Owner or Architect require — including copies of requisitions and releases and waivers of liens from Subcontractors and suppliers** — and reflecting retainage if the Contract Documents provide for it. AIA’s payment-process primer: owners and lenders commonly require lien waivers before releasing payment; waiver types include conditional, unconditional, progress, and final. Coding a bill to the wrong job or the wrong commitment is how you overpay early, understate retainage, or miss that a waiver never arrived.

**Cost codes.** [CSI MasterFormat](https://www.csiresources.org/standards/masterformat2026) is the North American shared language for organizing construction work results (divisions and sections). Many GCs mirror that language — or a shortened shop list derived from it — in their job cost codes so estimate, buy-out, and AP speak the same numbers. MasterFormat is not your chart of accounts and not a legal requirement to use every division. The commitment and *your* code list are the match targets. Do not invent a MasterFormat section the shop does not use.

**What this job is not.** Final payment closeout uses sworn forms a model must not fill as if they were a coding draft. Official AIA: [G706–1994](https://help.aiacontracts.com/hc/en-us/articles/1500009446741-summary-g706-1994-contractor-s-affidavit-of-payment-of-debts-and-claims) is the Contractor’s Affidavit of Payment of Debts and Claims — typically a condition of final payment; the contractor lists exceptions and may need a bond for them; it is notarized. [G706A–1994](https://help.aiacontracts.com/hc/en-us/articles/1500009446521-summary-g706a-1994-contractor-s-affidavit-of-release-of-liens) is the companion affidavit that releases or waivers of liens have been received, with supporting waivers attached. Those are human + notary seats. Payment release, bank ACH, and tax filings stay human always — the role page already says so.

**Why a $5–10M GC still does this.** Cash and job cost are the same person. A late or miscoded bill is a false WIP number, a missed early-pay discount, a double payment, or a sub who got paid without a waiver the owner will ask for later. There is no AP department. There is one controller and a PDF. That is why the **draft extract and match** is the job.

## Use

This is a use workflow. You do not train a model. You do not ask it to invent a PO number, a retainage rate, or a lien waiver. You give it the invoice and your commitment list, you get a draft coding row, you approve.

1. **Save the PDF from email.** Do not paste a screenshot of a portal. Prefer the vendor’s PDF or the sub’s G702/G703 package as filed.
2. **Open your commitment list for that job.** Purchase orders and subcontracts you actually issued — vendor name, PO / subcontract number, original amount, approved changes, billed to date, retainage terms if any. Excel is fine. If you already keep commitments in accounting software, export or open that list; do not invent one in the prompt.
3. **Open your job cost code list.** The codes *this shop* uses on this job (often MasterFormat-shaped, often not). The agent proposes from this list only.
4. **Feed the agent only those files.** Invoice / pay-app PDF + commitment rows for that vendor/job + cost-code list + your AP entry template (columns you already use: job, vendor, invoice #, date, gross, retainage, net, cost code, commitment #, notes). Prompt shape: extract header and line fields from the PDF only; match vendor and amount to one commitment row if the numbers support it; propose one cost code from the uploaded list; flag missing PO, amount over remaining commitment, missing application number, G702/G703 total mismatch, or “no match”; leave a field blank rather than guess; do not invent a PO, change order, or waiver; do not say the bill is approved or paid.
5. **Human edit before the bill is entered as payable.** Check invoice number and date against the PDF. Check that the matched commitment is the right job. On a G702 package, confirm G702 current payment due lines up with G703 (official AIA flow: complete G703, transfer summary to G702). Confirm retainage math against the subcontract, not the model’s story. Confirm any required lien waiver for *this* period is actually attached — AIA lists waivers as supporting data the Owner/Architect may require; the agent does not decide waiver sufficiency.
6. **Approve.** Name, date. The bill is not coded until a person who owns the books accepts the row.
7. **Enter and pay the way you already do.** Post into QuickBooks, Foundation, or whatever you already run. Release payment only after your normal approval chain. Do not stand up a new AP vendor for this job.

Expected shape of the gain: less time retyping a 12-line invoice into a cost code you already know. That is not “the model paid the electrician.” There is no published, independent hours-saved or accuracy number for a $5–10M GC AP coding pass that this page will invent. Time a week of *your* inbox (extract + your edit vs typing cold) before you change anything you pay for.

## Build

A general-purpose model that can read PDFs can draft an AP coding row from an invoice plus a commitment list. Dollar totals that must equal a signed subcontract, notarized affidavits, and “is this waiver good in our state?” need a person. Do not treat the draft as a payment release.

> A workable v1: a prompt template that returns one coding table row — vendor, invoice #, invoice date, job, commitment #, proposed cost code, gross, retainage (if shown), net, match confidence (exact / partial / none), open questions — plus a short “flags” list. Keep the transcript with the invoice PDF. Require “not in the uploaded commitment list” instead of inventing a PO.

Do not build a custom invoice classifier this quarter. Do not fine-tune. This week’s PDFs and your commitment export are the only corpus that matters.

## Deploy

1. Pick ten recently paid bills you still stand behind — five clean supplier invoices with PO numbers, three messy ones (no PO, wrong job name on the header), two sub G702/G703 packages.
2. Run the agent on the same PDF + the commitment list as of that date + your code list. Time upload, draft, and your edit.
3. Diff the draft against what you actually posted. Record invented POs, wrong jobs, wrong cost codes, missed retainage, and G702/G703 mismatches you caught.
4. Decide using a rule set in advance: no draft posts without a human; every proposed cost code must exist on the uploaded list; if the model invents a PO on a clean matched invoice, it is not ready.

Use your real commitments, not a vendor demo company. Keep the workflow only if the approved rows are still something you would enter.

## Manage

**What “good” looks like**

- A named human **approves every coding row** before it becomes a payable.
- Match is to a real commitment (PO or subcontract), not a guess from the vendor’s letterhead.
- Raw model text is never the ACH file, the check run, or an email that says “you’re paid.”
- Retainage on sub bills follows the subcontract / pay-app math, not a default percentage the model likes.
- Lien waivers and G706 / G706A packages are checked by a person; the agent may note “waiver PDF attached / not attached,” not “waiver accepted.”
- Duplicate invoice numbers for the same vendor are flagged before a second payment.
- If you already have an AP or construction-accounting app, the agent drafts **into that**. This page does not sell a new one.

**Who owns the seat**

The controller / owner-bookkeeper owns coding and the payable. On a $5–10M GC that is one person and the laptop they already use. The PM confirms the work was done when that is the shop’s rule; the controller still owns the books. An agent does not become the signer on G702, G706, or G706A.

**When to skip the agent**

- Final payment packages that need G706 / G706A (and G707 Consent of Surety when bonded). Official AIA: those are sworn / surety seats. Format a checklist if you want; do not let a model “complete the affidavit.”
- Lien waiver legal sufficiency (conditional vs unconditional, progress vs final, state form). AIA names the types; your counsel or your existing checklist owns the call.
- Change-order fights and backcharges. Match the executed change; do not let a model invent one so the invoice “fits.”
- Employee expense reports and payroll. Different control, different tax rules.
- Anything that moves cash (ACH, wire, check print) or talks to the bank.
- Tax filings, 1099 decisions, sales-tax nexus. Always human.
- You did not attach the commitment list. Do not ask a model to remember last month’s POs.
- Coding is already a five-minute habit and reading is not the bottleneck. Leave it.

**How to stand it up this quarter**

Use the model you already have access to. Drop in last week’s invoice PDF, an export of open commitments for that job, and your cost-code list. Edit, approve, enter. Repeat on a live bill. Keep the workflow only if the approved row is still something you would post. Do not buy an AP-automation product to complete this job.

## Citations

Tools are citations, not new brand pages. Do not invent vendor homepages. This page does not create a Bill.com, Procore, Foundation, QuickBooks, or other AP-vendor listing.

- **[AIA G702 / G703 instructions](https://help.aiacontracts.com/hc/en-us/articles/1500009308242-instructions-g702-1992-application-and-certificate-for-payment)** — contractor applies on G702 after completing G703; architect may certify a different amount under A201 §§ 9.5 and 9.6; owner pays the certified amount to the named contractor. Overview: [G702 and G703 for GCs](https://learn.aiacontracts.com/articles/gc-pay-apps-g702-and-g703/) (ties to A101 / A401; SOV, stored materials, retainage, change orders, lien documentation).
- **[AIA schedule of values / A201 § 9.2–9.3](https://learn.aiacontracts.com/articles/6508414-what-is-a-schedule-of-values-and-why-is-it-important-to-a-contractor/)** — SOV allocates the Contract Sum; Applications for Payment follow it; supporting data may include sub/supplier requisitions and lien releases; retainage when the Contract Documents provide for it.
- **[AIA construction payment process](https://learn.aiacontracts.com/articles/contract-basics-for-contractors-payment-processes/)** — progress billing vs milestones; retainage; pay application vs invoice; lien waiver types (conditional, unconditional, progress, final); pay-when-paid vs pay-if-paid (state-dependent — counsel, not a model).
- **[AIA A201–2017 summary](https://help.aiacontracts.com/hc/en-us/articles/1500010259162-summary-a201-2017-general-conditions-of-the-contract-for-construction)** — Article 9 payment and completion; § 9.4.1 architect options (full certificate, partial with reasons, withhold with reasons).
- **[AIA G706](https://help.aiacontracts.com/hc/en-us/articles/1500009446741-summary-g706-1994-contractor-s-affidavit-of-payment-of-debts-and-claims) / [G706A](https://help.aiacontracts.com/hc/en-us/articles/1500009446521-summary-g706a-1994-contractor-s-affidavit-of-release-of-liens)** — final-payment affidavits; notarized; exceptions listed; supporting waivers on G706A. Boundary of this job, not the weekly coding pass.
- **[CSI MasterFormat](https://www.csiresources.org/standards/masterformat2026)** — shared classification language many shops mirror in cost codes. Your list wins.
- **Excel, email, PDF** — receive, extract, log. If they already have construction accounting or AP software, the agent drafts into that. No new vendor page on this site.

## Watch-outs

- **Invented PO / commitment numbers.** Models write fluent “PO-44821” citations that are not on your list. Same failure mode as legal citation hallucination: Dahl, Magesh, Suzgun & Ho, *Large Legal Fictions*, 16 *J. Legal Analysis* 64 (2024) ([arXiv:2401.01301](https://arxiv.org/abs/2401.01301), [doi:10.1093/jla/laae003](https://doi.org/10.1093/jla/laae003)) — public LLMs on verifiable federal-case questions hallucinated often and could not reliably tell. Those percentages are **legal-case questions, not AP accuracy**; do not import them as a construction coding rate. Do import the habit: every commitment number in the draft is unverified until you open your list. Blank is honest; a confident fake PO is not.
- **Wrong job.** Letterhead says “Main Street TI” and you have two Main Street jobs. Match the commitment and the project number, not the marketing name on the PDF.
- **G702 / G703 math.** Official AIA: finish G703, transfer summary to G702. A draft that “codes” a current payment that does not tie to the continuation sheet is a reject, not a payable.
- **Retainage theater.** A201 and G702 make retainage a contract term, not a vibe. Do not let a model apply 10% because “that’s normal.”
- **Unsigned AI that pays.** Fluent, late, and wrong is worse than a short human-coded bill. Do not let the model send the ACH file or tell the sub they are paid.
- **Waiver rubber-stamp.** “Waiver attached” is not “waiver accepted.” G706A is a sworn statement that releases were received; that is not a weekly coding output.
- **Duplicate pay.** Same invoice number, new PDF, new coding row. Check the vendor’s invoice # against what you already posted.
- **Do not replace the controller.** The agent drafts the extract and match. The controller still owns the code, the approval, the payable, and the cash.

## Verdict

**Yes** — a $5–10M US GC should run this job this quarter if invoices already arrive as PDFs, the bottleneck is typing and first-pass coding against commitments, and a person will still approve every payable. Use an agent to **extract fields, match to a commitment, and propose a cost code**; the controller approves. Skip this quarter if you expected the model to release payment, accept lien waivers, complete G706/G706A, or talk to the bank; if you were about to post raw draft rows without a human; or if you were about to buy an AP product you do not already have. Do not publish this page as a vendor listing.

## Tools cited

1. [AIA G702 / G703](https://help.aiacontracts.com/hc/en-us/articles/1500009308242-instructions-g702-1992-application-and-certificate-for-payment) — Application and Certificate for Payment + continuation sheet (sub pay apps) Last verified 2026-08-28.
2. [AIA G702 / G703 overview](https://learn.aiacontracts.com/articles/gc-pay-apps-g702-and-g703/) — How G702/G703 tie to A101/A401; SOV, retainage, change orders, lien docs Last verified 2026-08-28.
3. [AIA schedule of values (A201 § 9.2 / § 9.3)](https://learn.aiacontracts.com/articles/6508414-what-is-a-schedule-of-values-and-why-is-it-important-to-a-contractor/) — SOV as basis for Applications for Payment; lien releases as supporting data Last verified 2026-08-28.
4. [AIA construction payment process](https://learn.aiacontracts.com/articles/contract-basics-for-contractors-payment-processes/) — Progress billing, retainage, pay app vs invoice, lien waiver types Last verified 2026-08-28.
5. [AIA A201–2017 summary](https://help.aiacontracts.com/hc/en-us/articles/1500010259162-summary-a201-2017-general-conditions-of-the-contract-for-construction) — Article 9 — payment and completion; architect certificate options Last verified 2026-08-28.
6. [AIA G706–1994](https://help.aiacontracts.com/hc/en-us/articles/1500009446741-summary-g706-1994-contractor-s-affidavit-of-payment-of-debts-and-claims) — Final-payment affidavit of debts and claims (human + notary; not agent work) Last verified 2026-08-28.
7. [AIA G706A–1994](https://help.aiacontracts.com/hc/en-us/articles/1500009446521-summary-g706a-1994-contractor-s-affidavit-of-release-of-liens) — Affidavit that lien releases were received (companion to G706) Last verified 2026-08-28.
8. [CSI MasterFormat](https://www.csiresources.org/standards/masterformat2026) — Shared numbering language often mirrored in job cost codes Last verified 2026-08-28.
9. [Excel](https://www.microsoft.com/microsoft-365/excel) — Commitment list / AP log (desk tool they already have) Last verified 2026-08-28.

## Changelog

- 2026-08-28 — Published from Scout’s job playbook.
