Skip to main content

Install the Yokoy connector in Business Central On Premises

If you use Microsoft 365 Business Central as an on-premise implementation, you need to install the Yokoy connector as an extension.

Yokoy Team avatar
Written by Yokoy Team
Updated over a month ago

🌐 Web | 👤 Yokoy admin with Integrations permission

For Microsoft Dynamics 365 Business Central On-Premise implementations, you install the Yokoy Spend Management Connector as an extension.

🚧 Caution

By installing the Yokoy connector as an extension, you must be aware that they will not receive automatic updates with any new features. You will be responsible for installing and managing any updates of the Yokoy connector.

The extension needs to be registered and configured with Microsoft Entra to allow Yokoy access to the Business Central API endpoints.

To set up the connector for Business Central On Premises:

🚧 Caution

The on-premises edition of Business Central may be hosted on private web servers with restricted access to and from unsecured networks. Make sure that the security policies do not prevent traffic exchanges between Yokoy and the Business Central tenant’s services. In other words, firewall rules, port forwarding rules, and secure network gateways must set up to allow traffic passthrough to and from Business Central On premises and Yokoy before proceeding to synchronize data or trigger exports.


Architectural overview

To exchange data between Yokoy and Microsoft Dynamics 365 Business Central, the application uses OAuth 2.0 authentication and authorization to secure data transfer.

The Microsoft Entra is used as the identity provider (IdP). It securely manages user information, access rights, and the trust relationships between Business Central and Yokoy. After a user authenticates (i.e. signs in), the authorization server issues security tokens that the client application (i.e. the Yokoy web app) uses to grant, deny, or revoke access to the Business Central API (authorization). Once the client application has valid bearer tokens (access, ID and refresh), it can access the data in Business Central and perform operations such as create, update, or delete. In other words, when the Yokoy app makes API calls to Business Central, the extension verifies the access tokens provided and determines whether to allow or deny access to the requested resources. If allowed access, Yokoy can then post expenses or invoices.

Therefore, you need to set up Microsoft Entra to recognize the client app (Yokoy) and issue security tokens.


Install the Yokoy connector as an extension

To install the Yokoy connector as an extension, you need to have access to the connector package (.app). You must open a service request to obtain access to the connector package.

Once you have access to this file, you can proceed to install the app using the Extension Management page.

The extension package uses these ID ranges for the objects listed below:

Object type

Number of objects

ID range

Codeunits

8

63800–63807

Enums

2

63800, 63802

Pages

1

63800

Page Extensions

13

63800–63812

Reports

8

63800–63807

Tables

1

63800

Table Extensions

15

63800–63814

✏️ Note

ID ranges are dynamic and may be influenced by the customer’s license.
If the customer is using these ID ranges, you may have to assign another one for the extension package’s objects. Otherwise, you’ll encounter conflicts.

Extensions may be uninstalled automatically after a Business Central update without data loss. See Uninstalling the extension.


Set up Business Central for Microsoft Entra

Once you have installed the extension, you need to register and configure it in Microsoft Entra to allow Yokoy access to the Business Central API endpoints. You also need to configure the app permissions.

🚧 Caution

It is highly important that you follow the steps outlined in the Microsoft official documentation, particularly the sections Configure Business Central Server and Configure Business Central Web Server Component

To trust the security tokens issued by Microsoft Entra, you must register your app. During registration, the platform assigns key values, such as:

  • Application (Client) ID: Also referred to as the application ID or client ID, this unique identifier is assigned to your app by the identity platform. The client ID helps identify your application within the platform and is included in the security tokens issued by the platform.

  • Redirect URI: The redirect URI specifies where the authorization server should send the user-agent (e.g., a web browser or mobile app) after completing the authentication process. For example, after the user signs in, the authorization server redirects them to the specified URI. Note that not all client types require a redirect URI.

App registration also provides the authentication and authorization endpoints needed to obtain ID and access tokens.

Register an application on the MS Azure portal

First you need to register an app on the MS Azure portal for the Yokoy connector.
See Register an app in the Microsoft identity platform for guidance.

Create the basic definition of the application by configuring the Overview, Authentication, Certificates & secrets, and API permission sections.

Overview section:

  • Name of the app: Yokoy Business Central connector

  • Application (client ID): Copy this ID, you’ll need it later.

Authentication tab:

Click + Add a platform.

  1. Select Web.

  2. Enter Redirect URIs:

  3. Click Save.

💡 Tip

To add several redirect URIs, you need to add one and click Save. Then you can add the second one in the main screen.

API permissions section:

  1. Click + Add a permission.

  2. Select Dynamics 365 Business Central.

  3. In Delegated permissions, select and add permissions:

    • user_impersonation

    • Financials.ReadWrite.All

  4. In Application permissions, select and add permissions:

    • app_access

    • AdminCenter.ReadWrite.All

    • API.ReadWrite.All

  5. Click Grant admin consent for…

Certificates & Secrets section:

Create a new client secret. We recommend you set the expiry as 24 months. Copy the Value and Secret ID.

Publish the web service in Business Central

Enter “Microsoft Entra Applications” in the Business Central global search tool (top right corner) to access the application setup.

Create the application

You need to create a new application in Business Central:

  1. Create a new application card.

  2. Enter the Application ID (created in the Overview section in the Azure portal) in Client ID.

  3. Enter Yokoy for Business Central in the Description.

  4. Under “State”, select Enabled

Assign user permissions in Business Central

You need to set up the application so it has super admin permissions.

More specifically, you need to add these permission sets in the User Groups section in the Microsoft Entra Application card you’ve just created.

Permission set

Description

Dynamics 365 Basic access

Dyn. 365 Company data setup

D365 Webhook Subscription

Dyn. 365 Setup Cost Accounting

Dyn. 365 Fixed Assets Setup

Dynamics 365 Basic HR Setup

Dyn. 365 Intercompany Setup

Dynamics 365 Create Projects

Dynamics 365 Rlshp. Mgt. Setup

Merge Duplicates

Reten. Pol. Setup - BaseApp

Outlook Synch. administrator

Extension Management - Admin

Test Tool

PERMISSIONSET YKY

Custom permission set for the Yokoy extension

Once the initial installation has been completed, standard users need the Yokoy BC permission set (PERMISSIONSET YKY) to make any subsequent changes to the integration and synchronize data.

In addition, you need to determine the ID range on which new objects can be created (e.g. 50000 to 55000).

Since the ID range used for custom developments may vary, it is important to specify this range as the installation package will overwrite any existing objects that are assigned the same ID range. See Install the connector as an extension for a list of the ID ranges used in the extension by default.

Configure web services

You need to add the web services in the Business Central for each module you plan to integrate (i.e. one web service for Yokoy Invoice and another for Yokoy Expense).

To do this:

  1. Go to Web Services.

  2. Click + New to create a new object.

  3. Select the Codeunit object type.

  4. Search for the object IDs depending on the module you want to implement:

    • Yokoy Expense: Import Expencies YKY (63807)

    • Yokoy Invoice: Webhooks YKY (63806)

  5. Enter a unique service name (i.e. Yokoy Invoice or Yokoy Expense). Make sure that the Published checkbox is selected.

Once you have done this, you should configure the Yokoy Integrations Setup page in Business Central before continuing to set up the expense or invoice export in Yokoy.


Set up the expense export in Yokoy

Yokoy is responsible for exporting the expense data to the general ledger in Business Central. Expense receipts and attachments can be attached to journal entries as required.

If the company plans to process credit notes, you need to have enabled credit notes for the legal entity.

You need to set up the Expense export tab (Admin > Integrations, Expense export) to send expense data (expense, card transaction, travel expenses) to Business Central.

🚧 Caution

You can’t use the Yokoy connector to export per diems/mileage separately.

To do this:

  1. Go to Admin > Integrations.

  2. Select the Expense export tab.

  3. Choose Business Central [API] as the ERP system.

  4. Enter the authentication credentials:

  5. Click Sign in with Business Central.

Make sure to disable any popup blockers in your browser window. MS Dynamics authentication uses a popup window to make the authentication request to MS Entra.

🚧 Caution

Make sure to select the correct ERP system! Ms Dynamics Cloud & MS Dynamic OnPrem are the export facilities for another MS Dynamics Business Central connector, not the Yokoy-developed connector.

Once connection has been established, you can configure the export settings:

Field

Description

Web service name

Name of the web service created in Business Central.

Base URL

External IP address of the web server, including the open port. For example, https://191.255.255.255:80

Tenant

For Business Central On-premises, this is not required.

Instance

ID of the Business Central environment.

Company Name

Name of the company in Business Central.

Account type

This field applies to expense export only (Expense current system)

BC account of the credit item. Determines whether the information is taken from the Vendor card or the Employee card (i.e. uses the ERP code in the Yokoy User profile).

Known limitation

Currently only Employee is supported since Yokoy users are linked to the Employee card.

Company card account type

Applies to card transaction export only (Current system for card transactions)

BC account of the credit item. Determines whether the information is taken from the Vendor card or G/L account (i.e. uses the ERP code in the Supplier or the Expense category, depending on whether you selected Vendor or G/L).

❗️ Exclude cost objects from export

The expense export setting Exclude cost objects from export is not compatible with this integration.
The Yokoy integration for MS Dynamics 365 Business Central always expects a cost object when exporting expenses.


Set up the invoice export in Yokoy

To process invoices with Business Central, Yokoy uses webhooks to notify Business Central about changes in the document status. There is a specific invoice export facility in Yokoy to handle the webhook response. Currently, the webhooks are synchronous. This means that the provider must wait until the webhook has finished processing to get a response.

To allow Business Central to connect to Yokoy, you need to set up the integration in Yokoy:

  1. Go to Admin > Integrations.

  2. Select the Invoice exports tab.

  3. In the Invoice exports tab, click Start Wizard.

  4. Enter these details:

    • Export name: Business Central Invoices

    • Document type: Supplier invoices

  5. In System tab, select Business Central Integration.

  6. In Configuration tab, enter the data used to form the URL to access the Business Central API. You need to enter this data:

Field

Description

Base URL

External IP address of the web server, including the open port. For example, https://191.255.255.255:80

Token URL

Enter the URL of the redirect URI for authentication you previously configured in Register an application on the MS Azure portal, i.e. this URL usually contains the string OAuthLanding.

Scope

Tenant

For Business Central On premises, this is not required.

Environment

ID of the Business Central environment.

Web service name

Company name

Name of the company. This information can be identified in the URL to access Business Central, identified with the company= attribute. For example: https://businesscentral.dynamics.com/{tenantId}/{Environment}?company={CompanyName}

You need to do this for each legal entity that you want to link to a Business Central company.

❗️Warning

If you try to set up multiple export facilities (i.e. the Yokoy connector together with existing integrations), you may encounter the error Validation: Multiple export facilities applicable when you try to export an invoice. You can only have one export facility active at a time.


Did this answer your question?