How to add document OCR to Infor XA
Short answer
Scan or receive the document, run OCR and layout extraction, match the result to the open PO and receipt in Db2 for i, and send low-confidence fields to a reviewer before anything is staged for XA. The documents themselves are stored with a link back to the XA transaction.
XA sites typically handle three paper problems: supplier invoices to accounts payable, packing slips and certificates at receiving, and drawings or inspection reports in quality. Often these are scanned into a folder or emailed as PDFs, then retyped by someone who already has other work.
OCR is not new, but the combination of layout-aware models and tight validation against ERP data is. The goal is not a perfect read of every character. It is a trustworthy structured record, with doubtful fields shown to a person and checked against what XA already knows about the PO, vendor and receipt.
Because XA is on IBM i, the pattern is to keep recognition and review outside the partition, land structured data in staging tables, and let a controlled import do the posting.
What teams use it for
Supplier invoice capture
Extract vendor, invoice number, date, totals and lines, match to PO and receipt, and stage a voucher for AP.
Packing slip receiving
Read the packing slip at the dock, propose receipt quantities against the PO and flag over or short shipments.
Certificates of conformance and mill certs
Capture heat or lot numbers and certificate references, link them to the receipt and make them searchable for traceability.
Inspection reports and travelers
Digitise handwritten or printed results into structured quality records for review.
Freight bills
Match carrier invoices to shipments and highlight charges beyond what was quoted.
Infor XA (on IBM i) integration surface
- Db2 for i holds the PO, receipt and vendor data you validate against. Expose them through read-only views to the OCR service, because exact XA file names vary by release.
- Staging tables in Db2 for i for extracted headers, lines, confidence scores, and review status, kept separate from live accounting files.
- A controlled import or API path into XA accounts payable and receiving. Depending on release, this could be an interface file, an RPG wrapper, or an ION-based flow if licensed. Confirm which one your installation supports.
- The IFS or a network file share for storing the original images. Store a reference key in Db2 for i so the document can be opened from the transaction.
- Where your site runs a document management add-on, it may already provide links from XA transactions to files, which you can reuse instead of building new storage.
How it works
- 1
Inventory your document types
Collect a hundred real samples of each type across vendors. Note scan quality, handwriting, multiple pages, and languages.
- 2
Choose the recognition stack
Pick between a cloud document AI service, a commercial OCR engine, or open-source OCR and layout models on your GPUs. Evaluate on your samples, not on a vendor demo.
- 3
Extract to a schema
Define fields per document type, such as vendor, PO number, currency, and tax. Output values with a confidence score each.
- 4
Validate against XA
Check the vendor exists, the PO is open, quantities do not exceed the open balance, and totals add up. Failures lower the score.
- 5
Review queue
Show the image beside the fields, highlight low-confidence ones and let the reviewer correct. Corrections go back as training data.
- 6
Post through the controlled path
Approved records go to the import program, XA applies its own edits, and the XA document number is written back to the staging row and the stored image.
Example flows
Invoice with a quantity mismatch
Trigger: A supplier invoice PDF lands in the AP inbox folder.
- OCR extracts the vendor, invoice number and three lines.
- The match against the PO shows line two billed for more than was received.
- The record goes to review with the variance highlighted.
- AP either holds it or adjusts according to policy.
Result: The overbilling is caught before payment instead of in a later audit.
Mill cert at receiving
Trigger: A receiver scans a packing slip and certificate together.
- The service reads the heat number and specification from the certificate.
- It links them to the PO line and receipt.
- If the specification field is not read with high confidence, it asks the receiver to confirm.
Result: The heat number is searchable from the receipt record for later traceability.
Keeping data on-prem
Documents like invoices and certificates can contain pricing, part data and controlled technical information. Run OCR and the extraction model on servers you control, using open-source OCR and layout-aware models on local GPUs where quality allows. Compare their accuracy on your own documents against any cloud service before you decide. Storage stays on your file server or IFS, the review UI is internal, and only structured, approved data is posted to XA. This approach also keeps you out of questions about data processing agreements with an external AI provider.
Security checklist
- Encrypt document storage and limit the review UI to roles that already see the underlying transaction.
- Scan uploads for malware and restrict file types and sizes.
- Do not let extraction output write to live files. Only the controlled import posts.
- Keep an immutable link between image, extracted values, reviewer edits and the final XA document.
- Apply retention rules that match your financial and quality record requirements.
Ways to get it done
Packaged AP automation tool with an IBM i connector
Effort: Weeks to a couple of months, mostly connector and approval flow setup.
Invoice capture only and you accept the vendor's data location and licence model.
Build on OCR and layout models in-house
Effort: Typically two to four months to a robust, reviewed workflow.
Mixed document types, strong internal engineering and on-prem requirements.
Netray with your XA partner
Effort: A pilot over several weeks, then adding types.
You want a measured pilot on one document type with on-prem models and clean XA posting.
Pitfalls
- !Judging accuracy on character recognition rather than on whether the final voucher is right.
- !Skipping the 3-way match, which is where most of the control value comes from.
- !Ignoring multi-currency, tax and freight lines that vary by supplier.
- !Training only on clean PDFs while real life includes skewed scans and phone photos.
- !Failing to keep the reviewer's corrections, losing the chance to improve the extraction.
Frequently asked questions
Is there a built-in OCR in Infor XA?
I would not assume so. Some sites use add-on document management or AP automation products that connect to XA. Check your installed modules and licences, and consider whether they meet your accuracy and data location needs.
How accurate can OCR be on invoices?
It varies widely by supplier and scan quality. Clean, repeat vendors may reach high straight-through rates once tuned, while poor scans and handwriting need review. Measure per vendor and per field on your own sample.
Can OCR run without sending documents to the cloud?
Yes. Open-source OCR and document models can run on local servers. Test them on your documents and expect to trade some convenience and accuracy for control, depending on the model and layouts.
How does the data get into XA accounts payable?
Through a supported interface file, wrapper or API on your release, after staging and validation. Avoid writing to accounting files directly, because the XA programs apply posting rules and audit fields.
What about drawings and technical documents?
Treat them separately. For drawings, extract title block, revision and part number and link the file to the item. Retrieval over drawing contents is a different task and, for controlled data, should stay on-prem.
Want Document OCR working on your Infor XA (on IBM i)?
A free 30 minute assessment: we map the integration path for your version and setup, and where it should run.
Get a free assessment