curl --request GET \
--url https://api.example.com/api/cart/:userId{
"success": true,
"data": {
"id": 123,
"userId": 123,
"abandonedEmailSent": true,
"items": [
{
"id": 123,
"cartId": 123,
"productoId": 123,
"quantity": 123,
"producto": {}
}
]
},
"error": "<string>"
}Retrieve the shopping cart for a specific user
curl --request GET \
--url https://api.example.com/api/cart/:userId{
"success": true,
"data": {
"id": 123,
"userId": 123,
"abandonedEmailSent": true,
"items": [
{
"id": 123,
"cartId": 123,
"productoId": 123,
"quantity": 123,
"producto": {}
}
]
},
"error": "<string>"
}curl -X GET "https://api.pcfix.com/api/cart/123" \
-H "Authorization: Bearer YOUR_TOKEN"
{
"success": true,
"data": {
"id": 1,
"userId": 123,
"abandonedEmailSent": false,
"items": [
{
"id": 45,
"cartId": 1,
"productoId": 789,
"quantity": 2,
"producto": {
"id": 789,
"name": "Gaming Mouse",
"price": 49.99,
"description": "High-performance gaming mouse",
"imageUrl": "https://example.com/mouse.jpg"
}
},
{
"id": 46,
"cartId": 1,
"productoId": 456,
"quantity": 1,
"producto": {
"id": 456,
"name": "Mechanical Keyboard",
"price": 129.99,
"description": "RGB mechanical keyboard",
"imageUrl": "https://example.com/keyboard.jpg"
}
}
]
}
}
{
"success": false,
"error": "User ID required"
}
| Status Code | Description |
|---|---|
| 200 | Cart retrieved successfully |
| 400 | Invalid user ID |
| 401 | Unauthorized access |
| 500 | Server error - Failed to get cart |
null for the data field