Skip to main content
Kodvana
Concept project · AI & Automation

Turning a mixed inbox of purchase orders into structured orders

Reading purchase orders that arrive by email in a dozen different formats, extracting the line items and creating the order automatically.

Sales coordinator reviewing a purchase order email beside the sales order created from it
Type
AI & Automation
Industry
Trading & Distribution
First phase
3 to 5 weeks
The scenario

The situation

A fictional industrial components distributor receives roughly 120 purchase orders a day by email. Some arrive as PDF attachments generated by the customer's ERP, some as scanned copies of a printed order, and a good number as plain text in the email body. Two staff members spend most of their working day reading these and typing them into the order system.

The task is simple to describe and difficult to automate with conventional tools, because no two customers use the same format. Template-based extraction breaks the moment a customer changes their layout, and there are more than eighty active customers.

Fictional scenario, synthetic data. The company does not exist and no figures here describe a real deployment. The approach and features are real; the interfaces are illustrations.

Why this is difficult

  • Purchase orders arrive in more than eighty different layouts with no common structure
  • Roughly a fifth are scanned images rather than digital documents
  • Item codes used by customers do not match internal product codes
  • Two people spend most of their day on transcription rather than customer work
  • Orders arriving after hours wait until the next morning to be entered
  • Transcription errors in quantity or item code are found at dispatch, when correcting them is expensive
  • There is no record of when an order arrived versus when it was entered
Proposed approach

How we would build it

The design principle here is that the automation should be confident or silent. It processes what it clearly understands and hands everything else to a person with the original document alongside, so no order is ever guessed into the system.

  1. 01

    Mailbox monitoring and classification

    A dedicated mailbox is monitored continuously. Each message is classified as a purchase order, an amendment, a query or something irrelevant, so only relevant messages enter the pipeline.

  2. 02

    Multi-format extraction

    A language model extracts structured fields from the email body, PDF attachments and scanned images, without needing a template per customer. Scanned documents pass through OCR first.

  3. 03

    Mapping to internal codes

    Customer item codes and descriptions are matched to internal product codes using a maintained mapping table plus fuzzy matching for items seen before.

  4. 04

    Validation against master data

    Customer identity, item codes, quantities, units and prices are checked against master records. Anything that fails validation is flagged rather than corrected silently.

  5. 05

    Confidence-based routing

    Orders where every field is extracted and validated with high confidence are created directly. Everything else goes to a review queue with the original document shown alongside the extracted values.

  6. 06

    Human review screen

    The reviewer sees the source document and the parsed order side by side and confirms or corrects in seconds instead of retyping. Corrections feed back into the mapping table.

  7. 07

    Acknowledgement and filing

    An acknowledgement is sent to the customer with the interpreted order for confirmation, and the original document is archived against the order record.

Recognise this problem?

Tell us how it works in your business. You get a written plan and a fixed price for the first phase.

Discuss a similar project
The system

What it looks like

Drawn rather than screenshotted, so nothing here can be mistaken for a real client system. Every figure on the screen is sample data, not a result.

What it would be built with

The final choice depends on what the business already runs.

AI & extraction
Large language models with structured outputOCR for scanned documentsFuzzy matching
Automation
n8nNode.js workersJob queuesRetry and dead-letter handling
Application
Next.jsTypeScriptPostgreSQLReview interface
Integration
IMAP and Microsoft GraphOrder system APIS3-compatible document storage
Workflow

How a single item moves through the system

  1. 1

    Email arrives

    A message lands in the monitored mailbox and is picked up within seconds.

  2. 2

    Classify

    The message is identified as a purchase order, an amendment, a query or noise. Only orders and amendments continue.

  3. 3

    Extract

    Header fields and line items are extracted from the body and every attachment, with a confidence score per field.

  4. 4

    Map and validate

    Customer and item codes are mapped to internal records and checked against master data and business rules.

  5. 5

    Route

    High-confidence, fully validated orders proceed automatically. Anything uncertain goes to the review queue.

  6. 6

    Create and acknowledge

    The order is created in the order system, the customer receives an acknowledgement and the source document is archived.

Potential business value

What this kind of system tends to change

Described qualitatively and deliberately so. We have not deployed this scenario, so quoting a percentage improvement would be inventing evidence.

  1. 1

    Transcription time redirected

    Staff whose day was consumed by typing move to exception handling and customer contact, which is work that needs a person.

  2. 2

    Orders processed as they arrive

    An order received at 9pm is in the system by 9.01pm rather than mid-morning the next day, which shortens the whole fulfilment cycle.

  3. 3

    Far fewer transcription errors

    Mapping and validation catch item code and quantity mistakes before dispatch, and uncertain fields always go to a person rather than being guessed.

  4. 4

    Volume without proportional headcount

    Order volume can rise substantially without adding data entry staff, because only exceptions need human attention.

  5. 5

    A complete audit record

    Every order is linked to the document it came from, which settles disputes about what was ordered.

Start here

Is this close to your situation?

If this scenario resembles what happens in your business, we can have a much more specific conversation. Tell us how it works today and we will tell you what we would change first.

The first conversation is free, with no obligation.