ml-connector
Microsoft Dynamics 365 F&OMarketo

Microsoft Dynamics 365 F&O and Marketo integration

Microsoft Dynamics 365 F&O runs finance, sales, and supply chain. Marketo runs B2B marketing automation around leads, companies, and opportunities. Connecting the two keeps your marketing audience and your ERP customer base in agreement. Customer accounts and posted sales orders flow from Microsoft Dynamics 365 F&O into Marketo as companies and opportunities, while new leads captured in Marketo flow back to seed customer records. ml-connector handles the different APIs on each side and moves the data on a schedule you control.

How Microsoft Dynamics 365 F&O works

Microsoft Dynamics 365 F&O exposes customers, vendors, purchase orders, products, and general ledger entries through OData v4 REST data entities such as CustomersV3, SalesOrderHeadersV2, and MainAccounts, served from a tenant-specific host like contoso.operations.dynamics.com with no shared base URL. Authentication is OAuth2 client credentials through Microsoft Entra ID, returning a one-hour Bearer token. Outbound push uses the Business Events framework, which dispatches lightweight JSON stubs carrying identifiers and a ControlNumber rather than full records, so the consumer must call back to OData for detail. OData queries scope to one legal entity unless cross-company is set.

How Marketo works

Marketo exposes leads, companies, opportunities, sales persons, and custom objects through its REST API v1 on a Munchkin-ID subdomain such as 284-RPR-133.mktorest.com, with a separate identity endpoint for tokens. Authentication is OAuth2 client credentials issued by a Marketo Custom Service, producing a Bearer token that lasts up to one hour. Writes are field-value upserts keyed on email for leads, externalCompanyId for companies, and externalOpportunityId for opportunities, batched up to 300 records. Marketo has no inbound webhook for change events and most errors return HTTP 200 with a success flag of false, so reads are done by polling and parsing the response body.

What moves between them

The main flow runs from Microsoft Dynamics 365 F&O into Marketo. Customer accounts from CustomersV3 are upserted into Marketo as companies, keyed on externalCompanyId, and posted sales orders are upserted as opportunities, keyed on externalOpportunityId, so marketing sees who became a customer and what they bought. Leads created or updated in Marketo flow back into a staging area to seed prospective customer records in F&O. Reference values such as company name and account identifier are aligned so each Marketo record maps to a real F&O customer. Cadence is scheduled polling on both sides, since neither system pushes usable change events to a connector.

How ml-connector handles it

ml-connector stores both credential sets encrypted and bridges two OAuth2 client-credential flows: it requests an Entra ID token scoped to the F&O environment host and a separate Marketo identity token, refreshing each when a call returns 401 or, for Marketo, error code 602. It accepts the full F&O tenant URL per customer since there is no shared host, and reads CustomersV3 and SalesOrderHeadersV2 by OData with cross-company set for multi-entity tenants. Because Marketo has no inbound webhook and F&O Business Events only deliver identifier stubs, both directions run on scheduled polling, using updatedAt filters and paging tokens on the Marketo side and OData nextLink paging on the F&O side. The F&O customer account is mapped to Marketo externalCompanyId and the sales order number to externalOpportunityId so upserts deduplicate cleanly. A key gotcha: if the Marketo instance already has native Microsoft Dynamics CRM sync enabled, its companies, opportunities, and sales persons become read-only over the API, so ml-connector routes writes to leads and custom objects instead. Marketo rate limits return error code 606 and concurrency limits return 615, so it backs off with jitter, and every record carries a full audit trail with error replay.

A real-world example

A mid-sized industrial equipment distributor runs Microsoft Dynamics 365 F&O for order management and finance and uses Marketo for lead nurturing and customer marketing. Before the integration, the marketing team exported customer lists from F&O to a spreadsheet each month and re-imported them into Marketo, so campaigns went to stale accounts and recent buyers kept receiving prospecting emails meant for cold leads. With the two systems connected, new customer accounts and posted sales orders flow into Marketo automatically as companies and opportunities, and leads captured in Marketo land in F&O for sales follow-up. Marketing segments on current customer and purchase data instead of a month-old export, and the manual re-import step is gone.

What you can do

  • Upsert Microsoft Dynamics 365 F&O customer accounts into Marketo as companies, keyed on externalCompanyId.
  • Upsert posted F&O sales orders into Marketo as opportunities, keyed on externalOpportunityId.
  • Read new and updated Marketo leads back to seed prospective customer records in F&O.
  • Bridge the Microsoft Entra ID token and the Marketo identity token, refreshing each before expiry.
  • Poll both systems on a schedule with backoff on Marketo rate limits, plus a full audit trail and error replay.

Questions

Which direction does data move between Microsoft Dynamics 365 F&O and Marketo?
The main flow is Microsoft Dynamics 365 F&O into Marketo. Customer accounts become Marketo companies and posted sales orders become opportunities, while new leads created in Marketo flow back to seed customer records in F&O. Each side is read by scheduled polling, since neither pushes usable change events to a connector.
What happens if Marketo already has native Microsoft Dynamics sync turned on?
If a Marketo instance has native Dynamics CRM sync enabled, its companies, opportunities, and sales persons become read-only over the REST API. In that case ml-connector does not fight the native sync; it routes writes to Marketo leads and custom objects instead, and can still read the synced companies and opportunities for reporting back into F&O.
Why does the integration poll instead of using webhooks?
Marketo has no inbound webhook for change events, and its outbound webhooks only fire from Smart Campaign steps, which do not help a connector pulling data. Microsoft Dynamics 365 F&O Business Events deliver only lightweight identifier stubs that still require an OData callback. Because of this, ml-connector polls both systems on a schedule, using updatedAt filters and paging tokens on Marketo and OData nextLink paging on F&O.

Related integrations

Connect Microsoft Dynamics 365 F&O and Marketo

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

Get started