How an accounting agent posts a journal entry, from source document to balanced entry
What happens between a supplier invoice arriving and a balanced, explained journal entry in your ledger: the checks, the invariants and the trail a controller should expect.
Manoj Tutika7 min read
Working on this yourself? Talk to Mark, our co-founder. We’re here to solve it with you.
On this page
An accounting agent posts a journal entry by reading the source document, deciding the accounts, VAT codes and period, building the entry, and then proving the entry is correct before anything is written. That proof is a fixed set of checks: debits equal credits, the lines add up to the document, the VAT matches, the period is open, and every line points back to its evidence.
If you are a controller or finance lead, you already know the hard part of bookkeeping is not typing. It is the dozen small judgements behind each entry and the confidence that they were made the same way every time. This post walks through those judgements for a single supplier invoice, so you can see what a well-built agent does, and what you should ask of any software that books for you.
What does the agent start from?
Take an ordinary invoice that lands in your purchase inbox. Kantoorhuis Noord B.V. sends invoice 2026-0113, dated 5 January 2026, for two things.
- Professional books, €150.00, BTW 9%, so €13.50 VAT
- Office supplies, €400.00, BTW 21%, so €84.00 VAT
- Total excluding VAT €550.00, VAT €97.50, total payable €647.50
A person would glance at this and book it in a minute. Software has to make every step of that minute explicit, because each step is a place where a mistake can enter the books.
How does the agent read and check the document?
The first stage is extraction: turning the PDF into structured fields such as supplier name, VAT number, invoice number, date, currency, each line with its amount and rate, and the totals. Reading is the easy part. The useful part is that the document can check itself.
A good agent recomputes the invoice before trusting it. Each line amount times its rate must give the line VAT, the lines must sum to the stated net total, and net plus VAT must equal the total payable. Here that is €150.00 plus €400.00 equals €550.00, €13.50 plus €84.00 equals €97.50, and €550.00 plus €97.50 equals €647.50. If any of those fail by more than a cent of rounding, the agent has misread something or the supplier made an error. Either way it should stop, not post.
It then identifies the counterparty. Matching on the VAT number or KvK number is far more reliable than matching on a name, which can be written five ways. If the supplier does not exist yet, creating one is a decision in itself, and a sensible default is to ask the first time.
How does it decide the accounts and VAT codes?
Classification is where the judgement lives. For each line the agent chooses a general ledger account, a VAT code and a period.
The strongest evidence is your own history. If the last eleven invoices from this supplier went to 4560 Professional literature and 4530 Office supplies, the twelfth should too, unless something about it is different. Next come your written rules, such as "office furniture above €450 goes to fixed assets". Only after that does general accounting knowledge apply, and when it is the only basis for a choice, that is a signal to ask rather than to post.
The VAT code follows from the facts on the document: a Dutch supplier charging 9% and 21% means two input VAT codes, one per rate, both reclaimable for a fully taxable business. Foreign suppliers, reverse charge and mixed-use costs are a different story, with rules of their own, and they are exactly where an agent should lean on your rules and your accountant rather than its own judgement.
The period is usually the invoice date, but not always. A January invoice for a December delivery belongs in December if that period is still open, or needs an accrual if it is closed. This is one of the places where a rule written by you beats any default.
What makes an entry valid before it is posted?
Once the entry is built, the agent checks a short list of invariants. An invariant is a condition that must hold for every entry, with no exceptions and no override by confidence. If one fails, the entry does not go in.
These are the ones we consider non-negotiable.
- Debits equal credits, in the document currency and again in your base currency after conversion. Rounding differences from conversion are booked explicitly to a rounding account, never absorbed silently.
- The entry ties to the document. The expense and VAT lines together equal the invoice total, and the payable line equals the amount the supplier is owed.
- The VAT ties. The VAT lines equal the VAT on the document, per rate, so your VAT return is built from the same numbers the supplier invoiced.
- Every account is postable. It exists, is active, is not a heading or total account, and accepts the VAT code chosen.
- The period is open. No entry lands in a period you have closed or filed VAT for. If the right period is closed, the agent proposes a correction in the current one instead.
- The entry is not a duplicate. The same supplier, invoice number and amount have not been booked before, whichever channel the document came in through.
For our invoice the entry is: debit 4560 Professional literature €150.00, debit 4530 Office supplies €400.00, debit 1520 Input VAT €97.50, and credit 1600 Accounts payable €647.50. Debits total €647.50, credits total €647.50, and the input VAT of €97.50 matches the document.
Notice what is not on the list. Confidence is not an invariant. A model can be very confident and wrong, so confidence decides whether to ask you, never whether the arithmetic is allowed to be off.
What is provenance, and why should every line have it?
Provenance means each part of the entry carries a reference to where it came from. Not just "attached: invoice.pdf", but per line: which document line produced this amount, which past bookings or which rule produced this account, which agent or person built it, and who approved it.
This matters for three groups of people. For you, it turns a review from "is this right?" into "is this reason right?", which is much faster. For your auditor, it means any figure in the trial balance can be traced to evidence without a request list. And for the agent itself, explained bookings become precedents it can reuse, so the next invoice from the same supplier is booked the same way for the same reason.
On Thred's ledger, this is the default: open any entry and you see the source document, the bank line, any matched invoices and the journal lines together, with who or what booked it and when.
When should the agent ask instead of post?
An agent that never asks is dangerous. An agent that always asks is a data entry form with extra steps. The useful middle is a policy you set, and the agent follows.
Sensible reasons to stop and ask include:
- A new supplier, or a known supplier with a changed bank account
- An amount above a limit you set, or far outside this supplier's usual range
- A line that fits more than one account, such as furniture that may be a fixed asset
- A document that fails its own arithmetic, or a VAT treatment the agent cannot pin down
- An entry that would land in a closed period
The question should be specific. "Book €400.00 office supplies to 4530, as the last eleven times, or to fixed assets?" is something you can answer in five seconds. "Please review this invoice" is not.
In Thred Layer, each agent runs in either "Ask me first" or "Autonomous" mode, and you can move an agent between them as its track record builds. Above the limits you set, it asks regardless.
What happens when an entry turns out to be wrong?
Mistakes will happen, from people and from software. What matters is how they are corrected. A posted entry should never be edited in place or deleted. It is reversed with a linked counter-entry and rebooked, so the record shows what was booked, what replaced it and why.
That is the standard we hold ourselves to at Thred: every entry can be reviewed and reversed, and nothing is deleted from the record. It is also what makes corrections teachable. When you reclassify a line, the agent records the new reason, and the next similar invoice follows it.
What should you ask of software that books for you?
If you are evaluating any tool that posts entries, ask to see one booked invoice end to end and check for these points.
- Does it recompute the document before trusting it?
- Can it show, per line, where the amount, account and VAT code came from?
- Which checks block a posting outright, and can confidence override them?
- How does it handle closed periods and duplicates?
- Are corrections reversals, with the original kept?
A tool that answers all five clearly is one you can review in minutes instead of redoing by hand. That is the difference between moving work off your desk and moving it to a different screen.
If you want books where every entry arrives balanced, checked and explained, see how the Thred ledger works or book a demo.
Frequently asked questions
What checks should run before a journal entry is posted automatically?
At minimum: the entry balances, the lines tie to the document total and to its VAT per rate, every account is active and postable, the period is still open and the same invoice has not been booked before. If any of these fail, the entry should not be posted at all.
Can an AI agent post entries without a person reviewing them?
It can, within limits you set. A sensible setup lets an agent post routine, well-precedented entries on its own and asks a person for new suppliers, changed bank details, amounts above a threshold or anything that fails a check.
What is provenance on a journal entry?
Provenance is the link from each part of an entry to its evidence: the document line behind each amount, the earlier bookings or written rule behind each account choice, and the agent or person who booked and approved it. It lets you and your auditor trace any figure back to its source.
How should a wrong automated booking be corrected?
By reversing it with a linked counter-entry and booking the correct one, never by editing or deleting the original. That keeps the record complete and lets the system learn the corrected treatment for similar documents.
Does a high confidence score mean an entry is correct?
No. Confidence should only decide whether the agent asks a person first. Arithmetic and accounting checks must pass regardless of how confident the model is.
Sources
Read next
- Handing journal entries to an agent: a four-week plan for controllers
- What auditors look for in journal entry testing, and how to be ready
- Evaluating accounting AI: how to test an agent on your real books
Where Thred comes in
Thred’s own general ledger, built for agents. Every transaction is booked as it happens, under your rules, and traceable back to its source.



