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...
Answered

How to call third party API when "post" action in the Sales Order in Dynamics 365 Business Central

(0) ShareShare
ReportReport
Posted on by 44

Hello, I'm new to Dynamics 365 and I have a requirement to integrate a third-party system into Dynamics 365 Business Central.

We need to call third-party API when the "Post" action performed in the Sales Order screen by the user in Dynamics 365 Business Central. 

Anybody has worked on calling API from D365 Business Central,  please give some inputs on how to achieve this.

Appreciate any help!

Thanks!

I have the same question (0)
  • Verified answer
    Suresh Kulla Profile Picture
    50,269 Super User 2026 Season 1 on at

    I have done several integrations to third party API, you can use HttpClient to send the request, below is a simple example 

    RequestHeaders := HttpClient.DefaultRequestHeaders();
    RequestHeaders.Add('Authorization', ''); // Add the authorization based on the API
    RequestMessage.SetRequestUri(ApiURl));
    RequestMessage.Content.WriteFrom(CreateJsonRequest());
    RequestMessage.Method('POST');
    IsSuccessful := HttpClient.Send(RequestMessage, ResponseMessage);
    
    CreateJsonRequest is a method which creates a Json and returns the JsonText.

  • Suggested answer
    JAngle Profile Picture
    152 on at

    Adding to the answer from Suresh.

    You can use a codeunit to create an event subscriber to the Sales Post codeunit. This will enable you to make the HTTP call as Suresh has suggested at the right point in the posting sequence

  • Suggested answer
    Vijay Jupudi Profile Picture
    44 on at

    Thank you Josh for a detailed explanation.

        How to publish the new codeunit to Client Business Central Instance either through AppSource or another way to do that?

    Please provide any reference docs or links to me & will walk through it.

  • Verified answer
    JAngle Profile Picture
    152 on at

    Appsource explanation is much more long winded. Once you have it working I’d look at that as a completely separate learning exercise. Try this for now: community.dynamics.com/.../how-to-install-an-extension-created-from-the-sandbox

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