Skip to main content

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.

Headers

Authorization
string
required
Bearer token for authentication

Response

productos
array
Array of products in the cart

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.

Headers

Authorization
string
required
Bearer token for authentication

Path Parameters

productoId
integer
required
ID of the product to add

Body Parameters

cantidad
integer
required
Quantity to add (minimum: 1)

Response

message
string
Success message
productos
array
Updated cart products array

Error Responses

error
string
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.

Headers

Authorization
string
required
Bearer token for authentication

Path Parameters

productoId
integer
required
ID of the product to update

Body Parameters

cantidad
integer
required
New quantity (minimum: 1)

Response

message
string
Success message: “Cantidad actualizada.”
productos
array
Updated cart products array

Error Responses

error
string
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.

Headers

Authorization
string
required
Bearer token for authentication

Path Parameters

productoId
integer
required
ID of the product to remove

Response

message
string
Success message: “Eliminado.”
productos
array
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.

Headers

Authorization
string
required
Bearer token for authentication

Response

message
string
Success message: “Vaciado.”
productos
array
Empty array

Build docs developers (and LLMs) love