web
You’re offline. This is a read only version of the page.
close
Skip to main content
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
    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

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

  • 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?

  • 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)

  • 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?

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 945

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 256 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 176 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans