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 :
Supply chain | Supply Chain Management, Commerce
Answered

Where to find code samples or examples on these API Methods?

(0) ShareShare
ReportReport
Posted on by

https://docs.microsoft.com/en-us/dynamics365/commerce/dev-itpro/retail-server-customer-consumer-api#products-controller

I am trying to consume these API Methods, but I have no idea, how to use each of the method. The link doesn't even mention methods are get or post type.

Is there a repository where I can find some sample, on how to use these methods?

Example - I want to use Product/Search, not sure what to send in the request.

I have the same question (0)
  • Suggested answer
    Diogo_STMonteiro Profile Picture
    Microsoft Employee on at

    Hi Arijit365,

    But you can check further details and see the response and request if you see the network view, example below from CPOS SearchByText API example:

    pastedimage1606158208052v3.png

    You can also use Postman to consume API and check the results and get more details.

    https://docs.microsoft.com/en-us/dynamics365/commerce/dev-itpro/consume-retail-server-api#access-the-apis-by-using-postman

    Regarding the Search API, I guess that you have an example in ..\RetailSDK\Code\SampleExtensions\OnlineStore

  • Suggested answer
    Shahil Profile Picture
    635 on at

    A good place to start is the RetailSDK/Documents folder. 

    You can also find examples in here: RetailSDK\SampleExtensions

    You can find how the customer search example here: RetailSDK\SampleExtensions\CommerceRuntime\Extensions.CustomerSearchSample

    This shows how you can implement those controllers.

  • Community Member Profile Picture
    on at

    Hi Diogo, thank you so much for replying. I have already made getProductbyid method working in postman.

    Yes, I was looking for specification of API like this, you have shown in your screenshot,

    GET graph.microsoft.com/.../groups

    docs.microsoft.com/.../group-list

    1. What is that above portal in screenshot? (totally noob in D365 worked in O365 only)

    2. And does the SDK refers to the SDK inside VM server?

  • Community Member Profile Picture
    on at

    Example,

    Commerce/Products/GetByIds(channelId=xxxx,productIds=(xxxx,xxxx))

    variation trying (channelId=xxxx,productIds="xxxx,xxxx")

    (channelId=xxxx,productIds=[xxxx,xxxx])

    Trying with this only getting 404

    while so far only had success with

    Commerce/Products(xxxx)/GetById(channelId=xxxx)

  • Diogo_STMonteiro Profile Picture
    Microsoft Employee on at

    Hi Arijit365,

    My image is from CPOS (Cloud Point of Sale), from VM DEV box, when you run it, you can press F12 Developer Tools in the browser, in network tab you will see all the content, like my image.

    The SDK is available in VM dev box as well. (will be available soon in gitHub)

    You can download the VM Dev box (VHD) in LCS asset library page.

  • Community Member Profile Picture
    on at

    I got my requirement fixed by installing "DataModel" nuget package from SDK  as suggested to look in those SDK content.

    and combing with E-COMMERCE site methods F12>Network

    Though it would be nice MS make the documentation a bit better and similar to Graph API or SharePoint API documentations on each endpoints.

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Mallesh Deshapaga Profile Picture

Mallesh Deshapaga 254

#2
Laurens vd Tang Profile Picture

Laurens vd Tang 192 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 137 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans