One of the rest key principle is not to maintain state on a server or to communicate statelessly. I want to have views how this principle works on shopping cart? So, say if the user is adding products in a shopping cart from a shopping website. In my opinion, the server will have some implementation to have shopping cart in session scope and user will send a post call to add the product in a shopping cart. For e.g /shoppingcart/products/1. Now the products remain added in shopping cart(but not persisted in database) until user confirms for checkout. During confirmation of check-out, the shopping cart items gets persisted into the database on server side.
Does this approach(putting item in shopping cart on server side that is in session scope) violates rest principle? If yes, how then we can implement the adding product to shopping cart by taking care of "stateless" communication principle?