ml-connector
Microsoft Dynamics 365 F&OTrueCommerce

Microsoft Dynamics 365 F&O and TrueCommerce integration

Microsoft Dynamics 365 F&O runs your finance, procurement, and supply chain. TrueCommerce handles EDI exchange with retailers and distributors. Connecting the two lets inbound retailer purchase orders become sales orders in Dynamics, and lets Dynamics invoices and ship notices flow out to trading partners as EDI documents without re-keying. ml-connector reads and writes Dynamics OData entities, translates them to and from the X12 transaction sets TrueCommerce uses, and moves files on a schedule you control.

How Microsoft Dynamics 365 F&O works

Microsoft Dynamics 365 F&O exposes its data through an OData v4 REST service at a tenant-specific host such as contoso.operations.dynamics.com/data. Key entities for trading include CustomersV3, PurchaseOrderHeadersV2 and PurchaseOrderLines, VendorInvoiceHeaders and lines, ReleasedProductsV2, and the sales and shipment entities. Authentication uses OAuth 2.0 client credentials through Microsoft Entra ID against a per-environment scope, with tokens that expire about hourly. OData reads support server-driven paging up to 10,000 records with @odata.nextLink, and service protection returns HTTP 429 with a Retry-After header. Dynamics can also push lightweight Business Events such as purchase order confirmed or invoice posted to an HTTPS endpoint, but those payloads carry only identifiers and require a follow-up OData call for full detail.

How TrueCommerce works

TrueCommerce is EDI and supply chain middleware, not an ERP, so it has no CRUD REST entity model. It exchanges X12 transaction sets with trading partners, most commonly through flat files (CSV, XML, or JSON) dropped to its hosted SFTP server at integrationftp.truecommerce.com on port 22. The relevant documents are inbound 850 purchase orders and 860 changes and 820 remittance advice, and outbound 855 acknowledgments, 810 invoices, 856 advance ship notices, and 846 inventory. Credentials are provisioned by TrueCommerce during onboarding, typically an SFTP username and password. TrueCommerce is pull-based with no reliable self-serve webhook, so the supported pattern is a scheduled poll of the drop folders, with file naming and ISA sender and receiver IDs configured per customer.

What moves between them

Documents move in both directions. Inbound, ml-connector polls the TrueCommerce SFTP folders for 850 purchase orders and 860 changes from retailers and writes them into Dynamics as sales orders, with 820 remittance advice read in for cash application. Outbound, ml-connector reads Dynamics records and posts them to TrueCommerce as EDI files: invoices as 810, shipments as 856 advance ship notices, order acknowledgments as 855, and stock levels as 846 inventory advice. Inbound polling runs at least hourly because TrueCommerce does not push, and outbound files are sent as Dynamics records are confirmed or posted, optionally triggered by a Business Event.

How ml-connector handles it

ml-connector stores both credential sets encrypted. On the Dynamics side it requests an Entra ID OAuth token with client credentials, scoped to the customer's environment host, and refreshes it when a call returns 401. On the TrueCommerce side it logs in to the hosted SFTP server with the provisioned username and password and reads or writes files in the per-customer drop folders. Field mapping is per trading partner and per document type: Dynamics OData fields are translated to and from X12 segments, so a Dynamics purchase or sales order maps to an 850 and a Dynamics invoice maps to an 810. Because Dynamics entity keys must be fully specified, lookups carry both the natural key and the dataAreaId legal entity. Edge cases handled include Dynamics 429 service protection with Retry-After backoff, the tenant-specific host taken as a credential since there is no shared base URL, vendor invoice writes that are allowed only before posting, and confirmed file naming and ISA IDs since those are not standardized across customers. TrueCommerce confirms receipt with 997 functional acknowledgments, and ml-connector keeps a full audit trail so any failed file can be replayed.

A real-world example

A mid-sized consumer goods supplier with about 200 staff sells to several large grocery and big-box retailers, all of which mandate EDI. The supplier runs Microsoft Dynamics 365 F&O for orders, inventory, and finance, and uses TrueCommerce as its EDI provider. Before the integration, a coordinator printed retailer 850 orders from the TrueCommerce portal and keyed them into Dynamics by hand, then re-typed invoice and ship-notice data back into the portal to send 810 and 856 documents, which caused chargebacks when an ASN was late or a field was wrong. With Microsoft Dynamics 365 F&O and TrueCommerce connected, inbound orders post automatically as Dynamics sales orders and outbound invoices and ship notices are sent as compliant EDI as soon as they are confirmed, so the manual step is gone and EDI compliance fines drop.

What you can do

  • Write inbound TrueCommerce 850 purchase orders and 860 changes into Microsoft Dynamics 365 F&O as sales orders.
  • Send Dynamics invoices, ship notices, and acknowledgments to TrueCommerce as 810, 856, and 855 EDI documents.
  • Read 820 remittance advice from TrueCommerce into Dynamics to support cash application.
  • Bridge Microsoft Entra ID OAuth on Dynamics and SFTP login on TrueCommerce, mapping OData fields to X12 segments per trading partner.
  • Poll the TrueCommerce drop folders on a schedule, with Retry-After backoff, a full audit trail, and replay on failure.

Questions

Which records move between Microsoft Dynamics 365 F&O and TrueCommerce?
Documents move in both directions. Inbound 850 purchase orders, 860 changes, and 820 remittance advice flow from TrueCommerce into Dynamics, and outbound 810 invoices, 856 advance ship notices, 855 acknowledgments, and 846 inventory flow from Dynamics out to trading partners through TrueCommerce. ml-connector maps Dynamics OData entity fields to and from the matching X12 segments for each trading partner.
How does the integration get data out of Dynamics and into TrueCommerce?
ml-connector authenticates to Dynamics with OAuth 2.0 client credentials through Microsoft Entra ID and reads or writes records over the OData v4 service. It translates those records to X12 flat files and drops them on the TrueCommerce hosted SFTP server using the username and password TrueCommerce provisions. TrueCommerce then translates and forwards the documents to the trading partner and returns 997 functional acknowledgments.
Does this use webhooks or polling?
Mostly polling. TrueCommerce is pull-based with no reliable self-serve webhook, so ml-connector polls the SFTP drop folders on a schedule, at least hourly, to pick up inbound orders. On the Dynamics side outbound sends can be triggered by a Business Event such as invoice posted, though those events carry only identifiers and require a follow-up OData call for the full record.

Related integrations

Connect Microsoft Dynamics 365 F&O and TrueCommerce

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

Get started