Retrieve all items in the authenticated user’s shopping cart
cURL
curl --request GET \ --url https://api.example.com/api/cart \ --header 'Authorization: <authorization>' \ --header 'x-api-key: <x-api-key>'
{ "success": true, "message": "<string>", "data": [ { "cart_id": 123, "id": 123, "name": "<string>", "description": "<string>", "price": 123, "quantity": 123, "variant": "<string>", "img_urls": [ {} ] } ] }
Bearer {token}
Show Cart Item Properties
curl -X GET https://api.example.com/api/cart \ -H "x-api-key: your_api_key" \ -H "Authorization: Bearer your_jwt_token"
{ "success": true, "message": "Success fetching cart data", "data": [ { "cart_id": 1, "id": 123, "name": "Wireless Headphones", "description": "High-quality wireless headphones with noise cancellation", "price": 99.99, "quantity": 2, "variant": "Black", "img_urls": [ "https://example.com/images/headphones-1.jpg", "https://example.com/images/headphones-2.jpg" ] }, { "cart_id": 2, "id": 456, "name": "USB-C Cable", "description": "Durable USB-C charging cable", "price": 15.99, "quantity": 1, "variant": null, "img_urls": [ "https://example.com/images/cable-1.jpg" ] } ] }