ml-connector
Microsoft Dynamics 365 F&OStampli

Microsoft Dynamics 365 F&O and Stampli integration

Microsoft Dynamics 365 F&O runs financials, procurement, and the general ledger. Stampli captures vendor invoices, runs approval workflows, and matches bills to purchase orders. Connecting the two means approved bills leave Stampli and land in D365 F&O as vendor invoices without re-keying, while the vendor master, chart of accounts, open POs, and financial dimensions stay aligned so AP staff code against real values. Because Stampli publishes no public API, ml-connector moves this data through file exchange on the Stampli side and through OData entities on the D365 side. The general ledger stays in D365 F&O, where it is the source of truth.

How Microsoft Dynamics 365 F&O works

Microsoft Dynamics 365 F&O exposes vendors, vendor invoice headers and lines, purchase orders, GL main accounts, posted journal entries, and financial dimension values through OData v4 REST entities at a tenant-specific environment host such as contoso.operations.dynamics.com. Every call uses a Microsoft Entra ID OAuth 2.0 client-credentials bearer token, scoped to that environment, refreshed roughly hourly. OData uses server-driven paging up to 10,000 records with an odata.nextLink follow URL, and entity keys must be fully specified, including dataAreaId for the legal entity. D365 can push outbound Business Events, but these are lightweight stubs that require a follow-up OData read; finance records are normally read by polling. Posted vendor invoices are read-only, so writes must happen before posting.

How Stampli works

Stampli is a closed AP automation platform with no public REST API, no developer portal, and no self-serve credential issuance. The only integration path open without a formal Stampli partnership is file-based exchange: customer-defined CSV or XML templates moved over SFTP or manual upload. Stampli exports approved invoices and payment status outbound, and imports vendors, GL accounts, purchase orders, and accounting dimensions inbound to drive its coding and matching UI. Stampli has no documented outbound webhooks, so new exported files are detected by polling its outbound SFTP directory on a schedule. Stampli runs built-in duplicate detection on invoices, but a file-based connector must still track which files and invoice IDs it has processed.

What moves between them

The primary flow runs from Stampli into Microsoft Dynamics 365 F&O. As bills clear approval in Stampli, ml-connector reads the exported invoice files and posts them into D365 F&O as VendorInvoiceHeaders and VendorInvoiceLines, with GL coding and cost centers carried as financial dimension display strings. Reference data flows the other direction: the D365 vendor master, GL main accounts, open purchase orders, and dimension values are exported and imported into Stampli so each bill is coded and matched against real D365 records. Payment status that Stampli reports is read back to keep AP in step. The general ledger and posted journals stay read-only in D365, so ml-connector never writes ledger entries from Stampli.

How ml-connector handles it

ml-connector stores both credential sets encrypted. On the D365 side it requests a Microsoft Entra ID OAuth 2.0 client-credentials token scoped to the environment host, refreshes it when a call returns 401, and addresses each VendorsV2 or VendorInvoiceHeader entity by its full key including dataAreaId for the correct legal entity. On the Stampli side, because no public API exists, it reads and writes customer-defined CSV or XML files over SFTP, polling the outbound directory on a schedule, since Stampli has no outbound webhooks. Vendors, GL accounts, and dimensions are mapped first and exported into Stampli so every approved bill codes against values that already exist in D365. Financial dimensions are passed to D365 as formatted display strings, so the integrating-application dimension format must be configured first or the write fails. Because the invoice header must be created before its lines and OData has no idempotency key, ml-connector creates the header, then the lines, and dedupes on the natural key of InvoiceNumber plus VendorAccount along with a BullMQ jobId so a re-read Stampli file does not double-post. D365 service protection returns HTTP 429 with a Retry-After header, which ml-connector honors with backoff; for large vendor or dimension loads it can fall back to the async Data Management package API, which is exempt from OData rate limits. Every record carries a full audit trail and can be replayed if a downstream call fails.

A real-world example

A mid-sized manufacturer with roughly 600 employees runs Microsoft Dynamics 365 F&O for finance and procurement across three legal entities and adopts Stampli so department approvers can review and code vendor invoices in one place. Before the integration, the AP team exported approved invoices from Stampli and keyed each one into D365 by hand, picking the vendor, GL account, and cost center manually, which slowed month-end close and produced miscoded lines that had to be corrected after posting. With Microsoft Dynamics 365 F&O and Stampli connected, the D365 vendor master, GL accounts, and dimensions are pushed into Stampli so coding uses real values, and each approved bill flows back into D365 as a vendor invoice mapped to the right legal entity and dimensions. The re-keying step is gone and AP closes against clean, pre-coded invoices.

What you can do

  • Post approved Stampli bills into Microsoft Dynamics 365 F&O as vendor invoice headers and lines before posting.
  • Export the D365 vendor master, GL main accounts, open purchase orders, and dimensions into Stampli for coding and matching.
  • Bridge Microsoft Entra ID OAuth 2.0 on the D365 side with file-based SFTP exchange on the Stampli side.
  • Map financial dimensions to D365 display strings and dedupe on InvoiceNumber plus VendorAccount with a jobId.
  • Poll the Stampli outbound directory on a schedule, honor D365 429 Retry-After backoff, and audit every record.

Questions

Which direction does data move between Microsoft Dynamics 365 F&O and Stampli?
The primary flow is Stampli into Microsoft Dynamics 365 F&O. Approved invoice files move from Stampli into D365 as vendor invoice headers and lines, while vendors, GL accounts, open purchase orders, and dimensions move the other way to drive coding and matching in Stampli. Posted journals and the general ledger stay read-only in D365, so ml-connector never writes ledger entries back from Stampli.
How does ml-connector integrate with Stampli when Stampli has no public API?
Stampli is a closed platform with no public REST API, developer portal, or self-serve credentials. The only path available without a formal partnership is file-based exchange, so ml-connector reads and writes customer-defined CSV or XML files over SFTP. Because Stampli publishes no outbound webhooks, ml-connector polls its outbound directory on a schedule to detect new approved-invoice files.
What special setup does the Dynamics 365 F&O side require?
D365 F&O uses Microsoft Entra ID OAuth 2.0 client credentials scoped to your tenant-specific environment host, so a registered Entra app with Dynamics ERP permissions and a service account is required. Vendor invoice entity keys must include the dataAreaId for the right legal entity, and financial dimensions are written as formatted display strings, which means the integrating-application dimension format must be configured before the first write or the write fails.

Related integrations

Connect Microsoft Dynamics 365 F&O and Stampli

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

Get started