I am trying to get the allocated cart detail for specific customer, but there are no api available to getting the cart information from customer detail (from customerId). How can i get the cart information for particular customer.
1 Answer
If you are using customer API, then just use GET /V1/carts/mine
If using admin APIs, the flow should be like this:
POST /V1/customers/:customerId/carts
, will crete cart for specified customer and return cart ID- Later you can use that cart ID in
GET /V1/carts/:cartId
If cart already exists and need to be accessed by the admin, it should be possible to form search criteria with filter by customer ID and pass it to GET /V1/carts
-
I am trying to search but getting error response, here is my search request MYHOST/rest/default/V1/carts/… Commented Dec 5, 2015 at 6:13
-
Please provide more details, what error are you getting? Commented Dec 5, 2015 at 10:00
-
-
@AlexPaliarush is it possible if customer login add cart items to customer cart, if possible please explain, Using REST API. magento.stackexchange.com/q/199748/55981 Commented Nov 3, 2017 at 6:24
-
Thanks @AlexPaliarush, I was stuck in placing the order as a customer using Magento 2 API. The order was placing fine but the customer name was showing Guest always. Your answer helped me to dig in the right direction. Commented Jun 25, 2019 at 6:53