Skip to content
Business Central

Business Central WhatsApp Agent: Setup and Connection

Step 1 of the series: the app login your WhatsApp agent uses to reach Business Central

The SaleFlowPoint WhatsApp area where the Business Central connection is set up

This guide is part of a series on a WhatsApp sales agent for Microsoft Business Central, built with SaleFlowPoint's custom chatbot (Mode 3). Every value below is the one we typed on our own demo account, so you can copy it and change only your own names and ids. The data is Microsoft's CRONUS USA demo company in our own Business Central sandbox, and the shops are invented: Summit Office Supply in Denver (quotes), Brightwater Furniture Co. in Charlotte (orders and order status) and Northgate Workspace in Minneapolis (answers only). Ids are shown as {tenant}, {environment} and {company}; amounts are in US dollars.

What you need first

  • A Business Central environment you administer (we used a sandbox called Production with the CRONUS USA demo company)
  • An admin account for Microsoft Entra, to register an app and grant consent
  • A SaleFlowPoint account with the WhatsApp module (a running trial is enough to build and test)

A. Register the app in Microsoft Entra

SaleFlowPoint signs in to Business Central as an app, not as a person. These are the clicks in Microsoft's admin center:

  • 1. Microsoft Entra admin center (portal.azure.com), signed in as an admin: App registrations, then New registration.
  • 2. Name: SaleFlowPoint WhatsApp agent. Supported account types: single tenant. Redirect URI: leave empty. Press Register.
  • 3. On the Overview page, copy the Application (client) ID (this is {client-id}) and the Directory (tenant) ID (this is {tenant}).
  • 4. API permissions, Add a permission, Dynamics 365 Business Central, Application permissions, tick API.ReadWrite.All, Add permissions.
  • 5. Press Grant admin consent for your organisation. Without it Business Central refuses every call.
  • 6. Certificates and secrets, New client secret, choose 12 or 24 months, Add. Copy the Value at once: Microsoft shows it only once. Put the end date in your calendar.

B. Allow the app in Business Central

  • 1. In Business Central, search (Alt+Q) for Microsoft Entra Applications and choose New.
  • 2. Client ID: paste {client-id}. Description: SaleFlowPoint WhatsApp agent.
  • 3. User Permission Sets: add D365 BUS FULL ACCESS for your company (or a smaller set that allows only items, customers and sales documents).
  • 4. Set State to Enabled. Tip: Business Central only lets you change the permission sets while State is Disabled.
  • 5. Find your environment name (ours is Production) in the Business Central address bar, and your company id with GET https://api.businesscentral.dynamics.com/v2.0/{tenant}/{environment}/api/v2.0/companies using the same login.

C. Add the connection in SaleFlowPoint

Open WhatsApp, then Connections (under Custom chatbot), and fill in Add a connection exactly like this. Only {tenant}, {client-id} and the secret are your own:

Add a connection
Name:          Business Central (CRONUS)
Login type:    OAuth 2 client credentials (Business Central, Dynamics, most ERPs)
API host:      api.businesscentral.dynamics.com
Token URL:     https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token
Client id:     {client-id}
Scope:         https://api.businesscentral.dynamics.com/.default
Client secret: {client-secret}   (the Value you copied from Microsoft Entra)
The Add a connection form filled in with OAuth 2 client credentials, the Business Central API host, the Microsoft token URL with {tenant}, the client id placeholder and the .default scope
Connections > Add a connection, filled in. The secret is typed once and is never shown again.
  • API host is the only server this login is ever sent to. A URL that points anywhere else is refused.
  • The secret is stored encrypted and is only ever sent to the token URL.
  • Press Save connection.

D. Test the connection

Press Test connection on the saved card. SaleFlowPoint asks Microsoft for a token with the saved secret. Green means the app registration, the admin consent and the secret all work.

The saved Business Central (CRONUS) connection card with Test connection, Edit and Delete buttons and a green Signed in, token renews automatically badge
The saved connection after Test connection.
  • unauthorized_client or AADSTS7000215: the secret is wrong or expired; make a new one in Entra.
  • Business Central answers 401 or 403: admin consent is missing, or the Microsoft Entra Application card is not Enabled or lacks a permission set.

What renews itself, and what expires

The access token lasts about one hour. SaleFlowPoint renews it by itself about two minutes before it ends, and once more if Business Central answers 401. What does expire is the client secret, after the 6, 12 or 24 months you chose: make a new secret in Entra before that date and paste it into the connection.

Next step

Step 2: the URLs: "Add and Test Business Central URLs for a WhatsApp Agent"

The whole series

Start free today

One shop and one till free, with no time limit and no card to sign up.

Loading SaleFlowPoint…