- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
REST API ADDED CART THROUGH POSTMAN AS GUEST USER BUT NOT DISPLAYED ON WEB CLIENT
Hello,
I am using Postman to create a quote as a Guest User and add Items to the cart.
I am following this:
https://devdocs.magento.com/guides/v2.4/rest/tutorials/orders/order-intro.html
Everything is perfect, cart is created and items are added to the cart.
But when I open my magento website the cart is empty, probably because the guest user from Postman and from Safari is different.
Is it possible to open the cart by id?
Any Idea?
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: REST API ADDED CART THROUGH POSTMAN AS GUEST USER BUT NOT DISPLAYED ON WEB CLIENT
Add item to guest cart
Step-1 : [POST] http://.../Magento2/index.php/rest/V1/guest-carts/ - gives cart Id.
Once you add the product to the guest cart you will get quote mask id otherwise you can get this from quote_id_mast.
Step-2 : [POST] http://.../Magento2/index.php/rest/V1/guest-carts/a03da1c69a5b1b57a405d05a31e16ce5/items – Adds an item to cart.
Body - { "cartItem": { "quote_id": "a03da1c69a5b1b57a405d05a31e16ce5", "sku": "Mobile1", "qty": 10 } }
Make sure you are sending customer token in the header.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: REST API ADDED CART THROUGH POSTMAN AS GUEST USER BUT NOT DISPLAYED ON WEB CLIENT
Hi and thank you for your answer,
But I was able to crate a guest cart and add items to it before, but where can I see that cart? How can I open it in browser?
And why customer token in headers for guest-cart?
Thank you