Microsoft Dynamics 365 Business Central “Custom API” is a feature of the Business Central ERP system developed by Microsoft, which allows organizations to create tailor-made API endpoints to expose specific business data and logic. It is part of the Business Central extensibility framework and is typically used to integrate external applications or systems with Business Central in a secure and structured way.
Custom APIs are ideal for automating workflows, syncing data, and tailoring integrations. They support versioning, controlled access, and data shaping, making them a powerful tool for building flexible and secure connections to Business Central.
This article provides an overview to get started with the MS Business Central “Custom API” connector in Peliqan. Please contact support if you have any additional questions or remarks.
Content
- Content
- Connect to Microsoft Dynamics 365 Business Central using a “Custom API”
- Add connection
- Prerequisites
- Configuration Steps
- 1. Connection Setup
- 2. Business Central Credentials
- 3. API Configuration
- 4. Entity Selection
- 5. Replication Settings
- MS Business Central data sync to your data warehouse
- Support
- How to add custom API endpoints in Business Central
- How to create a custom API endpoint in Business Central (extension)
- Add a connection in Peliqan for the newly created API endpoints
- Troubleshooting
Connect to Microsoft Dynamics 365 Business Central using a “Custom API”
Peliqan has 2 connectors to work with a Custom API in Business Central:
- MS Business Central Custom API
- MS Business Central Custom API (Private app)
The steps below are without using a Private app. If you want to use a Private app, make sure to create the app in Azure first. See the general documentation of Business Central for more information on how to create a Private app in Azure:
Add connection
In Peliqan, go to Connections, click on “Add Connection” and search for Business Central Custom API. Choose one of the connectors:
Prerequisites
- Access to your Microsoft Business Central environment with admin privileges
- Valid API permissions set up in Business Central
Configuration Steps
1. Connection Setup
Connection Name
Enter a descriptive name for this connection
2. Business Central Credentials
Tenant ID
To find your Tenant ID:
- Log in to Business Central and navigate to the Dashboard
- Click the Settings icon (⚙) in the top toolbar
- Select "Admin Center"
- Copy the Tenant ID from the URL (it appears as
https://businesscentral.dynamics.com/{TENANT_ID}/admin)
Environment Name
To locate your Environment Name:
- In the Admin Center, select "Environments"
- Choose your environment from the list (or create one if needed)
- Enter the exact environment name as shown
Company Name
To find your Company Name:
- On the Business Central Dashboard
- Click the Building icon in the top toolbar
- Select the company you want to connect to from the list
- Enter the exact company name as shown
3. API Configuration
API Category Route
Enter the API route in the format: publisher/group/version
Example: zy/zygroup/v2.0
4. Entity Selection
List of Entities
- Enter a comma-separated list of custom tables you want to access
- By default, the primary key is assumed to be "id"
- To specify a different primary key:
entityName|primaryKey(e.g.,customer|systemId) - For composite primary keys:
entityName|key1+key2(e.g.,order|orderId+lineNumber)
5. Replication Settings
Replication Key
(Optional) Specify which field should be used for incremental refreshes:
- Enter the field name that tracks record changes (typically a timestamp or version field)
- Leave blank if you don't need incremental refresh
- Provided primary key works for all the Entities provided in connect form.
Incremental/Non-incremental
- Select "Incremental" if all your selected entities have the replication key available
- Select "Non-incremental" for full refreshes each time
Once done, click on Connect MS Business Central Custom API to initiate an OAuth Flow.
MS Business Central data sync to your data warehouse
Once the connection is added, the ETL/ELT pipeline will start running and the data will be added to new tables in your data warehouse.
Peliqan offers an out of the box data warehouse. Optionally you can choose to sync MS Business Central data to your own data warehouse such as Snowflake, Google BigQuery, MS SQL etc.
Data will be synced to the chosen data warehouse and made available through the Peliqan UI for exploration:
Support
If you encounter issues or don't see the tables you need:
- Contact support at support@peliqan.io
- Include your Business Central version and any error messages received
How to add custom API endpoints in Business Central
This guide explains how to create custom API endpoints in Business Central, e.g. in order to fetch data that is not available in standard API endpoints.
How to create a custom API endpoint in Business Central (extension)
In Business Central click on Search (magnifier icon in top right corner), search for "Extension management" --> click on "Develop in VS Code" --> click on "Generate launch configurations".
This will open VS Code on your computer and create a project in AL (the extension language for Business Central).
In VS Code, first install the extension from Microsoft: “AL Language extension for Microsoft Dynamics 365 Business Central”
Hit COMMAND+SHIFT+P --> Select "AL: Download Symbols"
Select the launch configuation "AL: Generated Download Symbols request"
Once symbols have downloaded successfully, add a file to create a new custom API endpoint, e.g. VendorApi.Page.al
Example content to list vendors with 3 selected fields id, number and displayName:
Hit COMMAND+SHIFT+P --> Select “AL: Publish”
Check if the Extension is now published in BC, example:
Add a connection in Peliqan for the newly created API endpoints
In Peliqan, add a connection of type "MS Business Central Custom API":
- For Environment name: see Business Central Admin:
https://businesscentral.dynamics.com/{tenant_id}/admin - For Apicategoryroute, use this format:
publisher/group/version. See the above created file for details, in our example:
APIPublisher = 'peliqan';
APIGroup = 'peliqangroup';
APIVersion = 'v1.0';So the Apicategoryroute becomes peliqan/peliqangroup/v1.0
Troubleshooting
User in BC has no access to Extension Management: make sure the user has Permission set EXTEN. MGT. - ADMIN. Example:
Downloading Symbols fails: make sure you are logged in into VS Code with the same Azure user as your login to BC (in VS Code see bottom left corner).
Make sure your user is assigned a product license for Business Central in Microsoft 365 admin center: https://admin.cloud.microsoft. Example:
When error "not found" during downloading of symbols: double check the version in app.json: e.g. "application": "27.5.46862.46929". This should be same version as the extension "Application", in BC go to Extension Management, find this extension and copy its version. Example: