ml-connector
Microsoft Dynamics NAVCoupa

Microsoft Dynamics NAV and Coupa integration

Microsoft Dynamics NAV manages your core finance and procurement. Coupa manages your supplier relationships and spend. Connecting the two keeps your procurement records in agreement. Purchase orders created in NAV flow to Coupa for supplier visibility and invoice matching, and supplier invoices in Coupa post back to NAV without re-entry. ml-connector handles the authentication differences, polling vs webhooks, and a full audit trail on every record moved.

How Microsoft Dynamics NAV works

Microsoft Dynamics NAV exposes purchase orders, purchase invoices, vendors, GL accounts, dimensions, and general ledger entries through OData v4 REST or legacy SOAP APIs, with a base URL unique to each online or on-premises instance. Authentication is OAuth 2.0 client credentials via Microsoft Entra ID (required for Business Central online) or basic auth with a web service access key (deprecated). NAV supports both webhooks (3-day subscriptions with ~30 second batching) and polling. Webhooks are verified via a clientState field rather than HMAC, and subscriptions must be renewed before expiry. GL accounts are read-only; general ledger entries cannot be modified once posted. Purchase order creation and updates are available via OData, but the PurchaseOrders endpoint is not in the standard webhook list, so polling is required for order changes.

How Coupa works

Coupa is a cloud-based procurement platform that exposes suppliers, purchase orders, invoices, payments, and requisition events through REST API. Every call requires OAuth 2.0 client credentials and an X-Coupa-API-Version header. Coupa publishes six webhook event types: requisition-events, purchase-order-events, invoice-events, supplier-events, expense-report-events, and payment-events. Webhook payloads are verified via HMAC-SHA256 signature. Coupa enforces a 30-second request timeout per call and returns HTTP 429 or 5xx on rate limits; ml-connector backs off and retries up to 3 times with exponential backoff capped at 30 seconds. Webhook bodies are capped at 256KB.

What moves between them

Purchase orders flow from Microsoft Dynamics NAV to Coupa. When a PO is created or updated in NAV, ml-connector reads it via OData polling and posts it to Coupa, mapping NAV vendors to Coupa suppliers by external ID or exact name match. Invoices flow from Coupa back to NAV. When Coupa receives a supplier invoice, ml-connector reads the invoice via Coupa's webhook event stream, looks up the matching PO in NAV, and posts the invoice into NAV's purchase invoice journal, ready for approval and posting. Reference data such as vendors and suppliers are aligned in both directions so invoices land on the correct PO and cost allocation.

How ml-connector handles it

ml-connector polls Microsoft Dynamics NAV for purchase orders on a configurable schedule (typically daily or weekly) because purchase orders are not in NAV's standard webhook list. It authenticates NAV with OAuth 2.0 client credentials and accepts the instance URL per customer, since NAV online uses a tenant-specific base URL. For each new or changed PO, it creates or updates the matching record in Coupa via REST, mapping NAV vendor IDs to Coupa supplier IDs. On the Coupa side, ml-connector subscribes to purchase-order-events and invoice-events webhooks and verifies each incoming payload with HMAC-SHA256 signature verification. When an invoice event arrives, ml-connector retrieves the full invoice via Coupa REST, finds the matching PO in NAV, and creates a purchase invoice record in NAV's purchase invoice journal. Vendors and suppliers are pre-aligned in a mapping table so that cross-references resolve correctly. Because Coupa rate-limits at HTTP 429 and NAV may temporarily reject a record, ml-connector retries with exponential backoff and tracks every attempt in an audit log, so a failed invoice can be replayed when the downstream issue is resolved.

A real-world example

A mid-sized manufacturing distributor runs Microsoft Dynamics NAV for finance and procurement across three warehouses. They use Coupa to manage supplier relationships, enforce spend policies, and capture three-way invoice matches. Before the integration, the procurement team created purchase orders in NAV, emailed them to Coupa for visibility, and when supplier invoices arrived in Coupa, they had to re-enter the invoice details back into NAV's purchase invoice journal, a manual task that introduced typos and timing delays. With NAV and Coupa connected, every PO created in NAV appears in Coupa within hours, and incoming supplier invoices are automatically posted into NAV, ready for approval. The procurement team now focuses on policy exceptions rather than data re-entry, and finance closes the month faster because invoices are in NAV as soon as they land in Coupa.

What you can do

  • Sync purchase orders from Microsoft Dynamics NAV to Coupa, mapping NAV vendors to Coupa suppliers by ID or name.
  • Post supplier invoices from Coupa back into Microsoft Dynamics NAV's purchase invoice journal, matched to the original PO.
  • Align vendors and suppliers in both directions so invoices land on the correct purchase order and cost allocation.
  • Authenticate NAV with OAuth 2.0 and Coupa with OAuth 2.0 plus HMAC-SHA256 webhook signature verification.
  • Poll NAV on a schedule and subscribe to Coupa webhook events, with automatic rate-limit retries and a full audit trail on every record.

Questions

Why poll Microsoft Dynamics NAV for purchase orders instead of using webhooks?
Microsoft Dynamics NAV's standard webhook list does not include purchase orders, so polling is required to capture order changes. ml-connector polls NAV on a configurable schedule (daily or weekly) and detects new or updated orders, then syncs them to Coupa. Invoices from Coupa do arrive via webhook, so the return path is event-driven.
How does ml-connector handle the different authentication methods between NAV and Coupa?
Microsoft Dynamics NAV uses OAuth 2.0 client credentials via Microsoft Entra ID for online instances, which ml-connector stores encrypted and uses to request access tokens on a refresh schedule. Coupa uses OAuth 2.0 client credentials plus an X-Coupa-API-Version header. ml-connector manages both credential sets independently and refreshes tokens automatically when they expire or when Coupa returns a 401 response.
What happens if a purchase invoice from Coupa fails to post into Microsoft Dynamics NAV?
ml-connector logs the failure in its audit trail and retries the post with exponential backoff (up to 3 attempts, capped at 30 seconds) in case the issue is transient. If the invoice ultimately fails, it remains in the audit log and can be replayed manually or triggered by a webhook retry once the downstream issue is resolved.

Related integrations

Connect Microsoft Dynamics NAV and Coupa

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

Get started