How we turned order emails and PDF attachments into structured sales orders in one week, inside a manufacturer's own Azure: what we needed on day one, how confidence works and what comes next.
A manufacturer asked us a simple question: can AI take over the reading and retyping of sales orders? Their orders arrive in shared mailboxes as free-text emails, product codes, descriptions and PDF attachments, and every one of them was interpreted by hand before it became an order. We answered with a working prototype, built in one week inside their own Azure environment. This post goes into the details that did not fit in the case study.

What "one week" really requires
A one-week build only works when the inputs are ready on day one. Before kick-off we asked for:
- An Azure subscription or resource group in the client's tenant, with rights to deploy Azure OpenAI or AI Foundry, a web app and storage, and guest accounts for our team.
- Mailbox access: the designated order mailbox (a test mailbox is fine) and an approved app registration with read access through Microsoft Graph, with admin consent.
- About a hundred historical examples: real order emails exported with their attachments, each clearly linked to the final sales order that was created from it. These are the ground truth.
- The product catalogue as an Excel or CSV export, with at least the article number, description, unit and variants.
- The sales-order format: mandatory and optional fields, an example order and the name of the ERP.
- Two people: one from the order desk and one from IT, available for short questions during the week.
Two more items are optional but make a real difference: a customer list with known email addresses or domains, so a request can be linked to the right customer, and the business rules that live in people's heads, such as customer-specific product references, common abbreviations, units of measure and default values.
Five steps, one decision per step

Each incoming email goes through the same pipeline:
- Received. The mailbox is read through Microsoft Graph, including PDF attachments.
- Understood. A language model works out what the customer is asking for, whatever the form of the request.
- Matched. Each requested item is looked up in the catalogue. Free-text descriptions, partial codes and customer-specific names all have to land on one article.
- Structured. The result is written into the standard sales-order structure the ERP expects.
- Validated. Every field gets a confidence level.
The last step is the one that makes this usable. When the system cannot reliably determine a product, a quantity or the customer, it flags the line for a person instead of making an assumption. "The same brackets as last time" is a perfectly normal sentence in an order email, and the right answer is often "check this one".
Why it runs inside their Azure

Order emails contain customer names, prices and delivery addresses. Building the prototype in the client's own tenant meant none of that left their environment: the mailbox through Graph, Azure OpenAI in their own subscription, the review app and storage in their own resource group, all behind their existing sign-in and access rules.
It also removes a classic step between prototype and production. There is no "now we move it to your infrastructure" phase: it already runs there.
The review screen is the product

The people at the order desk do not need another dashboard; they need to check an order in seconds. The web app lists every processed request and its status, and the detail view shows the original email and attachments side by side with the order the AI proposes, with the confidence per line. A generated sales-order document shows how the interpreted order would be transferred, and the structured output is ready for an ERP link.
How we evaluated it
The historical examples do double duty. They show which kinds of requests exist, and they let us compare the AI's order against the order a person actually created. At the end of the week the client got a demonstration on real emails and a short evaluation: what works reliably, where the limits are, and what is needed for production.
What stayed out of scope, on purpose
The prototype does not write orders into the production ERP. That was a deliberate boundary: the first phase validates the quality of the interpretation. The production phase then adds a direct ERP link and automatic processing of the orders the system is confident about, while anything uncertain stays with a person.

Where this pattern fits
The same pipeline works for any process where people read unstructured input and turn it into structured data: quotes from requests for quotation, invoices, tenders, support requests. If you want to know whether one of your processes is a good first candidate, the AI process scorecard takes two minutes: high volume, low variance, error tolerant, already digital and one owner. Four or five ticks is a good first project.
Read the full AI order-intake case, or see what else we build with AI.
About the Author

About Evarest Schoofs
CEO of OneBonsai, the AI and software company in Leuven that builds VR training, training simulators and production AI. He is driven by technology and how it gets put to work: he loves new gadgets, builds his own tools, and is always looking for ways to make systems work better with tech.
Evarest Schoofs on LinkedIn







