SAP Business One and Stedi integration
SAP Business One holds your procurement data - purchase orders, invoices, vendors, and payment terms. Stedi translates business documents to X12 EDI and delivers them to your trading partners via SFTP, FTPS, or AS2. Connecting the two lets you send POs and invoices to partners in their required EDI format without re-keying or exporting spreadsheets. Inbound partner responses come back through Stedi, are parsed to JSON, and update your purchase orders and receipt records in SAP Business One.
What moves between them
Purchase orders and invoices flow from SAP Business One into Stedi. ml-connector polls SAP Business One on a schedule (daily or weekly), reads all POs and invoices modified since the last run using OData UpdateDate filters, transforms the line items and terms to X12 850 (PO) and 810 (invoice) formats, and submits them to Stedi with Idempotency-Key headers. Stedi translates the JSON to EDI and delivers the files to your configured partners via SFTP/FTPS or AS2. Inbound responses (855 acknowledgments, 856 ASNs, 865 PO change requests) arrive at Stedi as EDI files, are parsed to JSON via webhooks, and flow back to SAP Business One where ml-connector maps them to purchase order change records and receipt journals.
How ml-connector handles it
ml-connector maintains the SAP Business One Service Layer instance URL and reuses session tokens to avoid repeated login cold-starts (each ~5 seconds). It polls with $filter=UpdateDate gt datetime'<last-run>' to fetch only changed documents, respecting the default OData page size of 20 and issuing multiple requests if needed. For each PO and invoice, it extracts the partner ID, line items, quantities, prices, and payment terms, then maps the SAP Business One chart of accounts and cost centers to EDI segment identifiers. It posts outbound documents to Stedi with Idempotency-Key headers (format: vendor-docnum-timestamp) so duplicate polls do not re-send. On the inbound side, Stedi webhook payloads arrive at an ml-connector endpoint; ml-connector parses the eventId and transaction metadata, checks for prior processing via a dedup table, extracts the EDI elements (quantities, ship dates, status codes), and upserts purchase order change records and receipt journals into SAP Business One. Retries use exponential backoff if the Service Layer session times out (error code -5002) or Stedi returns a rate-limit 429. Every record carries a full audit trail, and failed inbound transactions are queued for replay after confirmation.
A real-world example
A mid-sized manufacturer in consumer goods uses SAP Business One for procurement and inventory. They work with 15 major suppliers who require orders and invoices in X12 EDI format via SFTP or AS2. Before the integration, the procurement team exported purchase orders from SAP Business One as CSV, manually formatted them into EDI using a third-party tool, and emailed or uploaded files to each partner's SFTP. Inbound 855 acknowledgments and 856 advance shipment notices arrived back by SFTP; a staff member downloaded them, converted them to CSV, and manually updated the PO status and expected receipt dates in SAP Business One. With SAP Business One and Stedi connected, each PO created in SAP Business One automatically translates to X12 850, routes to the partner via Stedi, and sits in SAP Business One's audit trail. Partner acknowledgments and ASNs flow back through Stedi, are automatically mapped to PO line items, and update expected receipt dates and stock reservation - no manual export, no re-keying, no delay.
What you can do
- Poll SAP Business One purchase orders and invoices with UpdateDate filters and translate them to X12 850 and 810 EDI documents.
- Send translated EDI documents to trading partners via Stedi using SFTP/FTPS or AS2, with Idempotency-Key deduplication.
- Receive inbound partner responses (855 acknowledgments, 856 ASNs) via Stedi webhooks and update purchase order status and receipt records in SAP Business One.
- Authenticate SAP Business One with session tokens or OAuth 2.0 (v10.0 FP 2305+) and Stedi with a static API key, with session reuse to minimize login overhead.
- Track every PO and invoice sent, every EDI translation, every partner response, and every SAP Business One update in a full audit trail, with replay capability for failed inbound transactions.
Questions
- How does ml-connector handle SAP Business One's 30-minute session timeout?
- ml-connector maintains a reusable B1SESSION cookie and monitors the error code -5002 (session expired). When a timeout occurs, it re-authenticates and retries the request, reducing the overhead of per-request login (each ~5 seconds). Session tokens are refreshed once per polling run rather than per API call.
- What format do purchase orders and invoices take when sent to Stedi?
- ml-connector extracts line items, quantities, prices, payment terms, and delivery dates from SAP Business One, maps the vendor ID to the X12 partner identifier, and submits JSON to Stedi that it translates to X12 850 (purchase order) or 810 (invoice) format. Each outbound submission includes an Idempotency-Key (format: vendor-docnum-timestamp) so Stedi and ml-connector together dedup any retries within a 24-hour window.
- Do inbound partner responses update SAP Business One automatically?
- Yes. When Stedi receives an 855 acknowledgment or 856 ASN from a partner, it parses the EDI to JSON and sends a webhook event to ml-connector. ml-connector extracts the PO number, line-item quantities, ship dates, and status codes, then upserts them into SAP Business One as purchase order change records and receipt journals. A full audit trail is maintained, and any failed upsert is queued for replay.
Related integrations
More SAP Business One integrations
Other systems that connect to Stedi
Connect SAP Business One and Stedi
Free to use. Add your credentials, ping your real systems, and see if we fit.
Get started