> ## Documentation Index
> Fetch the complete documentation index at: https://docs.monk.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Dynamics 365

> Monk integration with Microsoft Dynamics 365 Business Central and Finance & Operations

# Dynamics 365

Monk integrates with both Microsoft Dynamics 365 Business Central and Dynamics
365 Finance & Operations over OData. The same Microsoft Entra service
principal is used for server-to-server authentication, and Monk supports
multi-company deployments with per-company mapping to Monk orgs.

## Supported entities

| Monk entity       | Dynamics 365 entity                       |
| ----------------- | ----------------------------------------- |
| Customer          | Customer / CustTable                      |
| Customer contacts | Contact / ContactPerson                   |
| Invoice           | Sales invoice / SalesInvoiceHeader        |
| Invoice line      | Sales invoice line                        |
| Payment           | Customer payment / CustomerPaymentJournal |
| Credit memo       | Sales credit memo / SalesCreditMemoHeader |
| Product / item    | Item                                      |
| Payment terms     | Payment term                              |
| Chart of accounts | GL account / GeneralLedgerAccount         |
| Company           | Company / Data area                       |

## Authentication

* An Entra administrator grants admin consent to the Monk multi-tenant app.
* Inside Dynamics 365, the Monk service principal is assigned a permission set
  (Business Central) or a security role (Finance & Operations).
* Monk exchanges tokens automatically and refreshes them before expiry.
* Credentials are encrypted at rest; no Microsoft password is stored.

## Multi-entity, currency, and parent-child

* **Companies:** Dynamics 365 tenants can contain multiple companies. Each
  selected company maps to one Monk org. Bulk mapping lets you connect several
  companies to existing Monk orgs in a single flow.
* **Currency:** Invoice and payment amounts are stored with their original
  transaction currency and exchange rate. Functional currency is used for
  reporting.
* **Customer hierarchy:** Parent/child customer relationships are preserved when
  the product exposes them.
* **Invoice applications:** Payments, credit memos, and settlements are
  reconciled back to the matching invoice.

## Configuration options

* **Tenant and environment:** enter the Entra tenant ID and Dynamics environment
  name (for example, `production`).
* **Company selection:** pick one or more companies to sync; map each to an
  existing Monk org.
* **Payment account and journal mapping:** select the bank account or journal
  used for Dynamics 365 payment transactions.
* **Historical cutover date:** choose how far back Monk imports open invoices
  and payments.
* **Auto-import:** enable or disable automatic import of new customers,
  invoices, and payments.

## Sync and reliability

* Incremental OData reads based on change tracking or timestamp cursors.
* Automatic retry and backoff for transient OData/Entra failures.
* Idempotency on payment writes to avoid duplicate journal entries.
* Connection health banner surfaces permission or consent issues for fast
  remediation.

## Product-specific notes

* **Dynamics 365 Business Central:** sync uses the standard BC API v2.0 and a
  small optional AL extension to access payment ledger data.
* **Dynamics 365 Finance & Operations:** sync uses the standard F\&O data
  entities; payment journals are created through F\&O's batch process.

## Frequently asked questions

**Do we need an on-premises data gateway?**
No. Monk connects to the cloud-hosted OData endpoints over HTTPS.

**Can one Monk org sync more than one company?**
No. Each Monk org maps to one Dynamics 365 company. Connect additional Monk orgs
for additional companies and use Monk's org hierarchy for roll-up.

**What permission set or role is needed?**
Business Central uses `D365 BUS FULL ACCESS` (or the Monk AL permission sets
for narrower push/pull grants). Finance & Operations requires a custom security
role covering the customer, invoice, and payment-journal entities.
