Trying to use CART END POINT.
https://docs.microsoft.com/en-us/dynamics365/commerce/dev-itpro/retail-server-customer-consumer-api#cart-controller
Cart Id, is required. Based on my observation from sample E-Comm site,
Cart id is linked to user if user is logged in cart Id seems unique for user, but for guest users, cart id is different,
HOW can I get these cart id dynamically?? Is there any endpoint that returns cart id?
Commerce SDK is shipped with Sample Online Store which is a sample demonstrating how to use Retail Server's ODATA endpoint to manipulate with the cart. The manager you need is ICartManager. The above mentioned SDK contains the file CartOperationsHandler.cs which demonstrates how to Create/Get/AddItems as well as many other operations with the Cart.
Here you can see basics of interacting with RS by using ODATA: How to access Retail Server in managed code.
Hi Arijit,
Thank you for the update.
If you get a chance, please create an entry on the Ideas Portal in regard to this suggestion:
Thank you in advance.
Actually Ended up using Retail Proxy nuget packages. Thanks.
So apparently OData endpoints can not be used independently. This would probably go somewhere suggested feature or something.
Hi Arijit,
Sorry for the delay.
I have found that you cannot use Odata to create a cart.
However, you could look at calling the Retail Server APIs to accomplish this.
Thank you. I understand Cart need to be created before performing any operation in cart.
Is there a way to create a CART using odata end points?
I can not seem to find any odata method here,
Hi Arijit365,
General speaking, in eCommerce scenario, Cart ID is equivalent to Retail Transaction ID. It's generated before a cart was created, for example, any user searching product, even before adding product to the cart.
Ref:
Cart module - Commerce | Dynamics 365 | Microsoft Docs
Cart and checkout pages overview - Commerce | Dynamics 365 | Microsoft Docs
Thanks,
Thank you for using Microsoft Dynamics Communities,
Juliet Zhu
SR SUPPORT ENG
Microsoft Dynamics AX / Dynamics 365 Commerce
If my information answers your question please click 'Yes' against "Did this answer your question?" to help other community members.
Is there any way to create or Generate a Cart Id?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156