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!

  • Verified answer
    Suresh Kulla Profile Picture
    50,280 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
    161 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
    161 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 677 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 430 Super User 2026 Season 2

#3
Teagen Boll Profile Picture

Teagen Boll 280 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans