What this automation does
An order lands in the inbox and, minutes later, it is either entered correctly in your ERP with a confirmation sent, or it sits in a short exceptions list with the exact problem named.
- Capture. The workflow watches an orders mailbox for emails with PDF, spreadsheet or image attachments, and also receives web store orders by webhook. Each order gets a tracking record before anything else happens.
- Extract. A model reads the email body and attachments together and returns customer, customer PO number, ship-to address, requested ship date and lines with customer part number, description, quantity, unit of measure and price.
- Match. Code looks up each line in a cross-reference table of customer part numbers to your SKUs, converts units (a case of 12 versus each), and only falls back to model-suggested matches when no mapping exists.
- Validate. Prices are checked against the customer’s price list or contract, the account is checked for credit hold, stock is checked per line, the ship-to is compared with addresses on file, and the PO number is checked for duplicates.
- Create. Clean orders are written to NetSuite, QuickBooks Online or your ERP, and the order number is stored on the tracking record.
- Confirm. The customer gets an acknowledgment listing what was entered, expected ship dates and any backordered lines, so mistakes are caught before picking starts.
When it is worth building
The clearest signal is a team retyping purchase orders. If your customer service reps spend a large part of the day copying lines from PDFs into an ERP screen, and wrong-item shipments trace back to entry errors, this is a strong candidate.
It is not the right first step if most orders already arrive through a web store or B2B portal. In that case, pushing remaining email customers onto the portal can be cheaper than automating around them. It is also not a replacement for EDI with large retailers. And if you take fewer than about 20 emailed orders a day with a small, stable catalog, careful manual entry with a good template may be enough. For the general technique of pulling structured data out of documents, see our document extraction guide.
Architecture
| Layer | What we use | Why |
|---|---|---|
| Capture | Gmail or Outlook trigger, plus a Shopify webhook for web orders | Every order channel lands in one tracking table |
| Extraction | Claude Sonnet 5.5 reading PDFs and images with structured output | Customer PO layouts vary endlessly and change without warning |
| Item matching | A customer part number cross-reference in Postgres, plus code | Most lines should match by lookup, not by model judgment |
| Validation | Code that queries price lists, credit status and stock in the ERP | Price, credit and availability decisions must be exact |
| ERP | NetSuite REST web services, QuickBooks Online node, or a legacy ERP API | The order lives where warehouse and finance already work |
| Exceptions | Slack message linking to a review screen | Reps fix and release an order in one place |
| Confirmation | Email sent from the orders mailbox | The customer replies to the same thread if something is wrong |
Older ERPs without a usable API are where these projects get harder. Sometimes the integration layer is the real work, which is what our tire warehouse ordering project ran into with its legacy API. Budget for that discovery early. Our NetSuite notes cover the authentication setup.
How to build it
- Collect a month of real orders. Pull 100 or more recent orders across your top customers, including the messy ones. These become your test set.
- Build the cross-reference table. Export customer part numbers you already know from past orders. Many ERPs store them on the customer item record.
- Write the extraction schema. Include unit of measure and customer part number as separate fields. Do not let the model convert units, because that belongs in code.
- Implement matching in order of trust. Exact cross-reference first, then your own SKU if the customer used it, then model-suggested candidates that always go to review.
- Add validation rules with reason codes. Price mismatch, credit hold, insufficient stock, unknown ship-to, duplicate PO. Every exception shows its reason.
- Create orders in a held state first. For the first two to three weeks, create orders on hold and have reps compare them against what they would have entered.
- Release by customer. Once a customer’s orders come through clean, let them flow straight to released status.
- Turn on acknowledgments last. Send confirmations only after the entry side is stable, so customers are not confirming errors.
The downloadable starter template below gives you the inbox capture, extraction and exception routing steps to adapt to your ERP.
What breaks in production
- Units of measure. “10” can mean ten cases or ten units. Store the expected unit per customer item and flag any line where the implied total is far outside that customer’s normal order size.
- Revised purchase orders. “PO 4471 Rev 2” must update the existing order, not create a second one. Detect revision markers and match on customer plus base PO number.
- Quoted history in replies. A reply that says “please add 5 more” can cause the model to re-extract the entire original order from the quoted text. Strip quoted content and treat change requests as their own type.
- Stale price lists. Customers often order from last year’s price sheet. Decide the tolerance policy with sales before go-live, not during the first dispute.
- New ship-to addresses. Drop-ship and new job sites are normal in some industries. Route unknown addresses to review rather than creating new ship-to records automatically.
- Monday morning spikes. Weekend orders arrive at once and can hit ERP API limits. Queue orders and process them at a steady rate.
Timeline and cost
A single ERP with one orders inbox typically takes three to four weeks, including the hold-and-compare period. Lumeor typically quotes $5,000 to $12,000 for this build. The range depends mainly on the ERP’s API quality, how many customers use their own part numbers, and whether stock and credit checks are included. A legacy ERP with no API can push the work beyond a single workflow, which we scope separately.
How to measure success
- Minutes of entry time per order, before and after
- Share of orders entered with no human touch
- Order entry errors found at picking, shipping or by the customer
- Time from order received to acknowledgment sent
- Exceptions by reason code and by customer
- Unmapped customer part numbers remaining in the cross-reference