ml-connector
Microsoft Dynamics 365 F&OWooCommerce

Microsoft Dynamics 365 F&O and WooCommerce integration

Microsoft Dynamics 365 F&O runs finance, supply chain, and order management. WooCommerce runs the online storefront on WordPress. Connecting the two means a web order does not have to be re-keyed into the ERP, and the catalog the store shows reflects what Dynamics actually carries. Web orders, customers, and refunds flow into Dynamics as sales orders and customer records, while released products and prices flow out to the store. ml-connector handles the very different APIs and auth on each side and moves the data on the cadence you set.

How Microsoft Dynamics 365 F&O works

Microsoft Dynamics 365 F&O exposes its data through the OData v4 REST service at a tenant-specific environment host, with no shared base URL, so the connector treats the environment hostname as a credential. Key entities for this pair are CustomersV3, ReleasedProductsV2, sales order headers and lines, MainAccounts, and the customer payment journal, all keyed by natural keys plus dataAreaId for the legal entity. Authentication is OAuth 2.0 client credentials through Microsoft Entra ID. Dynamics can push Business Events, such as customer invoice posted, to an HTTPS endpoint, but those payloads are lightweight stubs that require a follow-up OData read for full detail.

How WooCommerce works

WooCommerce is self-hosted on the merchant's WordPress site, so each store has its own base URL under /wp-json/wc/v3/ that the connector accepts as a credential. It exposes orders, customers, products and variations, refunds, coupons, and tax rates as JSON over HTTPS, authenticated with a Consumer Key and Consumer Secret pair sent as HTTP Basic auth. WooCommerce pushes outbound webhooks on order, customer, product, and coupon create, update, and delete events, each signed with an HMAC-SHA256 signature in the X-WC-Webhook-Signature header. The REST API has no documented rate limit; the limiting factor is the merchant's own server.

What moves between them

The main flow runs from WooCommerce into Microsoft Dynamics 365 F&O. As orders are placed and paid, ml-connector reads the order, its line items, the customer, and any refunds, and writes a sales order and customer record into Dynamics, with the payment recorded against the customer payment journal. Product and price data flows the other direction: released products and prices in Dynamics are pushed out to keep the WooCommerce catalog and stock current. Order webhooks trigger the inbound work as soon as an order changes, and a scheduled OData poll backfills anything a webhook missed. Posted Dynamics ledger entries are read-only, so the connector creates sales orders and journals rather than writing posted vouchers.

How ml-connector handles it

ml-connector stores both credential sets encrypted and sends the WooCommerce Consumer Key and Secret as HTTP Basic auth on every store call, while requesting a fresh Entra ID bearer token for Dynamics and re-requesting it when a call returns 401, since client credentials issue no refresh token. On the Dynamics side it accepts the full environment host per customer and scopes every read and write to the correct legal entity with dataAreaId, adding cross-company where multiple entities are in play. WooCommerce webhooks are verified by computing base64 HMAC-SHA256 over the raw body and comparing it to X-WC-Webhook-Signature before processing. Because WooCommerce has no idempotency key, each order is checked by its order number or transaction id before a sales order is created, so a redelivered webhook does not double-post. SKUs map to Dynamics product numbers and Woo tax classes map to Dynamics dimensions, which are aligned first so every line lands on a valid item and account. Dynamics returns HTTP 429 with Retry-After under service protection limits, so the connector backs off and retries, and it watches for a WooCommerce webhook that auto-disables after five failed deliveries so a silent break becomes an alert. Every record carries a full audit trail and can be replayed if a downstream call fails.

A real-world example

A mid-sized consumer goods company sells direct to shoppers through a WooCommerce store and runs Microsoft Dynamics 365 F&O for inventory, fulfillment, and finance. Before the integration, a clerk exported web orders from WooCommerce each morning and re-keyed them into Dynamics as sales orders, and the storefront often showed items that were already out of stock because the catalog was updated by hand. With the two systems connected, each paid order posts into Dynamics automatically with the customer and payment attached, and released product and price changes in Dynamics push out to the store. The morning re-keying step is gone, stock the store shows matches what the ERP carries, and fulfillment starts from clean order data.

What you can do

  • Write WooCommerce orders into Microsoft Dynamics 365 F&O as sales orders with line items, customer, and payment attached.
  • Sync WooCommerce customers into Dynamics CustomersV3 and record refunds against the customer payment journal.
  • Push Dynamics released products and prices out to WooCommerce so the storefront catalog and stock stay current.
  • Bridge WooCommerce Consumer Key and Secret to the Entra ID OAuth token Dynamics requires, and verify each webhook by HMAC-SHA256.
  • React to WooCommerce order webhooks in near real time, with scheduled OData polling, retries, and a full audit trail as backstop.

Questions

Which direction does data move between Microsoft Dynamics 365 F&O and WooCommerce?
The main flow is WooCommerce into Dynamics: orders, customers, and refunds move into Dynamics as sales orders, customer records, and payment journal lines. Product and price data moves the other way, from Dynamics out to the WooCommerce catalog. Posted Dynamics ledger entries are read-only, so ml-connector creates sales orders and journals rather than writing posted vouchers back.
How does the integration bridge the two different authentication models?
WooCommerce uses a Consumer Key and Secret pair sent as HTTP Basic auth, while Microsoft Dynamics 365 F&O uses OAuth 2.0 client credentials through Microsoft Entra ID against a tenant-specific environment host. ml-connector stores both sets encrypted, sends the Woo key pair on each store call, and requests and refreshes the Dynamics bearer token as needed. The client credentials flow issues no refresh token, so the connector simply re-requests a token when one expires.
Does WooCommerce send purchase orders or GL accounts into Dynamics?
No. WooCommerce is an e-commerce platform with no native vendors, purchase orders, or chart of accounts. What it provides is order, customer, product, refund, and tax data, and ml-connector maps that into Dynamics as sales orders, customers, items, and payment journal lines. The accounting structure stays owned on the Dynamics side.

Related integrations

Connect Microsoft Dynamics 365 F&O and WooCommerce

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

Get started