This endpoint retrieves the current contents of the authenticated user’s shopping cart from Redis. The cart is keyed by theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/astrxnomo/shop-microservers/llms.txt
Use this file to discover all available pages before exploring further.
userId extracted from the JWT bearer token, so each user maintains their own isolated cart. If the cart does not yet exist — or has expired after the 7-day Redis TTL — the response returns an empty items array and a total of 0.
Endpoint
Authentication
This endpoint requires a valid JWT passed as a Bearer token in theAuthorization header.
Request
No parameters
This endpoint accepts no path parameters, query parameters, or request body.Example request
Response
200 — Success
Returns the user’s current cart, including a computedtotal rounded to two decimal places.
Response fields
Array of
CartItem objects currently in the user’s cart. Empty array [] if the cart is empty or has expired.CUID of the product, matching the
id field returned by the catalog service.Display name of the product, stored in the cart at the time it was added.
Unit price of the product at the time it was added to the cart.
URL of the product image, stored in the cart at the time it was added.
Number of units of this product currently in the cart.
Sum of
price × quantity across all items, rounded to 2 decimal places using Math.round(...* 100) / 100.The cart TTL is 7 days (
604800 seconds). Each write operation — adding or removing an item — resets the TTL. If neither action occurs within 7 days, the Redis key expires and the cart is silently treated as empty on the next read.401 — Unauthorized
Returned when theAuthorization header is missing or the JWT is invalid or expired.