Operations

How to automate order processing

The short answer

To automate order processing, capture orders from email, PDF purchase orders and web channels, extract the customer, ship-to address, items and quantities with an AI model into a fixed schema, match every line to your item master and price list in code, then create the sales order in your ERP or accounting system and send the customer an acknowledgment. Orders that fail a price, credit or stock check go to a person with the reason attached.

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.

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. Create. Clean orders are written to NetSuite, QuickBooks Online or your ERP, and the order number is stored on the tracking record.
  6. 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

LayerWhat we useWhy
CaptureGmail or Outlook trigger, plus a Shopify webhook for web ordersEvery order channel lands in one tracking table
ExtractionClaude Sonnet 5.5 reading PDFs and images with structured outputCustomer PO layouts vary endlessly and change without warning
Item matchingA customer part number cross-reference in Postgres, plus codeMost lines should match by lookup, not by model judgment
ValidationCode that queries price lists, credit status and stock in the ERPPrice, credit and availability decisions must be exact
ERPNetSuite REST web services, QuickBooks Online node, or a legacy ERP APIThe order lives where warehouse and finance already work
ExceptionsSlack message linking to a review screenReps fix and release an order in one place
ConfirmationEmail sent from the orders mailboxThe 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

  1. 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.
  2. Build the cross-reference table. Export customer part numbers you already know from past orders. Many ERPs store them on the customer item record.
  3. 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.
  4. 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.
  5. Add validation rules with reason codes. Price mismatch, credit hold, insufficient stock, unknown ship-to, duplicate PO. Every exception shows its reason.
  6. 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.
  7. Release by customer. Once a customer’s orders come through clean, let them flow straight to released status.
  8. 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

Free starter template

Import a working n8n workflow that implements the core of this guide, then adapt it to your systems.

Frequently asked questions

How is this different from automating invoice processing?

Both read documents, but order processing is mostly a matching problem. The hard part is mapping a customer's own part numbers, units and descriptions to your item master and price list, then checking credit and stock before anything ships. Invoice processing checks arithmetic and vendors; order processing checks whether you can and should fulfill the order.

Can it handle EDI orders from large retailers?

EDI is a structured format that should not go through an AI model at all. Large retail trading partners usually require a certified EDI provider. This automation targets the orders that arrive as emails, PDFs and spreadsheets, which is where most order desk time goes at small and mid-sized distributors.

What if customers use their own part numbers?

The workflow keeps a cross-reference table of customer part numbers to your SKUs. Known numbers match instantly. For unknown ones, the model suggests likely matches from your catalog, a person confirms the right one, and the mapping is saved so the same part number never needs review again.

Will it create sales orders in NetSuite or QuickBooks Online?

Yes. NetSuite is connected through its REST web services with OAuth 2.0, which an administrator sets up; Oracle recommends OAuth 2.0 for new integrations, and from release 2027.1 new integrations cannot use token-based authentication. QuickBooks Online has a built-in n8n node. Sales orders exist in the QuickBooks Online app on Plus and Advanced, but confirm API support before relying on them; many teams record wholesale orders as estimates or invoices instead.

What happens when the customer's price does not match ours?

The order is held and flagged with both prices. Your team decides the policy, for example honoring prices within a small tolerance automatically and sending anything larger to the account manager. The model never decides which price is right.

Next steps