web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

AL Code for Integration between Business Central and External Sales System via API

(4) ShareShare
ReportReport
Posted on by 12
Hello,
 
I'm looking for some guidance on how to write AL code in Visual Studio Code to establish a continuous integration between Microsoft Dynamics 365 Business Central and an external sales system via API.
 
Specifically, I want to achieve the following:
Retrieve customers and sales invoices created in the external sales system and import them into Business Central.
Continuously synchronize item details from Business Central to the external sales system.

Most examples I've come across online demonstrate integration using Postman, but I'm specifically interested in implementing this functionality using AL code in Visual Studio Code.
 
I would greatly appreciate any advice, tips, or resources that can help me accomplish this task efficiently.
 
Thank you in advance for your assistance!
I have the same question (0)
  • Suggested answer
    Gerardo Rentería García Profile Picture
    25,555 Most Valuable Professional on at
    Hi
    I hope this can help you. And give you some hints. Extending standard APIs (2) – Kauffmann @ Dynamics 365 Business Central
    BR
    GR
  • Lama Khaled Profile Picture
    12 on at
    Hi,
    Thanks, gdrenteria for your reply but I need the basic steps to start creating AL code for the connection between BC and the second system, the URL for the document you sent has a complicated way that isn't useful for me because I'm a beginner can you advise?
  • Suggested answer
    YUN ZHU Profile Picture
    99,086 Super User 2026 Season 1 on at
    Hi, you can search for the "HttpClient data type" keyword and you should be able to find a lot of learning materials.
    For example,
    Call external services with the HttpClient data type
     
     
    Hope this helps.
    Thanks.
    ZHU
  • Lama Khaled Profile Picture
    12 on at
     
    Hi Mrs,
     
    Thanks for your advice on using HTTP data type, I searched and found about this but I need to use AuthO type to use secret ID and token, and how I make an integration between an Outside system with Business Central to get and post data between them, how I can apply the mapping between them, I need example code if you can ? I apprsieated your effort but I need someone to give me the light of the road in this matter because I am a beginner and first time I will do that 
  • CU16041327-0 Profile Picture
    12 on at
    @Lama Khaled Where you able to do the integration? Because I'm also a beginner and i want to learn.
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    22,130 Super User 2026 Season 1 on at
  • Suggested answer
    Jainam M. Kothari Profile Picture
    15,803 Super User 2026 Season 1 on at
  • Matteo Fiocco Profile Picture
    260 on at

    Hi Lama,

     

    You can achieve this using AL with HttpClient and scheduled Codeunits. For importing customers and sales invoices, create a Codeunit that makes GET requests to the external API and maps the JSON response to BC records. For item sync, use a similar Codeunit with POST/PUT requests to push updates.

     

    Set up Job Queue Entries to run these Codeunits on a schedule for continuous sync. Make sure to handle auth (e.g., Bearer token) via request headers.

     

    Let me know if you need a sample structure!

     

    Cheers,

    Matteo

  • Gerardo Rentería García Profile Picture
    25,555 Most Valuable Professional on at

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,005 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,148 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 557 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans