ml-connector
Microsoft Dynamics 365 Business CentralChargebee

Microsoft Dynamics 365 Business Central and Chargebee integration

Chargebee runs recurring billing and subscriptions; Microsoft Dynamics 365 Business Central runs finance and the general ledger. Connecting the two moves billed revenue into the ERP without re-keying. Chargebee invoices become Business Central sales invoices, Chargebee payments are recorded against those invoices, and credit notes post as sales credit memos. ml-connector keeps the customer record aligned on both sides so every billing document lands on the right account.

How Microsoft Dynamics 365 Business Central works

Microsoft Dynamics 365 Business Central exposes customers, sales invoices, sales orders, customer payment journals, GL accounts, dimensions, and items through a REST API built on OData v4, scoped under a company and an environment name in the URL. It authenticates with OAuth2 client credentials issued by a Microsoft Entra app registration, using the api.businesscentral.dynamics.com scope. Sales invoices are created as drafts and posted with the bound Microsoft.NAV.post action. It supports push subscriptions for entities like customers, salesInvoices, and customerPaymentJournals, but notifications are change signals only and carry no payload, so the resource must be fetched after each notification, and subscriptions expire every three days unless renewed.

How Chargebee works

Chargebee exposes customers, subscriptions, invoices, payments and transactions, credit notes, items, and item prices through a REST API. It authenticates with HTTP basic auth where the site API key is the username and the password is empty, scoped to a single site and region whose subdomain is derived from the site name. Reads use offset-based pagination capped at 100 records per page. Chargebee pushes outbound webhooks for events such as invoice_generated, payment_succeeded, and credit_note_created, but uses no HMAC signature; the recommended pattern is to re-fetch the event by id rather than trust the pushed body.

What moves between them

The main flow runs from Chargebee into Microsoft Dynamics 365 Business Central. Posted Chargebee invoices are created as Business Central sales invoices and posted, successful Chargebee payments are recorded as customer payments applied to the matching invoice, and Chargebee credit notes post as sales credit memos. Chargebee customers are matched to Business Central customers so every document references an existing account, with new billing customers created in the ERP when no match exists. Business Central holds the general ledger, so ml-connector does not write financial entries back to Chargebee; the GL is the accounting destination and Chargebee remains the billing source of record.

How ml-connector handles it

ml-connector stores both credential sets encrypted. For Chargebee it sends the site API key as basic auth on every request, keeping the mandatory trailing colon and selecting the us, eu, or au base URL from the configured region. For Microsoft Dynamics 365 Business Central it requests an Entra client-credentials token, refreshes it on a 401, and builds the company-scoped URL from the stored environment name. Chargebee invoice and payment webhooks trigger the work, and because Chargebee signs nothing, each event is re-fetched by id before processing and deduplicated on the Chargebee event id. A scheduled poll using a lastModifiedDateTime filter backfills anything a webhook missed. Each sales invoice is created as a draft and then posted with Microsoft.NAV.post, since posting is a separate state change. Customers are matched first so every invoice, payment, and credit memo lands on a valid account, and Chargebee Unix-epoch timestamps are converted to the ERP datetime format. Business Central rate limits return HTTP 429 and Chargebee returns 429 with a Retry-After header, so ml-connector backs off and retries, renews the three-day Business Central subscriptions before they expire, and keeps a full audit trail with error replay on every record.

A real-world example

A roughly 120-person B2B SaaS company bills monthly and annual subscriptions in Chargebee and keeps its books in Microsoft Dynamics 365 Business Central. Before the integration, accounting exported Chargebee invoice and payment reports each week and re-keyed the totals into the ERP, then spent the first days of month-end close chasing the difference between billed revenue in Chargebee and posted AR in Business Central. With the two connected, each posted Chargebee invoice becomes a Business Central sales invoice automatically, payments are applied as they succeed, and credit notes flow through as credit memos. Month-end close starts with AR already matching the billing system and the weekly re-keying step is gone.

What you can do

  • Create and post Chargebee invoices into Microsoft Dynamics 365 Business Central as sales invoices.
  • Record successful Chargebee payments as Business Central customer payments applied to the matching invoice.
  • Post Chargebee credit notes into Business Central as sales credit memos.
  • Match and align customers across both systems so every billing document lands on a valid account.
  • React to Chargebee webhooks by re-fetching each event, with scheduled polling, retries, and a full audit trail on every record.

Questions

Which direction does data move between Microsoft Dynamics 365 Business Central and Chargebee?
The main flow is Chargebee into Business Central. Invoices, payments, credit notes, and customers move from Chargebee into the ERP, where the general ledger lives. Business Central is the accounting destination, so ml-connector does not write financial entries back into Chargebee, which stays the billing source of record.
How does the integration bridge the two different authentication methods?
Chargebee uses HTTP basic auth with the site API key as the username and an empty password, while Business Central uses an OAuth2 client-credentials token from a Microsoft Entra app. ml-connector stores both encrypted, sends the Chargebee key with its required trailing colon on every call, and requests and refreshes the Business Central token as needed, refreshing it whenever a request returns a 401.
How are Chargebee webhooks handled given they are not signed?
Chargebee uses no HMAC signature, so ml-connector treats the pushed payload only as a trigger and re-fetches the event by its id before acting, then deduplicates on that event id. Business Central webhook subscriptions carry no payload and expire after three days, so ml-connector fetches the changed resource after each notification and renews subscriptions before they lapse, with a scheduled poll backfilling anything missed.

Related integrations

Connect Microsoft Dynamics 365 Business Central and Chargebee

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

Get started