How to automate inbound email in SAP Business One
Short answer
Read a shared inbox, extract order or quote data with rules and a language model, match it to Business Partners and Items, then create Drafts through the Service Layer for a clerk to review. Post only when confidence is high and the checks pass.
Business One users spend a surprising share of the day retyping emails: customer purchase orders as PDFs, RFQs in the body text, supplier acknowledgements with new dates. The order desk is a human OCR layer between a mailbox and the Sales Order screen.
B1 can send email (from documents, via Alerts, or through the mailer in the client) but has nothing native for reading and understanding inbound mail. The pieces are available though: IMAP or Microsoft Graph for the mailbox, extraction for the content, and the Service Layer to create drafts.
This page focuses on the order-desk case, because the hard parts are the same everywhere: matching messy names to master data, preventing duplicates, and deciding what a machine may post by itself.
What teams use it for
Customer PO to Sales Order draft
Detect an email with a PO attachment, extract customer, PO number, items, quantities and requested dates, and create a Sales Order draft with the customer PO reference field filled in.
RFQ to Sales Quotation
Read a request with part numbers and quantities, look up Items and price lists, and prepare a Quotation draft for the estimator.
Supplier acknowledgement updates
Parse order confirmations from suppliers, match them to open Purchase Orders and propose new row ship dates for the buyer.
Shipping advice matching
Read ASN-like emails from suppliers and link tracking numbers to Purchase Orders or inbound goods.
Customer questions triage
Classify 'where is my order' emails, pull status from B1 and draft a reply for a person to send.
Duplicate and change detection
Notice that a new PO email matches an existing customer PO number and flag it as a change rather than a new order.
SAP Business One integration surface
- Service Layer: create Drafts (Drafts entity with an object type for Sales Order or Purchase Order) or documents directly; Drafts keep a human in the loop and use the same validation as the UI when converted.
- Attachments2: upload the original email or PDF and link it to the document through the attachment entry, so the source is stored with the transaction.
- Matching data: Business Partners (OCRD), catalog numbers and customer-specific catalog numbers (the BP catalog numbers table), bar codes, and Item master (OITM) for resolving customer part numbers to your item codes.
- Document header fields such as the customer reference number (NumAtCard) used for duplicate checks.
- Mailbox side: Microsoft Graph for Microsoft 365, IMAP or EWS for others; B1's own mailer is for outbound only.
How it works
- 1
Dedicate a mailbox
Use a shared address such as orders@ so ingestion is explicit. Process only that mailbox and move handled mail to folders by outcome.
- 2
Classify and extract
Detect message type (PO, RFQ, acknowledgement, other). Extract fields from body and attachments; for scanned PDFs use OCR first (see the document OCR approach).
- 3
Resolve the sender
Match sender domain and address to a Business Partner contact. Unknown senders go to a manual queue, not auto-created.
- 4
Map parts and units
Resolve customer part numbers via customer catalog numbers, then item description fuzzy match with a threshold; check unit of measure and pack size.
- 5
Validate
Check duplicate NumAtCard, credit status, price against list and quantities against sane limits.
- 6
Create a Draft and attach source
Post the Draft through the Service Layer, attach the original, and tag the extraction confidence in a UDF.
- 7
Notify the reviewer
Send a link to the draft to the order desk. Reviewer corrects and posts from B1; corrections feed a list of known mappings.
Example flows
PDF purchase order from a regular customer
Trigger: An email from a known contact arrives with a PO PDF.
- Extract PO number, ship-to, lines, and requested date.
- Look up each customer part number in the BP catalog numbers; all resolve with exact matches.
- Check NumAtCard for duplicates; none found.
- Create a Sales Order draft with the PDF attached and confidence marked High.
Result: The clerk reviews the draft and posts it in a minute instead of keying it.
Supplier moves a delivery date
Trigger: A supplier reply says line 2 of PO 2291 moves by two weeks.
- Match the PO number and line in the body to an open Purchase Order.
- Build a proposed change: row ship date plus the supplier's note.
- Create an Activity for the buyer with the proposal and a link to the PO.
- Buyer accepts and edits the PO; nothing is changed automatically.
Result: Expedite decisions use fresh dates, and every date change has a source email.
Keeping data on-prem
Inbound email often contains customer drawings, pricing and contractual terms, which many B1 customers do not want sent to a public AI service. Run extraction on a local open-weight model on your own GPU or CPU server, and run OCR locally too. The mailbox itself can stay on Microsoft 365 or on-prem Exchange; the service reads it via Graph or IMAP from inside your network and talks to the Service Layer on the same LAN. Only the finished draft goes to B1, and only the original attachments go to the attachments folder configured for the company. This keeps content on infrastructure you control while still removing the typing.
Security checklist
- Treat email as untrusted input: strip active content, limit attachment types and size, and scan for malware before processing.
- Defend against prompt injection in email bodies by never letting extracted text choose tools or change instructions; the extractor returns data only.
- Do not auto-create Business Partners or change bank details from email; those are classic fraud paths.
- Keep an audit log linking message ID, extraction output and the B1 draft.
- Use a restricted integration user allowed to add drafts but not post or cancel documents.
Ways to get it done
Rules plus templates per customer
Effort: Days per template; brittle when layouts change.
Works when a few large customers send the same PO layout every time.
In-house pipeline with a language model
Effort: Four to eight weeks to a reviewed-draft stage.
Fits when you have developers and a variety of senders, and are prepared to maintain mappings.
Partner-led build (Netray with a B1 partner)
Effort: Scoped project with a pilot on one mailbox before widening.
Fits when privacy requires local models or when volume and variety make accuracy tuning the main risk.
Pitfalls
- !Auto-posting orders with a high-confidence score but unchecked units of measure leads to ten-fold quantity errors.
- !Reply-chain emails repeat old POs; dedupe on PO number and message thread, not just message ID.
- !Customer part numbers that look alike (suffix revisions) need strict matching, not fuzzy.
- !Not storing the source email makes audits and disputes painful.
Frequently asked questions
Can SAP Business One read incoming email on its own?
No. B1 sends email but has no built-in way to parse inbound messages into documents. You need a small service that reads the mailbox and creates drafts via the Service Layer or DI API.
Should the system post orders automatically?
Start with drafts. After a few weeks of measured accuracy per customer, you can allow auto-posting for narrow cases, such as repeat customers with exact catalog matches and a value limit.
What about attachments and scanned PDFs?
Scans need OCR before extraction. Text PDFs can be parsed directly. Keep the original attached to the draft through Attachments2 so reviewers can compare.
Do I need the DI API?
Usually the Service Layer is enough and easier to host. The DI API is Windows-based and tied to a client install, but some older add-ons and complex objects still rely on it.
How accurate will it be?
It depends on sender variety and the cleanliness of your catalog numbers. Expect strong results on repeat customers and weaker ones on new senders; measure field-level accuracy during a pilot and tune thresholds from that.
More for SAP Business One
Want Email automation working on your SAP Business One?
A free 30 minute assessment: we map the integration path for your version and setup, and where it should run.
Get a free assessmentTry it here, free
SAP B1 Service Layer Sales Order JSON Generator
Fill in server, company database, customer and line details to get ready-to-test Login and sales order POST requests for the Service Layer REST API.
New to SAP Business One? Start with the SAP Business One guide and toolkit.
Keep exploring
Free tools
- SAP B1 Service Layer Sales Order JSON GeneratorFill in server, company database, customer and line details to get ready-to-test Login and sales order POST requests for the Service Layer REST API.
- SAP B1 Implementation Cost CalculatorEnter users, rates and effort days to see first-year and three-year SAP Business One cost, using your own partner quotes.
- SAP B1 Business Partner Master Data Request FormA fill-in request form for creating or changing a customer or vendor in SAP Business One, with the fields finance needs and an approval block.
ERP fixes and how-tos
- Private AI for SAP Business One: Service Layer, a read replica and a local modelAdd a private AI assistant to SAP Business One: Service Layer reads, SQL Server or HANA replica, document index, local LLM, permissions and approvals.
- SAP Business One integration: Integration Framework (B1i), Service Layer, DI API and connectorsSAP Business One integration options compared: Integration Framework (B1i), Service Layer, DI API and SaaS connectors, and when to use each.
- Production standard cost in SAP Business One: how it works and where it stopsHow standard cost works for production orders in SAP Business One: valuation method, issue and receipt values, variances at close and process limits.
Runs with your ERP
- ECOSIRE CPQ Configurator with SAP Business One: guided quotingHow the ECOSIRE CPQ configurator uses option models, requires/excludes rules and live cost roll-up to create SAP Business One quotes and orders.
- SAP Field Service Management with SAP Business OneHow SAP Field Service Management, with Coresuite, syncs with SAP Business One service calls and billing: data flows, setup, pitfalls and a private AI layer.
- Avalara AvaTax and SAP Business One: sales and use tax inside the ERPHow Avalara AvaTax calculates sales and use tax inside SAP Business One, how the endorsed add-on connects, what breaks, and where private on-prem AI helps.
AI on your ERP
- AI for SAP Business One Purchasing, From Purchase Request to A/P InvoiceGround AI in SAP Business One purchasing: purchase requests, POs, goods receipts and A/P invoices via Service Layer, read-only, on-prem or private cloud.
- AI for SAP Business One, Without Sending Your Books to a Public APIAdd AI to SAP Business One without sending customer data or financials to a public API. Service Layer and DI API integration, sized for an SMB budget.
Integrations
- How to automate email into SAP ECC 6.0Turn inbound emails into SAP ECC 6.0 transactions: customer POs into sales orders, supplier confirmations, RFQs and invoices, with review and BAPI posting.
- How to automate email processing for SAP Business ByDesignTurn inbound POs, RFQs and invoices in shared mailboxes into SAP Business ByDesign drafts using web services, extraction and review queues. Steps and pitfalls.