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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Suggested Answer

How to create Rest API in x++

(0) ShareShare
ReportReport
Posted on by 143

Hey Everyone,

Hope you all are doing great!

Actually I'm new to web services and I have to create an API which creates Sales order in d365 F&O from the 3rd party system. My API should be JSON based so please give me any sample code or idea how to create an Rest API for the same.

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,172 Moderator on at

    Hi Vishu,

    how did you determine that it must be JSON based?

    I recommend that you first decide if you need synhronous or asynchronous integration. You have several options for both. You should evaluate many details before deciding which technical approach to use.

    docs.microsoft.com/.../integration-overview

    You might be able to implement the D365 side without any development whatsoever.

  • Suggested answer
    Martin Dráb Profile Picture
    240,073 Most Valuable Professional on at

    You don't have to create it - it's already there.

    D365FO offers an OData service, which is a RESTful service for manipulating (querying, creating, updating, deleting) of (public) data entities. And there already are public data entitoes for sales orders.

  • Vishu Beniwal Profile Picture
    143 on at

    Hi Nikolaos actually 3rd party software developer team asked me to create a JSON based service.

  • Vishu Beniwal Profile Picture
    143 on at

    Hi Martin can you please let me know the data entity name so I can check that.

  • Suggested answer
    Martin Dráb Profile Picture
    240,073 Most Valuable Professional on at

    Let me give you something better - I'll teach you how you can find it by yourself.

    I'll assume that you have F&O development environment tools. Open Application Explorer and find data entities related to sales orders. You'll do it by typing a search expression to the search box on the top of Application Explorer. If you want to find data enties with names starting with "Sales" and containing "Order", you'll use type:dataEntity ^sales.*order.

    Then review the list; you should spot SalesOrderHeaderV2Entity and SalesOrderLineV2Entity. That's likely what you want.

    Also, look at properties of these entities and notice PublicEntityName and PublicCollectionName. These are names used in OData.

  • Vishu Beniwal Profile Picture
    143 on at

    Hi Martin actually the other party just want one service, they just want one service for sales order header and line not separate separate. Can you please help me out here?

  • nmaenpaa Profile Picture
    101,172 Moderator on at

    Hi Vishu,

    do you mean that the other party is the integration architect and you just need to follow their plan?

  • nmaenpaa Profile Picture
    101,172 Moderator on at

    Anyway, perhaps Data Package RESTI API could be the right approach, you can use it to import Sales order composite entity. However please make sure that all relevant details are considered in the technical decision. Now it's still cheap to adjust the plans, because nothing is yet developed.

  • Vishu Beniwal Profile Picture
    143 on at

    Hi Nikolaos,

    By 3rd party I mean the 3rd party software developer team from which we need to fetch the sales order  

  • Martin Dráb Profile Picture
    240,073 Most Valuable Professional on at

    If no existing data entity meet your needs, simply go and create a custom one. But it might also suggest that you're not doing the right thing. For example, maybe you should use a composity data entity via one of the data management APIs.

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

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 79 Super User 2026 Season 1

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 75 Super User 2026 Season 1

#3
Sagar Suman Profile Picture

Sagar Suman 64 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans