ml-connector
PlexStedi

Plex and Stedi integration

Plex runs manufacturing finance, inventory, and procurement. Stedi translates those orders into X12 EDI and delivers them to suppliers via SFTP or AS2. Connecting the two eliminates manual order file prep and keeps Plex purchase order status current with supplier acknowledgments. New purchase orders and order releases in Plex flow to Stedi, are translated into standardized X12 850 format, and are routed to the correct supplier. When suppliers respond with 855 acknowledgments, Stedi parses them and ml-connector writes the results back into Plex, so your purchasing team sees real-time order confirmation status without leaving the ERP.

How Plex works

Plex exposes suppliers, purchase orders, purchase order releases, invoices, customers, sales orders, and parts through REST APIs and legacy SOAP Web Services via https://cloud.plex.com/api. The REST API uses OAuth2 client credentials authentication against https://accounts.plex.com/oauth2/token and requires Bearer tokens in request headers. Legacy SOAP endpoints at https://api.plex.com/api/datasources use Basic auth with username, password, and a company code (PCN) to route to the correct data partition. Plex does not offer native webhooks, so purchase order changes are discovered by polling the REST API on a configurable interval (5-15 minutes recommended) and filtering by modified_date or created_date. Role-based permissions are enforced, so the integration user must have the correct Plex role assigned or API calls return 403 or empty results.

How Stedi works

Stedi is a REST API at https://core.us.stedi.com/2023-08-01 that translates JSON into X12 EDI files and routes them to trading partners. Authentication uses API Key in the Authorization header; there is no OAuth or token expiry, though keys can be revoked manually via the Stedi portal. Stedi supports three transport channels: SFTP and FTPS for file pickup by suppliers, AS2 for EDI transmission to EDI network providers, and webhook for real-time event delivery. When Stedi receives inbound EDI from suppliers, it parses the file (e.g., a 855 Purchase Order Acknowledgment), emits a transaction.processed.v2 webhook with the JSON payload to a configured endpoint, and retries up to four times over 90 seconds if the endpoint is unreachable. Outbound API writes require an Idempotency-Key header for deduplication within a 24-hour window, and webhook endpoints must respond within 5 seconds to avoid retries.

What moves between them

The flow runs from Plex outbound into Stedi and back. Purchase orders and order releases created or modified in Plex flow to Stedi on a polling interval (daily or tied to your procurement rhythm), are translated into X12 850 format, and are routed to suppliers via SFTP, FTPS, or AS2 based on each supplier's configured connection. When suppliers respond with 855 Purchase Order Acknowledgments, Stedi receives the EDI file, parses it, and pushes a JSON webhook to ml-connector. ml-connector maps the acknowledgment details (confirmed quantities, ship dates, acknowledgment code) back into Plex purchase order records, so the order status, expected delivery date, and confirmed line quantities update in real time. Invoices and order releases can also flow to Stedi for translation into X12 810 Invoice or 860 Purchase Order Change documents if configured.

How ml-connector handles it

ml-connector polls Plex on a configurable cadence using OAuth2 Bearer token authentication, filtering purchase orders by modified_date to capture only changed records since the last poll. Each purchase order is mapped to a Stedi 850 Purchase Order JSON structure using the supplier account number and Plex item part numbers as the X12 equivalent. ml-connector then writes the 850 to Stedi using an Idempotency-Key derived from the Plex purchase order number and order line number to prevent duplicate submissions if a network error causes a retry. Stedi translates the JSON into X12 format and routes the file to the supplier via the configured transport (SFTP drop directory, FTPS connection, or AS2 network code). When the supplier submits a 855 acknowledgment, Stedi parses the EDI and emits a webhook to ml-connector's configured endpoint. ml-connector extracts the acknowledgment code, confirmed quantities, and requested ship date, refreshes the Plex OAuth2 token if needed, and writes the results back into the Plex Purchase_Order record using a unique external reference to detect duplicates. Stedi webhooks must receive a 5-second response, so ml-connector enqueues the write to Plex in a background job and returns 200 immediately. Rate limit backoff is implemented for both systems; Plex does not publicly document rate limits, so exponential backoff is used on HTTP 429, and Stedi's limits are enforced per API endpoint. The Stedi API Key is stored encrypted and rotated on a schedule set during onboarding.

A real-world example

A mid-sized discrete manufacturer with 150 active suppliers uses Plex for planning, purchasing, and inventory. Before the integration, the procurement team manually prepared flat-file X12 orders in a separate tool twice per week, then uploaded each file to the correct supplier's SFTP folder or dialed into an AS2 network. Inbound acknowledgments from suppliers arrived as EDI files on SFTP or email, were re-keyed by hand into Plex, and often arrived too late for accurate ETAs. With Plex and Stedi connected, each purchase order created in Plex is automatically translated and routed to the supplier within minutes. Supplier acknowledgments flow back as JSON webhooks, are written into Plex without manual touch, and the purchasing team sees confirmed quantities and ship dates in real time without switching systems.

What you can do

  • Automatically translate Plex purchase orders into X12 850 format and route to suppliers via SFTP, FTPS, or AS2.
  • Receive inbound supplier acknowledgments (855) via Stedi webhooks, parse the EDI, and update Plex purchase order status and confirmed quantities.
  • Map Plex supplier accounts and item numbers to X12 equivalents and detect duplicate submissions using Idempotency-Key headers.
  • Refresh Plex OAuth2 bearer tokens and rotate Stedi API Keys automatically, with encrypted credential storage.
  • Poll Plex on a configurable schedule aligned with your procurement rhythm, with exponential backoff retries and a full audit trail for every order and acknowledgment.

Questions

How does ml-connector handle the different authentication between Plex and Stedi?
Plex requires OAuth2 client credentials authentication with bearer tokens refreshed on each session. Stedi uses API Key authentication in the Authorization header with no automatic expiry. ml-connector stores both credential sets encrypted, refreshes the Plex token when calls return 401, and rotates the Stedi API Key on a schedule set during onboarding so a key renewal does not cause an outage.
What happens when a supplier sends back an EDI acknowledgment?
Stedi receives the inbound EDI file from the supplier, parses it into JSON, and emits a transaction.processed.v2 webhook to ml-connector with the acknowledgment details. ml-connector extracts the acknowledged quantities, ship date, and acknowledgment code, then writes the results back into the Plex purchase order record. Webhook processing is asynchronous so ml-connector returns 200 within 5 seconds and enqueues the Plex write in a background job to prevent retries.
Does the integration require Plex role-based permissions or special Stedi configuration?
Yes to both. The Plex integration user must have roles that grant read access to Purchase_Order, Purchase_Order_Release, and Supplier entities, and write access to Purchase_Order custom fields for acknowledgment status. In Stedi, you must configure a Transaction Setting for 850 Purchase Orders, create a Partnership for each supplier with the correct SFTP or AS2 connection details, and register a webhook endpoint for transaction.processed.v2 events so ml-connector receives inbound acknowledgments.

Related integrations

Connect Plex and Stedi

Free to use. Add your credentials, ping your real systems, and see if we fit.

Get started