By Luis Lopez, AI transportation consultant, CEO of Go Hub.io Holdings Corp and subsidiaries, and host of the Freight Guru Podcast
Paying a freight bill is only half the job. Someone also has to decide where that cost lands in the books: which general ledger account, which cost center, and sometimes which customer, product line or SKU should carry it. Get it wrong and margin reports, budgets and landed cost figures quietly drift away from reality.
This article looks at why freight coding is harder than it looks, how AI tools suggest GL codes and allocations, and how to keep a human in control of the result. It is not tax or accounting advice. How your company treats freight in its books is a decision for your accountant.
Why freight invoices are hard to code
A single freight invoice can contain several different kinds of cost, and each may belong somewhere different. The usual sources of confusion include:
- Inbound versus outbound. Freight bringing raw materials or inventory in is often treated differently from freight delivering orders to customers. The same carrier may bill both on one statement.
- Accessorials. Detention, liftgate, residential delivery, storage and redelivery charges may need their own accounts, or may need to be charged back to the customer or vendor who caused them.
- Duties and taxes versus freight. Import invoices from forwarders and customs brokers often mix transportation charges with duties, fees and taxes paid on the importer’s behalf. Those are not the same kind of cost.
- Capitalized versus expensed. Some companies include inbound freight in inventory cost; others expense it. The right treatment depends on your accounting policies, so confirm it with your accountant before any tool is configured.
- Shared shipments. One truckload may carry orders for several customers or product lines, and the cost has to be split by some agreed method.
Manual coders handle this with experience and lookup sheets. The problem is that the knowledge often lives in one or two people, and the volume rarely lets them look closely at every line.
How AI suggests GL codes
An AI coding tool does not guess from the invoice alone. It works best when it can connect the invoice to the shipment records around it:
- Read the invoice lines. Extraction pulls the carrier, reference numbers, charge descriptions and amounts. For more on that step, see OCR vs AI document extraction in freight.
- Match to the BOL and PO. The PRO, BOL or PO number links the charge to a specific shipment, which tells the system whether it was inbound or outbound, which facility and which order.
- Classify each charge. Line haul, fuel surcharge, each accessorial and any pass-through duties are labeled separately.
- Apply coding rules and history. The system proposes a GL account and cost center based on your chart of accounts, written policies and how similar lines were coded before.
- Allocate when needed. For shared loads, it can split cost by weight, cube, pallet count, order value or whatever method your finance team has chosen, down to customer or SKU if the order data supports it.
Coding sits naturally after invoice matching. If the charges have not been checked against the rate confirmation first, you risk coding an overcharge perfectly. The matching step is covered in AI rate confirmation and invoice matching, and the broader process in freight audit and payment explained.
Confidence thresholds and human review
A good coding tool reports how sure it is. That confidence score is what lets you decide where people spend their time.
- High confidence, routine lines. A line haul charge on a regular outbound lane with a clean PO match can often post with light review.
- Medium confidence. New accessorial types, unusual amounts or partial reference matches go to a reviewer with the suggested code pre-filled.
- Low confidence or no match. Invoices with no shipment record, mixed duty and freight lines, or charges the system has not seen before go to a person who decides from scratch.
Set the thresholds conservatively at first and loosen them only after you have watched the results. When I review a coding setup as an AI transportation consultant, the question I ask is simple: which lines are posting without anyone looking at them, and would we be comfortable defending each of those categories to an auditor?
Keeping an audit trail
Automated coding has to be explainable after the fact. For every posted line, the system should record:
- The original invoice and extracted values.
- The shipment documents it matched to.
- The suggested code, the confidence score and the rule or history it relied on.
- Who approved or changed it, and when.
That record helps at month-end, during audits and whenever someone asks why a cost center’s freight spend jumped. It also makes it possible to recode a batch cleanly if a policy changes.
Learning from corrections
The biggest gain over time comes from feeding reviewer corrections back into the system. If a reviewer keeps moving a certain storage charge from outbound freight to warehousing expense, the tool should pick up that pattern and suggest it next time. Two cautions apply:
- Make sure corrections are right. If a reviewer is coding something wrong, the system will learn the mistake just as quickly.
- Write policy changes down. When finance changes how something is treated, update the written rules directly rather than waiting for the model to notice from corrections.
Limits to keep in mind
AI coding depends on the data around the invoice. If shipments are booked without PO numbers, if carriers bill with inconsistent charge descriptions, or if the chart of accounts is unclear, the tool will produce uncertain suggestions. It cannot decide accounting policy, and it should not be the only control over how freight reaches the financial statements. Treat it as a fast, consistent first pass that frees your people to focus on the lines that need judgment. For importers, freight coding also connects to landed cost; see AI landed cost estimation for that side of the picture.
For more conversations on freight and AI, subscribe to the Freight Guru Podcast.
About the author: Luis Lopez is a Miami-based AI transportation consultant and logistics entrepreneur, the CEO of Go Hub.io Holdings Corp and subsidiaries, and host of the Freight Guru Podcast.