Lets assume that i want to build a restful api which should add items to a shoppingcart. I think the most straight forward way would be like this:
POST /shopping
If I understand it correctly, there are two resources to manage, ShoppingCarts and Items. If the business logic is to create a shoppingCart before adding items to it... Then, the following design should work.
A) To create a shopping cart
B) Then create/add item to the shopping cart
Or can be more specific with "items" in the url.
C) To get all items in the shopping cart
D) To get a specific item in the shopping cart
E) To delete an item from the shopping cart.
Also PUT is to modify an existing resource not to create a new resource. Like if need to update the quantity for the item that already exists, will do the following.
OR you can use PATCH to just update the quantity.
Hope it helps!