List Products
Retrieves all products for the authenticated business.Headers
Bearer token from authentication
Response
Product ID
Product name
Product description
Product price
Available stock quantity
Business ID that owns this product
Category ID
Relative path to product image
Full URL to product image
Category details
Creation timestamp
Last update timestamp
Example Request
Example Response
Get Single Product
Retrieves a specific product owned by the authenticated business.Headers
Bearer token from authentication
Path Parameters
Product ID
Response
Returns a single product object with the same structure as the list endpoint.Error Responses
Error message
404- Product not found or doesn’t belong to your business404- “No tienes una empresa vinculada.” if user has no associated business
Example Request
Create Product
Creates a new product for the authenticated business.Headers
Bearer token from authentication
multipart/form-data (required when uploading images)
Body Parameters
Product name (max 255 characters)
Product price (numeric value)
Initial stock quantity (minimum 0)
Category ID (must exist in categorias table)
Product description (optional)
Product image (max 2MB, image formats only)
Response
Success message: “Producto creado con éxito”
Created product object with same structure as GET response
Example Request
Example Response
Update Product
Updates an existing product owned by the authenticated business.Headers
Bearer token from authentication
multipart/form-data when uploading new image, otherwise application/json
Path Parameters
Product ID to update
Body Parameters
Product name (max 255 characters)
Product price
Stock quantity
Category ID (must exist)
Product description
New product image (replaces existing one)
Response
“¡Actualizado!”
Updated product object
Error Responses
404 Not Found - Product not found or doesn’t belong to your businessExample Request
Example Response
Delete Product
Deletes a product and its associated image from storage.Headers
Bearer token from authentication
Path Parameters
Product ID to delete
Response
“Producto eliminado correctamente.”