Skip to main content

Notifications

Announcements

No record found.

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.

  • Community Member Profile Picture
    on at
    RE: Where to find code samples or examples on these API Methods?

    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.

  • Diogo_STMonteiro Profile Picture
    on at
    RE: Where to find code samples or examples on these API Methods?

    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
    RE: Where to find code samples or examples on these API Methods?

    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)

  • Community Member Profile Picture
    on at
    RE: Where to find code samples or examples on these API Methods?

    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?

  • Suggested answer
    Shahil Profile Picture
    635 on at
    RE: Where to find code samples or examples on these API Methods?

    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.

  • Suggested answer
    Diogo_STMonteiro Profile Picture
    on at
    RE: Where to find code samples or examples on these API Methods?

    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

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,886 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,768 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans