0

I was able to sign in using /rest/V1/integration/customer/token and add items to cart. How do I view the cart(items I added using REST API) from front-end?

1

1 Answer 1

0

just make get request to

V1/carts/mine/items

You should get a json response with the data.

The cart needs to be create first, you do that by posting to

V1/carts/mine
5
  • This doesn't answer the question at all.OP wants to view the cart in the Magento storefront, not list the items in the API. May 21, 2019 at 9:14
  • @DougMcLean the store front doesn't use rest api... storefront != frontend..
    – Mackelito
    May 22, 2019 at 10:52
  • Magento themselves treat the two terms as synonymous, pretty much: see devdocs.magento.com/guides/v2.3/architecture/archi_perspectives/…. But we are at risk of arguing over semantics. My understanding of the question is that OP wants to generate a cart via the API, add items to it via the API, but then link to the storefront and have that cart shown there. It's a requirement I've seen before: browse and pick via an app, but then be sent to a single point of checkout (the storefront) to complete the order. May 22, 2019 at 15:40
  • 1
    I see your point.. And magento should use the term more visely as the store front is made from both backend (PHP) and frontend (HTML/JS/CSS).. Guess we just assume different things.. OP talked about managed to login using rest so I was just assuming that he/she was talking about making at xhr request to post cart items and then retrieving them in the same way :)
    – Mackelito
    May 24, 2019 at 5:23
  • 1
    Guess it´s good that we post about both options here as comments :)
    – Mackelito
    May 24, 2019 at 5:25

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.