In industrial operations, the “back-office bottleneck” is usually found in Accounts Payable. Standard OCR solutions fail when confronted with the esoteric layouts of industrial vendor invoices—think steel mills with complex surcharge line items, or logistics providers with variable fuel indices.
We solve this by integrating Google Cloud Document AI directly into the ERPNext workflow, creating a deterministic 3-way match pipeline that operates with zero manual intervention.
The Trigger: GCS and Eventarc
The pipeline begins at the point of ingestion. Invoices are received via a dedicated staging bucket in Google Cloud Storage (GCS). This triggers an Eventarc event that spins up a Cloud Function. This function routes the document to the Document AI Processor, tailored specifically for high-accuracy extraction of tabular data.
Tuning for Industrial Complexity
Vanilla OCR often loses context on multi-page industrial invoices where line items are split across tables. We utilize Custom Document Extractors (CDE) to recognize specific entity types such as “Fuel Surcharge,” “Tariff Code,” and “Heat Number.” This allows us to extract structured data that isn’t just text, but validated financial entities.
Deterministic 3-Way Matching
Once the data is extracted, it is POSTed to a custom endpoint in ERPNext. The system then executes the 3-way match logic:
- Invoice vs. Purchase Order: Validating quantities and unit rates.
- Invoice vs. Receipt (GRN): Confirming that the physical goods have actually entered the warehouse.
The payload sent to the Frappe REST API is a structured representation of the extraction:
{
"doctype": "Purchase Invoice",
"supplier": "STEEL_CORP_NORTH",
"po_reference": "PO-2026-0042",
"items": [
{
"item_code": "H-BEAM-6061",
"qty": 50.0,
"rate": 1240.50,
"document_ai_confidence": 0.998,
"custom_fields": {
"surcharge_type": "Fuel",
"surcharge_amount": 15.25
}
}
],
"auto_submit": true
}
Eliminating the User Tax
By automating the ingestion and matching of thousands of invoices monthly, Infinary eliminates the need for a bloated AP department. Our clients pay only for the Document AI compute and the underlying GCP resources, not for the headcount required to manually type data into a legacy interface.
Intelligence is not a feature; it is an infrastructure requirement.
Principal Architect
Infinary Engineering Group