ml-connector
Microsoft Dynamics NAVShopify

Microsoft Dynamics NAV and Shopify integration

Shopify runs your online store and takes orders. Microsoft Dynamics NAV runs your finance and operations. Connecting them keeps your ERP ledgers in sync with online sales, eliminates manual order re-entry, and gives your accounting team real-time visibility into web revenue. New Shopify orders automatically create matching sales orders in NAV, customers stay aligned, and revenue GL entries post on schedule without re-keying.

How Microsoft Dynamics NAV works

Shopify exposes orders, customers, transactions, refunds, inventory levels, and fulfillments through the Shopify Admin API, available as GraphQL (preferred) or REST (legacy). Authentication uses OAuth 2.0 with long-lived offline tokens (prefix shpat_), which do not expire. Shopify pushes order and customer events via webhooks for orders/create, orders/updated, customers/create, customers/update, and related topics. Each webhook carries a unique X-Shopify-Webhook-Id for deduplication. Shopify has no native purchase order or vendor object, and no general ledger, so the integration reads orders and customers only. API versions are date-based with quarterly releases and a 12-month support window.

How Shopify works

Microsoft Dynamics NAV exposes sales orders, customers, vendors, GL accounts, GL entries, items, and dimensions through OData v4 REST or legacy SOAP, with base URLs specific to the tenant (online) or on-premises instance. Authentication is OAuth 2.0 client credentials via Microsoft Entra ID for Business Central online, or OAuth 2.0 or basic auth with web service access key for on-premises. NAV supports webhooks on select entities (including salesOrders, customers, and generalLedgerEntries) with 3-day expiry and per-record or batch notifications. GL accounts and GL entries are read-only and immutable once posted. On-premises requires administrator setup to enable OData services and firewall access to port 7048. Webhooks expire after 3 days and must be renewed before expiry.

What moves between them

Orders flow from Shopify into Microsoft Dynamics NAV. ml-connector reads Shopify orders via GraphQL webhook push and direct API pull, creates matching sales orders in NAV with customer, line items, and amounts. Customer records sync in both directions so NAV customer master reflects Shopify billing and shipping profiles. After each order is posted in NAV, ml-connector posts the revenue GL entry to the sales GL account, mapped to the correct dimension if applicable. Shopify has no GL ledger, so GL entries flow one way only, into NAV.

How ml-connector handles it

ml-connector stores both OAuth tokens encrypted and uses Shopify's GraphQL API endpoint with offline tokens that do not expire, reducing renewal overhead. For Microsoft Dynamics NAV, it detects whether the customer uses Business Central online or on-premises, assembles the correct base URL and tenant ID, and authenticates with OAuth 2.0 via Entra ID. It subscribes to Shopify webhooks for orders/create and orders/updated, and also polls the Shopify GraphQL API on a daily schedule to catch orders that webhook delivery may have missed (webhook guarantees are eventual, not immediate). For each order, it maps Shopify line items to NAV sales order lines, looks up or creates the customer in NAV if needed, and constructs a sales order document. After the sales order is posted, it polls NAV to wait for the GL entry to be posted, then mirrors it back via the audit trail for replay. NAV webhook subscriptions expire after 3 days, so ml-connector does not rely on NAV webhooks; instead it polls NAV sales orders on the same daily schedule. The integration stores webhook IDs for deduplication so a retransmitted Shopify webhook does not create duplicate orders.

A real-world example

A mid-sized retail wholesaler runs Shopify for their B2B e-commerce site and Microsoft Dynamics NAV Business Central for order fulfillment and accounting. Orders come in 24/7 from distributors and franchisees, and before the integration the operations team manually keyed each order into NAV once per day, a process that introduced typos and held up picking by a day. Revenue was posted to a suspense GL account and manually reclassified during close. With Shopify and NAV connected, orders flow into NAV within minutes of checkout, line items are mapped to inventory, and the revenue GL entry posts automatically. The accounting team sees real-time revenue on the dashboard, and operations starts picking orders immediately without waiting for the daily batch entry.

What you can do

  • Create Microsoft Dynamics NAV sales orders automatically from Shopify orders, with items, quantities, and customer details mapped from Shopify.
  • Keep NAV customer records in sync with Shopify customers, including billing and shipping address updates.
  • Post revenue GL entries to the correct sales GL account in NAV after each order is confirmed, with optional dimension allocation.
  • Bridge Shopify GraphQL webhooks with NAV OData API, handle token expiry and renewal, poll for missed events, and deduplicate via Shopify webhook ID.
  • Replay orders from the audit trail if a downstream GL post fails, with full error context and recovery steps.

Questions

Does ml-connector handle the different auth models between Shopify and Microsoft Dynamics NAV?
Yes. Shopify uses OAuth 2.0 with long-lived offline tokens (prefix shpat_) that do not expire. NAV uses OAuth 2.0 via Microsoft Entra ID for Business Central online, or OAuth 2.0 or basic auth with a web service access key for on-premises. ml-connector stores all credentials encrypted and detects the NAV deployment type to select the correct auth flow.
Why does ml-connector poll if Shopify webhooks are available?
Shopify webhook delivery is eventual and can be delayed or lost in rare cases. ml-connector subscribes to webhooks for real-time push, but also polls the Shopify GraphQL API on a daily schedule to catch any orders that webhooks may have missed. Webhook IDs enable deduplication so a retransmitted event does not create duplicate orders.
Can ml-connector handle on-premises Microsoft Dynamics NAV?
Yes. For on-premises NAV, ml-connector accepts the instance URL and port (default OData port 7048) and authenticates with OAuth 2.0 or basic auth as configured by the NAV administrator. The integration works the same way; the only difference is that the customer must ensure OData is enabled in NAV Server Administration and port 7048 is open through the firewall.

Related integrations

Connect Microsoft Dynamics NAV and Shopify

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

Get started