Get Cart Items API

Learn how to fetch all the items added to the cart for a user.

AWe have the required setup for the cart controller, meaning we have a service and repository because we set up the cart controller. This means it will be easier to make the rest of the APIs.

First, we’ll design the response of what we return to the user.

We’ll return a list of items added to the cart, as well as the total price (CartDto).

Each item will consist of quantity and product (CartItemDto).

Get hands-on with 1200+ tech skills courses.