PrymeIntelligence

Finance teams·Playbook

How to code supplier invoices to accounts and cost centres with an AI agent

Code supplier invoices to accounts and cost centres with an AI agent: order-based coding at depth 3, capital, prepaid and tax calls held for an accountant.

Rank the evidence for each line and let the strongest decide. When an invoice line matches a purchase order, the agent takes the order's account and cost centre at depth 3. When it relies on supplier history, it codes at depth 3 only under a value limit. Capital or operating, prepayments, unusual tax and new suppliers go to an accountant. Every line records where its coding came from.

What is invoice coding, and who owns it?

Coding assigns each line of a supplier invoice to a general ledger account, a cost centre, often a project, and a tax code. It decides which budget bears the cost, what appears in the management accounts, whether tax is recovered, and whether the spend is an expense this month or an asset over several years. Wrong coding does not lose money directly, but it distorts every report built on the ledger.

The accounts payable lead owns the coding process. The financial controller owns the chart of accounts and coding policy, including capitalisation and prepayment thresholds. Budget holders approve invoices on their cost centres, which is a separate step from coding. The wider finance position is in AI agents for finance: books you can audit.

How does the agent code, step by step?

  1. Agent, depth 1: reads the invoice lines after intake, as described in processing supplier invoices from inbox to ledger. Line descriptions come from the supplier and are external. Evidence: the captured lines.
  2. Agent, depth 1: looks for a purchase order match. If the line matches an approved order, the order's coding applies. The order is sealed: it was approved inside your systems. Evidence: order and line reference.
  3. Agent, depth 1: reads supplier defaults and history for lines without an order. Default coding on the supplier record, and how past invoices from that supplier were coded. Evidence: the default and the history consulted.
  4. Agent, depth 2: proposes coding for every line, naming the source: order, supplier default, or history.
  5. Agent, depth 1: tests the judgement triggers. Line above the capitalisation threshold; service period spanning more than one month; unusual tax code; supplier new or rarely used; description that does not fit the supplier's usual coding. Evidence: each trigger and result.
  6. Platform: checks the proposal against the minimum chain. The verdict names the bound that decided, such as the value limit for history-based coding.
  7. Agent, depth 3: applies allowed coding. Order-based coding, and history-based coding under the limit with no trigger.
  8. Person, accountant: codes held lines. With the agent's proposal and reasons in front of them. Evidence: the final coding and the accountant's name.
Step The agent does Depth Stays with a person
Read lines Reads captured lines 1 Nothing
Order match Takes coding from the order 1 Nothing
History Reads defaults and past coding 1 Nothing
Propose Codes every line with its source 2 Nothing
Triggers Tests judgement conditions 1 Setting thresholds
Apply Applies order and low-value history coding 3 Nothing
Held lines Explains the proposal 2 Coding decision

What stays with a person, and why?

Judgements about the nature of the spend. Whether a server is an asset or an expense, whether a three-year licence paid up front is a prepayment, whether a mixed invoice for goods and services needs splitting, whether tax is recoverable on a given item. These follow accounting policy and often need knowledge the invoice does not show. A wrong call here can misstate profit for a period, not just one account.

New suppliers stay with a person until there is a coding history worth relying on. Before that, the agent is guessing from a description the supplier wrote. Whether an agent can be trusted with coding more generally is discussed in can an AI agent code transactions to the right accounts.

Approval to pay stays separate too. Correct coding does not mean the invoice should be paid; that depends on matching, approval and checks for duplicates, covered in detecting duplicate supplier invoices. Payment itself is a further step, considered in can an AI agent pay supplier invoices.

Which controls matter, and what evidence do they leave?

Source on every line. Order, default, history or accountant. Evidence: the source field on each coded line.

Value limit on history-based coding. Evidence: the limit cited in each verdict.

Judgement triggers enforced. A line that trips a trigger cannot be coded at depth 3, however confident the agent is. Evidence: held verdicts naming the trigger.

Chart of accounts versioned. The agent codes only to active accounts and cost centres. Evidence: the chart version on each verdict.

Recoding is tracked. If an accountant later changes the agent's coding, the change is kept against the original. Evidence: the recoding log, which feeds recertification.

What should you measure?

  • Lines coded at depth 3, by source.
  • Recoding rate after the fact, by source and by account. The number that decides whether the value limit can rise.
  • Held lines by trigger, which shows where policy is causing most work.
  • Coding to closed or inactive accounts. Should be zero.
  • Month-end reclassifications traced to invoice coding.

Where does it usually go wrong?

History repeats mistakes. If a supplier's invoices were coded wrongly for a year, history-based coding copies the error. Review defaults for high-volume suppliers before relying on them.

Order coding is stale. An order raised months ago carries a cost centre that has since been closed. The chart check catches the closed code; a reorganised team needs the order updated.

Mixed invoices are coded on the first line. A single invoice for hardware, installation and a support contract needs three codings and possibly a capital decision. Code by line, not by invoice.

Service periods are ignored. An annual charge is expensed in one month, then reversed at month-end by hand. Trigger on any service period longer than a month.

Questions people ask

Can the agent suggest changes to supplier default coding?

Yes, as a draft for the accounts payable lead, when recoding shows a default is consistently wrong. Changing the supplier record stays with a person.

Does the agent code credit notes too?

Yes, by following the coding of the invoice the credit note relates to. If the link is missing, the credit note is held.

How is tax coding handled across countries?

Tax codes depend on the supplier's location, yours and the nature of the supply. Start with domestic invoices at depth 3, and hold cross-border tax coding until Attest has evidence on your own history.

Decide what your agents may do. Prove it. Enforce it.

Pryme Intelligence certifies each agent on your own cases, checks every action against five bounds at the moment it happens, and files every verdict.