Get Cart Items
curl -X GET https://your-domain.com/api/cliente/carrito \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
Retrieves all products in the authenticated customer’s cart.
Bearer token for authentication
Response
Array of products in the cart
Business/company ID that owns the product
Business details
Whether the business is currently open
Add Product to Cart
curl -X POST https://your-domain.com/api/cliente/carrito/agregar/5 \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"cantidad": 2
}'
Adds a product to the cart or increases quantity if already present.
Bearer token for authentication
Path Parameters
Body Parameters
Quantity to add (minimum: 1)
Response
Updated cart products array
Error Responses
Error message when:
- Business is closed (403)
- Insufficient stock (422)
Update Cart Item Quantity
curl -X PUT https://your-domain.com/api/cliente/carrito/actualizar/5 \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"cantidad": 3
}'
Updates the quantity of a product already in the cart.
Bearer token for authentication
Path Parameters
ID of the product to update
Body Parameters
New quantity (minimum: 1)
Response
Success message: “Cantidad actualizada.”
Updated cart products array
Error Responses
Error message when:
- Business is closed (403)
- Insufficient stock (422)
Remove Product from Cart
curl -X DELETE https://your-domain.com/api/cliente/carrito/eliminar/5 \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
Removes a specific product from the cart.
Bearer token for authentication
Path Parameters
ID of the product to remove
Response
Success message: “Eliminado.”
Updated cart products array
Empty Cart
curl -X POST https://your-domain.com/api/cliente/carrito/vaciar \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
Removes all products from the cart.
Bearer token for authentication
Response
Success message: “Vaciado.”