Business Central: Custom Endpoint with API Package

Business Central Custom API Endpoint Guide

Business Central does not expose all tables via standard APIs.

To access custom data, you must create API endpoints using AL language and deploy them as extensions.

Whenever Microsoft does not provide the API you need, the only option is to build a custom API using AL Language and deploy it as an extension.

This document explains how to create the extension, build the package, and install it in your Business Central environment.

This guide explains how to build, package, and deploy custom API endpoints in Business Central step by step.

When Do You Need Custom API Endpoints in Business Central?

Custom API endpoints in Microsoft Dynamics 365 Business Central are required when the default APIs do not provide the data structure or flexibility needed for your specific business or integration use case.

While standard APIs cover common scenarios, many real-world implementations require customization.

When Required Tables Are Not Available in Default API

Business Central does not expose all tables through its standard API layer. This becomes a limitation when:

  • You need access to custom tables or fields
  • Required data exists but is not part of the default API endpoints
  • You want to retrieve specific business logic-driven data

In such cases, custom API endpoints allow you to directly expose the required tables and fields using AL, without depending on limited standard APIs.

When Working with Custom Extensions

If your Business Central environment includes custom extensions, the data introduced through those extensions is not automatically available via standard APIs.

Custom endpoints help you:

  • Expose extension-based data models
  • Maintain consistency between custom logic and API output
  • Ensure your integrations can fully utilize extended functionality

This is especially important for businesses that rely on custom workflows or industry-specific customizations.

When Building Third-Party Integrations

When integrating Business Central with external systems such as CRMs, SaaS platforms, or internal tools, default APIs may not align with your integration requirements.

Custom endpoints become necessary to:

  • Structure data in a way that matches the target system
  • Reduce multiple API calls by creating optimized endpoints
  • Handle complex data mapping and transformations

This ensures smoother, more reliable integrations without adding unnecessary complexity on the external system side.

Prerequisites

  • Visual Studio Code installed on your machine
  • The AL Language extension installed in Visual Studio Code
  • A Business Central account where you can publish the extension

How to Build API Package File Using AL Language in Business Central

  1. Open your AL project folder (the BC App Repo) in Visual Studio Code.
  2. Open the app.json file and increase the version number by 1. Business Central will not install an extension if the version is the same as an already-installed one.
  3. All your API pages, tables, and other AL objects will be visible in the project. From here you can:
    • Edit API Page objects
    • Add new fields
    • Expose new data
    • Adjust logic
  4. Once done, build the package using Ctrl + Shift + B. VS Code will generate a new .app file and the output window will confirm the package has been created.
  5. When you build, VS Code will show two environment options. Choose: Microsoft Cloud Sandbox.
  6. You will get a prompt click on “Copy & Open”.
  7. On the page that opens, paste the code you copied in the previous step.
  8. Sign in to your BC account by entering your Azure Credentials.

Note: You need to have a sandbox environment set up in your Business Central account for the build process to work.

Once all of the above steps are completed, you will be able to build your app and a package will be generated.

How to Grant Extension Permissions in Business Central

The user installing the extension must have extension management rights. Follow these steps:

  1. In the Business Central client, search for “Users” and open the page.
  2. Open the user you want to grant permission to and click on “Effective Permissions”.
  3. Click on “Permissions Sets”.
  4. Click on “Edit List”, search for “Extension Management Admin”, and click the arrow to include it in the permission sets.

How to Install and Uninstall Extensions in Business Central

  1. In the Business Central client, search for “Extension Management” and open the page.
  2. Click on “Upload Extension”.
  3. Select the .app file, enable the radio button shown, and click the Deploy button.

Important: Make sure to choose the correct version of the application; otherwise, you will get an error indicating that the application with that version is already installed.

  1. A message will display indicating the upload is in progress.
  2. Search for “Extension Installation Status” to check the upload status. It takes around 5 minutes to complete.
  3. Once the upload is complete, the status will change to “Completed”.
  4. To uninstall the application, search for it in “Extension Management” and click on “UnPublish”.

Reference: For more details on installing and uninstalling extensions, see the official Microsoft documentation.

Why Custom API Endpoints Are Required in Business Central

Business Central custom AL API vs standard API showing extended data access, custom tables, and integration with external systems

Business Central does not provide API endpoints for all tables. Many functional areas — especially custom tables, custom fields, or certain financial/operational tables are not exposed through Microsoft’s default API set.

Examples of data that requires custom endpoints:

  • Custom master tables
  • Custom workflows
  • Custom posting tables
  • Extra fields added via extensions
  • Industry-specific data
  • Anything outside the base API group

Because of this, integrations often require:

  • Custom API Pages
  • Custom entities
  • API Groups / Versions
  • Additional logic inside AL

Creating a custom endpoint ensures you can expose exactly what your integration needs.

Standard APICustom API
Limited dataFull control
Predefined endpointsCustom endpoints
No custom tablesSupports custom tables

Conclusion

When the standard Business Central APIs do not cover your requirements, creating a Custom API via AL is the official and correct approach.

Using the steps above, you can build your AL app, package it, install it, and expose any data you need via custom APIs.

FAQ

When should you use custom APIs in Business Central?
You should use custom APIs when the required data is not available in the standard API, especially for custom tables, workflows, or integration-specific data.
What is the difference between standard API and custom API in Business Central?
Standard APIs provide predefined endpoints for common data, while custom APIs allow you to expose specific tables, fields, and business logic using AL language.
Can custom APIs improve Business Central integrations?
Yes, custom APIs allow you to access specific data and tailor integrations to your requirements, making them more efficient and scalable.
Do I need AL language to create API endpoints in Business Central?
Yes, AL language is required to define API pages, structure data, and create custom endpoints in Business Central.
Does Business Central support all tables in its standard API?
No, Business Central only exposes a limited set of tables through its standard API. Custom tables and extension-based data require custom API endpoints.
Why can’t I use the standard Business Central API for all tables?
Microsoft only exposes a subset of Business Central tables through the default API. Custom tables, extension-added fields, and many financial/operational tables require you to build custom API pages using AL Language.
What happens if I don’t increment the version number in app.json?
Business Central will reject the installation if the version number matches an already-installed extension. Always increment the version in app.json before building a new package.
Do I need a sandbox environment to build the package?
Yes, a sandbox environment is required for the build and deployment process. The AL Language extension in VS Code connects to the sandbox to compile and validate your extension.
How long does extension installation take?
Extension installation typically takes around 5 minutes. You can monitor the progress by searching for “Extension Installation Status” in the Business Central client.

Article by

Chintan Prajapati

Chintan Prajapati, a seasoned computer engineer with over 20 years in the software industry, is the Founder and CEO of Satva Solutions. His expertise lies in Accounting & ERP Integrations, RPA, and developing technology solutions around leading ERP and accounting software, focusing on using Responsible AI and ML in fintech solutions. Chintan holds a BE in Computer Engineering and is a Microsoft Certified Professional, Microsoft Certified Technology Specialist, Certified Azure Solution Developer, Certified Intuit Developer, Certified QuickBooks ProAdvisor and Xero Developer.Throughout his career, Chintan has significantly impacted the accounting industry by consulting and delivering integrations and automation solutions that have saved thousands of man-hours. He aims to provide readers with insightful, practical advice on leveraging technology for business efficiency.Outside of his professional work, Chintan enjoys trekking and bird-watching. Guided by the philosophy, "Deliver the highest value to clients". Chintan continues to drive innovation and excellence in digital transformation strategies from his base in Ahmedabad, India.