In this blog, you’ll learn how to create a custom API in Business Central using Visual Studio Code, step-by-step. We’ll also cover the necessary permissions to set up your development environment, how to test and publish your API, and finally, how to use that API in Power Automate and CRM scenarios. 

If you’re looking to extend Business Central functionality beyond its out-of-the-box capabilities, this guide is for you. 

Prerequisites 

Before diving into development, ensure the following are in place: 

Step by Step Guide  


Step 1: Install Visual Studio Code & Required Extensions 
Step 2: Create Your AL Project 
  1. Open Visual Studio Code 
  1. Go to View > Command Palette 
  1. Type and select AL: Go 
  1. Enter your project name and press Enter 
  1. Select the latest version of Business Central (e.g., 15.0) 
  1. Choose the appropriate server type: 

This will generate the following essential files: 

Delete the HelloWorld.al file — it’s not needed for your custom API. 

Step 3: Required Permissions to Download Symbols 

Before you begin coding, download symbols for IntelliSense support. 

Ensure the user has these permissions (with a blank Company Name field for each SUPER and EXTEN MGT – ADMIN): 

A screenshot of a computerAI-generated content may be incorrect.

Note: – If the Company Name is not blank, symbol downloads will fail with a permission error in Visual Studio Code. 

Step 4: Configure launch.json and app.json Files 

Once the project is created, configure your launch.json and app.json files to match your environment setup. 

🔧 launch.json Configuration 

  

In the launch.json file: 

⚠️ Note: The environment name is case-sensitive. Make sure it matches exactly as seen in your Business Central Admin Center. 

 
🔧 app.json Configuration 

In the app.json file, you can customize the object ID range used for your extension. By default, it uses 50100–50149. 
You can change this to avoid conflicts with other extensions. 

Step 5: – Download Symbols: 
  1. Go to View > Command Palette 
  1. Select AL: Download Symbols 
  1. Wait for the process to complete 
  1. Verify that .alpackages/ now contains downloaded packages 
Step 6: Create the API Page 
  1. In Explorer, right-click and choose New AL File Wizard (from AZ AL Dev Tools) 
  1. Select “New AL Page Wizard

Now select the page New AL Page Wizard  


            

  1. Fill in the following configuration: 

4. Select the fields you want to expose 

5. Click Finish, then Save the file 

6. Publish your extension to Business Central 

Step 7: Deploy the Extension to Business Central 
  1. Open Business Central 
  1. Search for Extension Management 
  1. Click Manage > Upload Extension 
  1. Upload the .app file generated from VS Code 
  1. To verify the installation, search for Extension Installation Status 
  1. Confirm that your extension appears with the correct status 

Conclusion 

Creating a custom API in Microsoft Dynamics 365 Business Central empowers businesses to seamlessly connect systems like Power Automate and Dynamics 365 CRM. With just a few development steps using AL language and Visual Studio Code, you can build powerful integrations that extend Business Central’s capabilities into your broader enterprise ecosystem. 

Whether you’re automating lead syncs, pushing order updates, or triggering CRM workflows from ERP events   this custom API approach provides flexibility, scalability, and control. 

Need Help? 

If you’re new to Business Central development or face issues during setup, don’t hesitate to seek guidance. Feel free to reach out via: