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

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:
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)
- 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.

- 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
- Overview: what the agent does: "How to Build an AI Sales Agent on Business Central"
- The whole build on one page: "Connect Business Central to WhatsApp Step by Step"
- Step 1: the connection: "Business Central WhatsApp Agent: Setup and Connection" (this page)
- Step 2: the URLs: "Add and Test Business Central URLs for a WhatsApp Agent"
- Step 3: the knowledge base: "A WhatsApp Agent Knowledge Base for Delivery and Returns"
- Step 4: details, tasks and after-chat results: "WhatsApp Agent Details to Collect and After-Chat Results"
- Step 5: the webhook: "Send WhatsApp Agent Events to Your Systems with Webhooks"
- Step 6: instructions, build and test chat: "Build and Test a Business Central WhatsApp Agent Safely"
- Step 7: the WhatsApp number: "Connect a WhatsApp Number to Your Business Central Agent"
- A read-only stock and price agent: "Real-Time Stock and Prices in WhatsApp from Business Central"





