You could use the 'SaveCart' method for saving the cart to the database. The cart is also saved in the session for the customer. But to ensure not losing the cart information between requests for the customer you can save it to the database.
shoppingService.SaveCart();
Be sure to check the documentation about the ecommerce features and check the kentico API documentation when you are searching/looking for features that you need.
Customization for example for the cart validation or price calculation are possible but require some attention.