ml-connector
Sage X3WooCommerce

Sage X3 and WooCommerce integration

Sage X3 runs the back office for manufacturers and distributors. WooCommerce runs the online store on your own WordPress domain. Connecting the two keeps your inventory and accounts in sync with what customers buy. Every order placed in WooCommerce flows into Sage X3 as a sales transaction, mapped to the correct customer and GL account, and inventory adjustments post automatically as orders ship.

How Sage X3 works

Sage X3 exposes suppliers, customers, purchase orders, sales invoices, products, GL accounts, and GL entries through REST (api1) or GraphQL (Xtrem) APIs, with a customer-specific base URL and port. Authentication uses OAuth2 client credentials (recommended for GraphQL) or HTTP Basic Auth for the legacy REST path. Access tokens expire in 5 minutes, and since Sage X3 does not publish outbound webhooks, data is read by polling GL and sales records with delta detection using updatedDate and modifiedDateTime fields.

How WooCommerce works

WooCommerce exposes orders, customers, products, taxes, coupons, refunds, and payment gateways through a REST API at your store domain, authenticated with API Key credentials (Consumer Key and Consumer Secret). WooCommerce supports webhooks for order.created, order.updated, order.deleted, customer.created, customer.updated, and product events. Webhooks use HMAC-SHA256 signatures and are disabled after 5 consecutive non-2xx responses. Each WooCommerce deployment is self-hosted on a unique domain and port.

What moves between them

Orders and customers flow from WooCommerce into Sage X3. When a customer places an order in the store, ml-connector reads the order via webhook notification, looks up or creates the customer record in X3, maps products to X3 items, and posts a sales invoice or order into Sage X3's sales module with the correct GL dimensions. As orders are marked as shipped or delivered in WooCommerce, inventory adjustments post back into X3 to keep stock counts current. Product and customer master data can flow both directions for alignment.

How ml-connector handles it

ml-connector stores the Sage X3 base URL and port per customer, since X3 publishes no shared tenant address, and authenticates using either OAuth2 bearer tokens or HTTP Basic Auth credentials, refreshing tokens as needed. On the WooCommerce side it registers a webhook endpoint with each store for order events, verifies incoming payloads using HMAC-SHA256 with the webhook secret, and monitors webhook health to catch and manually re-enable disabled hooks. When an order arrives, ml-connector looks up the customer by email in X3, creates a new customer record if needed, maps WooCommerce line-item products to X3 product codes and GL accounts using a configurable mapping table, and posts the order as a sales invoice with the correct delivery and billing address. Inventory adjustments are tracked by order status (pending, shipped, delivered) and posted to X3's stock module using the same product mapping. All records carry timestamps and idempotency keys so a retry of a failed post does not duplicate the invoice.

A real-world example

A small manufacturer runs Sage X3 on-premise to manage procurement, production scheduling, and the general ledger, and uses WooCommerce to sell finished goods directly to customers through their domain. Before the integration, the sales team received WooCommerce order emails, manually re-entered order lines into a Sage sales document, and tracked inventory by hand. With Sage X3 and WooCommerce connected, each customer order flows into X3 automatically, the system reserves stock from the manufacturing batch, and when the order ships, inventory is decremented. Month-end reconciliation shows actual sales matched to invoices, and customer records stay current across both systems.

What you can do

  • Read WooCommerce orders via webhook and post them into Sage X3 as sales invoices with the correct customer and GL dimensions.
  • Look up and create customer records in Sage X3 when a new WooCommerce order arrives, using email and address data.
  • Map WooCommerce products to Sage X3 items and GL accounts using a flexible configuration mapping.
  • Register, monitor, and re-enable WooCommerce webhooks if they are disabled due to consecutive failures.
  • Track order status changes and post inventory adjustments into Sage X3 as orders ship and are delivered.

Questions

How does the integration handle Sage X3 customer-specific URLs and the lack of webhooks?
ml-connector accepts the full Sage X3 base URL and port per customer since X3 publishes no shared tenant registry. Because X3 does not support outbound webhooks, ml-connector polls GL and sales records for changes using the updatedDate and modifiedDateTime fields. Reads from WooCommerce arrive via webhook, ensuring inbound orders are processed immediately.
What happens if a WooCommerce webhook is disabled due to failed deliveries?
WooCommerce disables webhooks after 5 consecutive non-2xx responses. ml-connector monitors webhook health by testing the endpoint periodically, detects when a hook is disabled, and alerts you so the hook can be re-enabled manually. Until re-enabled, the integration can poll recent orders to catch up on missed events.
How are products and customers mapped between the two systems?
ml-connector uses a configurable mapping table that links WooCommerce product IDs to Sage X3 item codes and GL accounts. Customer matching uses email address as the primary key. If a customer does not exist in X3, ml-connector creates a new customer record using the billing address and contact details from the WooCommerce order.

Related integrations

Connect Sage X3 and WooCommerce

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

Get started