# How to automate email into Infor XA

> Source: https://netray.co/integrations/infor-xa-email-automation
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Integrations

## Short answer

Read the shared inbox, extract structured data from the message and attachments, validate it against XA masters, and stage a draft order or acknowledgement for a person to release. Staging tables and a controlled import program keep bad data out of the live files.

## System

Infor XA (on IBM i)

## Capability

email-automation

## Intro

At many XA shops, customer orders still arrive as email attachments to a shared mailbox, and someone retypes them into the order entry screen. Supplier acknowledgements and shipping notices do the same. The work is slow, error-prone and dependent on one or two people who know the customers.

Email automation here is less about AI magic than about careful plumbing. You need mailbox access, a parser that handles PDFs, spreadsheets and plain text, validation against item and customer masters, and an entry path into XA that does not bypass its rules.

A language model helps most with the messy part: free-text emails, varied PO layouts and ambiguous part references. The rest is deterministic and should stay that way.

## Use Cases

### Customer PO intake

**Description:** Extract customer, PO number, lines, quantities, prices and dates, match them to XA customer and item numbers and stage a draft order.

### RFQ capture

**Description:** Turn a quote request email into a structured request with parts, quantities and needed-by dates for estimating to price.

### Supplier acknowledgements

**Description:** Match a supplier's confirmation to open PO lines and propose promise-date updates instead of retyping them.

### Shipping notices from carriers and vendors

**Description:** Parse ASN emails and update expected receipt data for inbound planning.

### Order change requests

**Description:** Recognise reschedule or cancel emails, locate the order and queue a change proposal for the order desk.

### Customer service triage

**Description:** Classify status questions and route them to a drafted answer pulled from order data for the rep to approve.

## System Surface

Db2 for i is the place to land staged data. Create staging tables for order headers, lines and exceptions that are separate from live XA files.

Order entry should go through a supported XA path. Depending on release and local configuration this may be a batch or interface file import, an API layer, or an RPG wrapper around standard order entry programs. Confirm with your partner which applies.

Master data lookups against customer, ship-to, item, and customer-part cross-reference tables via read-only views. Names differ by release and mod.

The IBM i can send mail through SMTP, and spool files or IFS stream files can be attached, which helps with outbound replies.

For inbound, use Microsoft 365 Graph or IMAP on a service outside the IBM i. Reading mail on the IBM i itself is possible but rarely worth it.

## How It Works

### Scope message types

**Detail:** Pick one inbox and one message type, typically customer POs. Gather fifty real examples to see how many formats you have.

### Connect to the mailbox

**Detail:** Use Graph API with application permissions limited to one shared mailbox, or IMAP with a dedicated account. Do not use a person's mailbox.

### Extract content

**Detail:** Pull the body, convert PDFs and spreadsheets to text or tables, and fall back to OCR for scanned attachments. Keep the original file.

### Structure and validate

**Detail:** Have a model or rules fill a fixed schema, then validate customer, item, UOM, price and date against XA data. Score each field.

### Stage and review

**Detail:** Insert the result into staging tables with the confidence per field. Show the reviewer the email next to the draft and the differences from standard price.

### Release into XA

**Detail:** On approval, a controlled import program creates the order using the standard rules, returns the XA order number and the service replies to the sender if you choose.

## Example Flows

### PDF purchase order from a repeat customer

**Trigger:** An email with a PDF PO arrives in the orders mailbox.

**Steps:**

- The service extracts the PO and identifies the customer from the sender and header.
- It maps customer part numbers to XA items using the cross-reference.
- A price check flags two lines differing from the contract price.
- A reviewer fixes the flagged lines and releases the draft.

**Result:** An order is entered in minutes, with the price mismatch caught before it ships.

### Supplier promises a new date

**Trigger:** A supplier replies that two lines will ship a week late.

**Steps:**

- The service finds the PO number and lines in the reply.
- It compares the new dates to the production requirement.
- It proposes a promise-date change and flags the lines that now cause a shortage.

**Result:** The buyer sees impact before accepting the new date.

## On Prem

Run the whole pipeline inside your network if mail content is sensitive: a service on an internal server reads the mailbox, an OCR engine and open-weight language model run on your GPUs, and only the staging tables touch the IBM i. If you use Microsoft 365 the mail itself sits in the cloud, but the extraction and model calls do not need to leave. That matters for customers whose POs include controlled drawings or part data. Keep attachments and extracted text in your own storage and apply the same retention rules as the order record.

## Security

- Use a dedicated service mailbox or application permission scoped to a single mailbox.
- Treat email content as untrusted input. Prompt injection inside a PDF must not be able to trigger any XA action.
- Never auto-release orders above a value or from a new sender. Require human review at first.
- Keep the original email and attachment linked to the XA order for audit.
- Run virus scanning on attachments before any parsing.

## Options

### Rules and templates per customer

**Fit:** A handful of large customers whose PO layouts rarely change.

**Effort:** Two to four weeks per format family, plus maintenance.

### Model-based extraction built in-house

**Fit:** Many varied layouts and a team that can manage prompts, evaluation and staging.

**Effort:** Typically six to twelve weeks to a reviewed pilot.

### Netray with your XA partner

**Fit:** You want on-prem extraction, an XA-specific staging and import design, and a measured rollout.

**Effort:** A pilot on one inbox, then expand by message type.

## Pitfalls

- Customer part numbers and units of measure do not match XA items on the first pass. Build the cross-reference before you build the AI.
- Auto-creating orders without a staging step turns extraction errors into shipped errors.
- Quoted-reply chains make the newest message hard to identify. Extract the top message and keep the thread as context.
- Skipping tests on edge cases such as multi-page POs, blanket orders and partial cancellations.
- Counting accuracy by field instead of by order hides the fact that one wrong line can ruin an order.

## Faq

### Can this create orders in XA without a person?

**Answer:** It can for low-risk, repeat patterns once accuracy is proven. Start with review on every order, then allow auto-release only for known customers, known items and prices that match the contract.

### How do emails get into the XA order entry process?

**Answer:** Through a supported import or API path on your release, or a wrapper that calls standard order entry logic. The staging table approach lets you test the validation before any live file is touched.

### Do we need Microsoft 365 for this?

**Answer:** No. IMAP works with most providers. Microsoft Graph is cleaner for shared mailboxes in Microsoft 365, but the extraction and XA side are the same.

### What about attachments that are scanned images?

**Answer:** Use OCR before extraction and give low-confidence fields to the reviewer. See the XA document OCR page for thresholds and layouts that help.

### Is a language model required?

**Answer:** No. Fixed layouts are fine with rules. A model earns its place when formats vary or emails are free text. When you use one, validate its output against XA data and keep it on your own hardware if the content is sensitive.

## Search terms

infor xa email automation, automate purchase orders into infor xa, infor xa order entry from email, ibm i email order processing, as400 email po automation, infor xa rfq automation, email to erp order automation, infor xa edi alternative, supplier acknowledgement automation xa

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
