ml-connector
Microsoft Dynamics 365 Business CentralBasware

Microsoft Dynamics 365 Business Central and Basware integration

Microsoft Dynamics 365 Business Central runs finance, purchasing, and the general ledger. Basware captures supplier invoices and runs them through coding, matching, and approval. Connecting the two means an invoice that clears approval in Basware lands as a posted purchase invoice in Business Central without re-keying, against the vendor, GL accounts, and dimensions it was coded to. Master data flows the other way so the Basware coding panel only ever offers valid Business Central values, and payment status flows back so an invoice paid in Business Central shows as paid in Basware. ml-connector handles the different auth on each side and moves each record on a schedule you control or as Basware signals an invoice is ready.

How Microsoft Dynamics 365 Business Central works

Microsoft Dynamics 365 Business Central exposes vendors, purchase invoices, purchase orders, GL accounts, general ledger entries, dimensions, and payment journals through the Business Central API v2.0, a REST surface built on OData v4. Resources nest under a company id on a tenant environment URL, and the connector authenticates with the OAuth2 client credentials grant through Microsoft Entra ID using a registered app with the API.ReadWrite.All application permission. Purchase invoices are created as drafts and then posted with the bound Microsoft.NAV.post action, while the chart of accounts and general ledger entries are read-only over the API. Business Central can push change notifications by subscription, but those notifications expire every three days, carry no payload, and exclude purchase orders.

How Basware works

Basware exposes accounting documents, purchase orders, purchase requisitions, vendors, GL accounts, dimensions, and matching order lines through its P2P REST API, which is region-specific so the base URL and token endpoint depend on whether the customer instance is EU, US, AU, or CA. It authenticates with OAuth2 client credentials, sending the client id and secret as HTTP Basic auth to the token endpoint and receiving a bearer token that is valid for about one hour with no refresh token. Approved and coded invoices are read from the accounting documents endpoint, and master data such as vendors, accounts, and dimensions is written by import. Basware can push a signed webhook when an invoice is ready for transfer, and accepts transfer and payment response callbacks so the ERP can confirm what it did.

What moves between them

The primary flow runs from Basware into Microsoft Dynamics 365 Business Central. When an invoice finishes coding, matching, and approval in Basware and is marked waiting for transfer, ml-connector reads the accounting document with its header, lines, and coding lines, creates the matching draft purchase invoice in Business Central against the right vendor, GL accounts, and dimensions, and posts it with the bound post action. Master data flows the other way: vendors, GL accounts, and dimensions are imported from Business Central into Basware so its coding panel only offers values that exist in the ledger. Once Business Central records payment of the bill, ml-connector calls the Basware payment response callback so the invoice shows as paid on both sides.

How ml-connector handles it

ml-connector stores both credential sets encrypted and holds a Microsoft Entra ID client credentials token for the Business Central tenant, targeting the company id on the configured environment name, while on the Basware side it requests a region-specific OAuth2 bearer token, refreshing it before the roughly one-hour expiry since there is no refresh token. Work is triggered by the Basware accounting documents webhook, whose payload is verified against the X-BWAPI-Signature-256 HMAC-SHA256 header over the raw UTF-8 body before anything is processed, and a scheduled poll backs it up in case a notification is missed. Each Basware invoice is created in Business Central as a draft purchase invoice and then posted with the bound Microsoft.NAV.post action, so vendors, GL accounts, and dimensions are imported into Basware first to guarantee every coding line maps to a value that already exists in the ledger. After a successful post the connector calls the Basware transfer response callback so the document is not transferred twice, and a stable job id derived from the Basware document id deduplicates retries. Two Basware quirks are handled directly: its continuation token is returned and sent as a request header rather than a query parameter when paging, and an import that is byte-for-byte identical to the last one is silently skipped, so a real field must change to retrigger a master data record. Business Central purchase orders carry no webhook, so any PO sync is done by polling. Every record carries a full audit trail and can be replayed if a downstream call fails.

A real-world example

A mid-sized manufacturer of about six hundred staff runs Microsoft Dynamics 365 Business Central for finance and purchasing and processes several thousand supplier invoices a month through Basware. Before the integration, an AP clerk opened each approved invoice in Basware and re-keyed the header, lines, and coding into Business Central, which was slow and a steady source of posting errors, and vendors and GL accounts drifted out of sync so coders picked accounts that no longer existed. With the two systems connected, an approved invoice in Basware posts itself into Business Central against the coded vendor, accounts, and dimensions, vendor and account updates flow from Business Central into Basware automatically, and a paid bill closes out on both sides. The manual re-keying step is gone and month-end close starts from data that already agrees.

What you can do

  • Read approved and coded invoices from Basware once they are ready for transfer and post them as purchase invoices in Microsoft Dynamics 365 Business Central.
  • Confirm each handoff with a Basware transfer response so no document is transferred twice.
  • Import vendors, GL accounts, and dimensions from Business Central into Basware so coders only see valid values.
  • Send a payment response to Basware once Business Central pays the bill so the invoice closes on both sides.
  • Verify Basware webhooks by HMAC-SHA256, bridge the Entra ID and region-specific Basware tokens, and keep a full audit trail on every record.

Questions

Which direction does data move between Microsoft Dynamics 365 Business Central and Basware?
Invoices move from Basware into Business Central, where an approved and coded document becomes a posted purchase invoice. Vendors, GL accounts, and dimensions move the other way, from Business Central into Basware, so coding always references valid ledger values. Payment confirmation also flows back into Basware once Business Central pays the bill.
How does ml-connector know when a Basware invoice is ready to post?
Basware sends a signed webhook when an accounting document is approved and waiting for transfer, and ml-connector verifies the X-BWAPI-Signature-256 HMAC-SHA256 header over the raw UTF-8 body before acting on it. A scheduled poll runs alongside the webhook so an invoice is still picked up if a notification is missed. After the invoice is posted in Business Central, the connector sends a transfer response so the same document is not transferred again.
What happens to manual edits and unchanged records when master data is imported into Basware?
Basware treats imported records as managed by the integration, so a later import overwrites manual edits made in the Basware UI and there is no merge step. Business Central stays the system of record for vendors, accounts, and dimensions. Basware also silently skips an import that is identical to the last one, so a field has to actually change for a record to be reprocessed.

Related integrations

Connect Microsoft Dynamics 365 Business Central and Basware

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

Get started