Vendor Bill OCR: Why Standard OCR Fails at Expense Cost Distribution vs. Item Cost Distribution (And How Custom JSON Schemas Fix It)
When customers upload vendor bills, legacy OCR services lump physical inventory items and non-inventory GL expenses into a single broken table. Learn how schema-driven multi-engine OCR separates Item Cost Distribution from Expense Cost Distribution cleanly.
In B2B accounting, ERP, and procurement platforms (such as NetSuite, Acumatica, Sage Intacct, Microsoft Dynamics, QuickBooks Enterprise, and construction/property management ERPs), one of the biggest sources of customer complaints happens right after a customer uploads a vendor bill:
“Our customers upload supplier bills every day, and our paid OCR service never detects the Expense Cost Distribution and Item Cost Distribution accurately—forcing users to manually re-enter and re-allocate the bill lines before posting.”
1. What Is the Difference Between Item Cost Distribution and Expense Cost Distribution?
Unlike a simple consumer receipt, an enterprise or SMB vendor bill rarely maps to a single flat list of items. In ERP bill-entry screens, cost distribution is split into two distinct tables that must sum up to the total bill amount:
1. Item Cost Distribution (Inventory / PO Items)
Physical goods, SKUs, raw materials, or billable inventory items tied to a Purchase Order or item master—requiring Item Code / SKU, Description, Quantity, Unit of Measure, Unit Cost, Extended Amount, and Warehouse/Job Location.
2. Expense Cost Distribution (GL / Non-Inventory Costs)
Non-inventory charges on the same bill—such as freight & shipping charges, fuel surcharges, handling fees, installation labor, environmental fees, or departmental overhead allocations that must be distributed to specific GL Expense Accounts, Cost Centers, or Projects.
2. Why Off-the-Shelf Paid OCR Services Fail at Cost Distribution
Standard pre-trained invoice OCR endpoints (like AWS Textract AnalyzeExpense, Google Document AI Invoice Parser, Dext, or rigid AP OCR vendors) fail for three structural reasons:
- Single Flat `line_items` Array: Pre-trained OCR APIs hardcode a single
line_itemsarray. They lump physical SKU rows and non-inventory expense rows together, or worse, completely ignore freight, handling, and service charges printed below the table subtotal. - Dropped Allocation Columns: When a vendor bill includes columns for Cost Code, Department, Project/Job #, GL Account, or Tax Rate %, fixed-template OCR services drop those properties because they aren't part of the vendor's default 6-field schema.
- Unreconciled Distribution Totals: Because freight, fuel surcharges, or misc expense lines are misclassified or skipped,
sum(Item Cost Distribution) + sum(Expense Cost Distribution) + Taxdoes not equal the Bill Total—causing the ERP import to fail validation.
3. How Smart OCR Solves It With Custom JSON Schema Enforcement
With Smart OCR (POST https://api.smartocr.dev/v1/extract or our remote MCP server at https://api.smartocr.dev/mcp), you are never locked into a generic invoice template. You pass the exact itemCostDistribution and expenseCostDistribution schema your ERP expects:
// Custom Schema passed to POST https://api.smartocr.dev/v1/extract
{
"vendorName": "string",
"billNumber": "string",
"billDate": "string",
"dueDate": "string",
"purchaseOrderNumber": "string",
"currency": "string",
"itemCostDistribution": [
{
"itemCode": "string",
"description": "string",
"quantity": "number",
"unitOfMeasure": "string",
"unitCost": "number",
"discountAmount": "number",
"lineAmount": "number",
"projectOrWarehouseCode": "string"
}
],
"expenseCostDistribution": [
{
"expenseType": "string (e.g. Freight, Handling, Service Labor, Fuel Surcharge, Overhead)",
"description": "string",
"glAccountOrCostCenter": "string",
"departmentOrJobCode": "string",
"allocatedAmount": "number"
}
],
"distributionSummary": {
"totalItemCost": "number",
"totalExpenseCost": "number",
"taxAmount": "number",
"totalBillAmount": "number"
}
}What Happens Behind the Scenes:
- Spatial Table & Footer Extraction: Smart OCR routes tabular bills through AWS Textract (or Google Cloud Vision for mobile bill photos) so every row in the main item grid, secondary expense breakdown boxes, and footer charges is captured with exact coordinates.
- Semantic Cost Classification: Our LLM schema refinement layer separates physical SKU/quantity lines into
itemCostDistributionand routes non-inventory charges (freight, delivery, setup fees, service labor, cost-center splits) intoexpenseCostDistribution. - No-Code Custom Columns Option: If your accounting team wants to test this directly in the browser without writing code, they can open read.smartocr.dev and enter custom column headers (e.g.,
Distribution Type (Item/Expense), Item/GL Code, Cost Center, Description, Qty, Unit Cost, Allocated Amount) to export a ready-to-import Excel or CSV file in one click.
