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

# Microsoft Dynamics 365 Business Central OAuth 2.0 (Multiple Companies) connector profile – StackOne setup guide

> Set up a connector profile using OAuth 2.0 (Multiple Companies) for Microsoft Dynamics 365 Business Central in StackOne to allow users to link their accounts.

> [!WARNING]
>
> You must have at least Application Developer permissions in your Azure account to register applications in Microsoft Entra ID. A Dynamics 365 Business Central license is required for users accessing the API.

Select Actions to adjust the guideSome actions may require additional configuration in the provider to be accessible. Choose the actions you need and the guide will be updated.

Select all
Clear

ActionScope(s)

Loading actions...No actions match your search.

Dynamic Guide URL

Copy URL

Scopes Selected

<pre role="textbox" aria-readonly="true" tabIndex="0" />

Separator

Copy scopes

## Register Your Application in Microsoft Entra ID

The app registration in Microsoft Entra ID provides the OAuth 2.0 credentials for the connection.

**1. Create a New App Registration**

Sign in to the [Microsoft Entra admin center](https://entra.microsoft.com).

<ul>
  <li>Select the **Settings** (gear) icon in the top-right corner if you have access to multiple tenants.</li>
  <li>Select the tenant you want to connect from the list under **Directory + subscription**.</li>
  <li>Select **App registrations** from the left navigation menu.</li>
  <li>Select **New registration**.</li>
  <li>**Name**: A name that identifies this integration</li>
  <li>**Supported account types**: **Accounts in this organizational directory only** (single tenant)</li>
  <li>**Redirect URI (optional)**: select **Web**, then enter the **Callback URL** from your Connector Profile</li>
  <li>Select **Register** to create the app registration.</li>
</ul>

**2. Copy the Application (Client) ID**

The app's **Overview** page shows the **Application (client) ID**.

<ul>
  <li>Copy the **Application (client) ID** to **Client ID** in your Connector Profile.</li>
</ul>

**3. Add Business Central Permission**

Enables actions: Create Bank Account, Create Currency, Create Customer, Create Item, Create Journal Line, Create Sales Quote, Create Vendor, Delete Bank Account, Delete Currency, Delete Customer, Delete Item, Delete Journal Line, Delete Sales Quote, Delete Vendor, Get Account, Get Bank Account, Get Company, Get Company Information, Get Currency, Get Customer, Get Customer Payment, Get Customer Payment Journal, Get Dimension, Get Dimension Value, Get Employee, Get General Ledger Entry, Get Item, Get Item Category, Get Journal, Get Journal Line, Get Purchase Invoice, Get Purchase Order, Get Sales Credit Memo, Get Sales Invoice, Get Sales Order, Get Sales Quote, Get Tax Area, Get Vendor, List Accounts, List Bank Accounts, List Companies, List Company Information, List Currencies, List Customer Payment Journals, List Customer Payments, List Customers, List Dimension Values, List Dimensions, List Employees, List General Ledger Entries, List Item Categories, List Items, List Journal Lines, List Journals, List Purchase Invoices, List Purchase Orders, List Sales Credit Memos, List Sales Invoices, List Sales Orders, List Sales Quotes, List Tax Areas, List Vendors, Update Bank Account, Update Company Information, Update Currency, Update Customer, Update Item, Update Journal Line, Update Sales Quote, Update Vendor

From the left menu under **Manage**, select **API permissions**. The permission comes from the Business Central API, not Microsoft Graph.

<ul>
  <li>Click **Add a permission**.</li>
  <li>Select **APIs my organization uses**.</li>
  <li>Search for `Dynamics 365 Business Central`.</li>
  <li>Select **Dynamics 365 Business Central**.</li>
  <li>Choose **Delegated permissions**.</li>
  <li>Enable **Financials.ReadWrite.All**.</li>
  <li>Click **Add permissions** to save.</li>
</ul>

<ul>
  <li>
    [https://api.businesscentral.dynamics.com/Financials.ReadWrite.All](https://api.businesscentral.dynamics.com/Financials.ReadWrite.All)
  </li>
</ul>

**4. Grant Admin Consent**

Consent on behalf of all users in your tenant.

<ul>
  <li>Click **Grant admin consent for \[tenant name]**.</li>
  <li>Select **Yes**.</li>
  <li>Check that **Granted for \[tenant name]** appears under the **Status** column.</li>
</ul>

**5. Create a New Client Secret**

From the left menu under **Manage**, select **Certificates & secrets**.

<ul>
  <li>Under the **Client secrets** tab, click **New client secret**.</li>
  <li>**Description**: A description that identifies this secret</li>
  <li>Select an appropriate expiration period.</li>
  <li>Click **Add**.</li>
</ul>

**6. Copy the Client Secret Value**

The **Client secrets** tab shows the **Value** of the new secret. The **Value** is only shown once.

<ul>
  <li>Copy the **Value** to **Client Secret** in your Connector Profile.</li>
</ul>

## Find Your Tenant ID (single-tenant apps only)

The tenant ID identifies your Microsoft Entra directory. Only needed for a single-tenant app registration. Leave **Tenant ID** blank on a multi-tenant app.

**1. Locate the Tenant ID**

Sign in to the [Microsoft Entra admin center](https://entra.microsoft.com).

<ul>
  <li>Open **Identity** > **Overview**.</li>
  <li>Copy the **Tenant ID** across.</li>
</ul>

## Create the StackOne Connector Profile

**1. Create a Connector Profile**

Enable the connector and create a Connector Profile in your project. See [Setup Connector Profile](https://docs.stackone.com/gateway/quickstart.md#setup-connector-profile).

**2. Link an Account**

Once the Connector Profile is created, continue to [link an account](https://docs.stackone.com/connectors/dynamics365bc/guides/link-account/oauth-2-0-multiple-companies.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.