Guest cart API ignoring cartId in url for some methods #14086
Labels
Component: Api
Use with concrete module component label E.g. "Component: Api" + "Catalog"
Fixed in 2.4.x
The issue has been fixed in 2.4-develop branch
Issue: Clear Description
Gate 2 Passed. Manual verification of the issue description passed
Issue: Confirmed
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed
Issue: Format is valid
Gate 1 Passed. Automatic verification of issue format passed
Issue: Ready for Work
Gate 4. Acknowledged. Issue is added to backlog and ready for development
Reproduced on 2.1.x
The issue has been reproduced on latest 2.1 release
Reproduced on 2.2.x
The issue has been reproduced on latest 2.2 release
Reproduced on 2.3.x
The issue has been reproduced on latest 2.3 release
Reproduced on 2.4.x
The issue has been reproduced on latest 2.4-develop branch
Preconditions
Steps to reproduce
I am following the API documentation to create guest cart and add item to it:
POST https://yourdomain/rest/default/V1/guest-carts
(with empty body) creates cart for you and return cartId in bodyGET https://yourdomain/rest/default/V1/guest-carts/
:cartId
to check you cart is createdPOST https://yourdomain/rest/default/V1/guest-carts/
:cartId
/items
with bodyto add item to your cart, but error is returned instead of adding cart to item
Expected result
In step 3, I was expecting the added item to be returned. Instead of that, error is returned.
Actual result
Further research
I discovered: If you send the cartId in
quote_id
field in body at step 3, the method would work. So the body would be:And the results is cart item, no error. The cartId in url is completly ignored. If you use send request with some dummy string instead of cartId in URL (with the body with quote_id field), it actually works.
So request like
POST https://yourdomain/rest/default/V1/guest-carts/some_dummy_string_insetead_of_cartId/items
works. But it should not! And the mandatory quote_id in body is also wrong I think. The only cartId needed to add the item to the cart should be the one from URL (which is not used at all at the moment).
The same problem is present on other methods in guest-cart.
The text was updated successfully, but these errors were encountered: