2

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.

0

1 Answer 1

2

If you are using customer API, then just use GET /V1/carts/mine

If using admin APIs, the flow should be like this:

  1. POST /V1/customers/:customerId/carts, will crete cart for specified customer and return cart ID
  2. 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

5
  • 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
  • @ArunKasyakar Does it work for you or help needed? Commented Dec 20, 2015 at 21:49
  • @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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.