ml-connector
Sage 50Microsoft Dynamics 365 Sales

Sage 50 and Microsoft Dynamics 365 Sales integration

Sage 50 runs your desktop accounting and general ledger. Microsoft Dynamics 365 Sales manages your customer relationships and sales pipeline in the cloud. Connecting the two keeps your customer list and sales orders aligned across both systems. New opportunities won in Dynamics 365 Sales can flow into Sage 50 as sales orders and invoices, and customer master records stay consistent so billing addresses and contact details match on both sides.

How Sage 50 works

Sage 50 is a desktop-installed accounting application available in US (formerly Peachtree Accounting) and UK (formerly Sage Line 50) editions. It exposes customers, vendors, sales invoices, purchase invoices, sales orders, purchase orders, general journal entries, GL accounts, and inventory items through a Windows-native SDK rather than a REST API. The US edition uses the Sage 50 .NET SDK or legacy COM/ODBC interfaces; the UK edition uses Sage Data Objects (SDO) COM/ActiveX DLLs. Authentication is Windows-local: username and password against the Sage 50 user database, along with the application ID and company data path (US) or data path (UK). Sage 50 has no webhooks or event stream; integration is polling-only by querying modified records via LastModifiedDate or TransactionDate, with a recommended poll interval of 5 to 15 minutes for near-real-time sync.

How Microsoft Dynamics 365 Sales works

Microsoft Dynamics 365 Sales is a cloud-based CRM built on Microsoft Dataverse. It exposes accounts, contacts, leads, opportunities, quotes, sales orders, invoices, products, and price levels through OData v4.0 REST API at https://{org-name}.api.crm.dynamics.com/api/data/v9.2/. Authentication is OAuth 2.0 via Microsoft Entra ID using Client Credentials flow for server-to-server integrations. Tokens expire in approximately 60 minutes. The platform supports webhooks via the Dataverse Event Framework for Create, Update, Delete, and custom actions like ConvertQuoteToSalesOrder and GenerateInvoiceFromOrder. Webhook delivery has a 256 KB payload limit and uses a shared secret (WebhookKey or HttpHeader) for authentication rather than HMAC. Synchronous webhooks have a 60-second timeout with one automatic retry for 502/503/504 errors.

What moves between them

The main flow is from Microsoft Dynamics 365 Sales into Sage 50. When a quote is won or a sales order is created in Dynamics 365 Sales, ml-connector receives a webhook notification, translates the order into Sage 50 sales-order format, and creates it in the Sage 50 accounting system via the SDK. Customer account records flow from Dynamics 365 Sales into Sage 50 so new accounts become customers in the accounting system. Sage 50 customer and sales order data is polled on a schedule to keep Dynamics 365 Sales aligned with any changes made directly in Sage 50. GL accounts and invoices remain read-only in Dynamics 365 Sales since it does not natively support accounting dimensions or financial posting.

How ml-connector handles it

ml-connector runs a Windows process with access to the Sage 50 data files (either local or on a shared network path) and authenticates to Sage 50 using the integration user's Windows credentials and the company data path. On the Dynamics 365 Sales side, it authenticates via OAuth2 Client Credentials against Microsoft Entra ID and registers a webhook endpoint to receive real-time notifications when quotes are converted, orders are created, or accounts are modified. When a webhook arrives from Dynamics 365 Sales, ml-connector maps the quote or order structure (including line items, quantities, and customer references) to Sage 50 sales-order entities and calls the SDK to create them. If the customer does not yet exist in Sage 50, ml-connector creates the customer record first. Polling runs on a configurable schedule (typically hourly) to read Sage 50 customers and sales orders via LastModifiedDate and sync any changes back to Dynamics 365 Sales. The Windows process must have exclusive access to Sage 50 (no interactive user logged in), and the Entra ID token is refreshed automatically when it nears expiry. Every record carries an audit trail and can be replayed if a downstream call fails.

A real-world example

A mid-sized wholesale distributor uses Sage 50 on a Windows machine for accounting, GL, and customer master data. Sales staff use Microsoft Dynamics 365 Sales in the cloud to manage customer relationships, track opportunities, and generate quotes. Before the integration, once a quote was won in Dynamics 365 Sales, the sales admin had to manually re-enter the order details into Sage 50, often with transcription errors or mismatched customer records. With Sage 50 and Dynamics 365 Sales connected, a won quote triggers an automatic order creation in Sage 50, the customer record is verified against Sage 50's master, and the sales team can see in Dynamics 365 Sales when the order has been invoiced in accounting. Month-end reconciliation is faster because customer and order records are consistent across both systems.

What you can do

  • Create sales orders in Sage 50 when quotes are won or orders are created in Microsoft Dynamics 365 Sales.
  • Sync customer account records from Dynamics 365 Sales into Sage 50 so new CRM accounts become billing customers.
  • Poll Sage 50 on a schedule to read customer and sales order changes and sync them back to Dynamics 365 Sales.
  • Authenticate Sage 50 via Windows SDK credentials and Dynamics 365 Sales via OAuth2 Microsoft Entra ID, with automatic token refresh.
  • Track every record with a full audit trail and replay failed syncs if a webhook or polling call does not complete.

Questions

Which direction does data move between Sage 50 and Microsoft Dynamics 365 Sales?
The main flow is from Dynamics 365 Sales into Sage 50. Quotes and sales orders created in Dynamics 365 Sales become sales orders in Sage 50, and customer accounts flow from Dynamics 365 Sales into Sage 50's customer master. Sage 50 customer and order data is polled on a schedule to keep both systems aligned. GL accounts and invoices remain in Sage 50 only since Dynamics 365 Sales does not support accounting dimensions.
Does Sage 50's Windows SDK requirement mean the integration needs a dedicated machine?
Yes. Sage 50 integration runs via a local Windows SDK that requires direct access to the company data files on the same machine or LAN. The integration process must have exclusive access to Sage 50 (no interactive user logged in simultaneously), and the Windows machine must remain running so polling can continue on schedule. Many customers run this on a dedicated server or always-on workstation.
How does ml-connector handle the different authentication models?
ml-connector authenticates to Sage 50 using Windows credentials and the company data path via the SDK, with no token management. For Dynamics 365 Sales, it uses OAuth2 Client Credentials flow against Microsoft Entra ID, stores the token in memory, and automatically refreshes it when it nears the 60-minute expiry. Webhook payloads from Dynamics 365 Sales are verified using the registered shared secret.

Related integrations

Connect Sage 50 and Microsoft Dynamics 365 Sales

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

Get started