GET /api/products
Retrieves the product catalog with all active products. This endpoint provides backward compatibility with the legacy SheetDB format.Query Parameters
Optional filter by category/sheet name (e.g., “Kits”, “Productos”). If omitted, returns all products.
Response
Returns an array of product objects in legacy SheetDB format.Product SKU identifier
Product name
Full product description
Short description (first 100 characters)
Product price as string
Stock status: “DISPONIBLE” or “AGOTADO”
Primary product image URL
Product category (e.g., “General”, “Kits”)
Product benefits description
Weight in kilograms (default: “0.2”)
Height in centimeters (default: “10”)
Width in centimeters (default: “10”)
Length in centimeters (default: “10”)
Variant name if applicable
Example Request
Example Request with Filter
Example Response
Data Source
Products are fetched from the PostgreSQL database using Prisma ORM. Only products withisActive: true are returned.
Caching
The endpoint includes cache control headers to prevent caching:Legacy Format
This endpoint maintains backward compatibility with the legacy SheetDB integration. The response format uses uppercase field names and string values for prices to match the original implementation.
Filtering Logic
When asheet parameter is provided:
- Filters products where
CATEGORIAcontains the sheet name - Or where
NOMBREcontains the sheet name - Case-sensitive partial match
Error Responses
500 Internal Server Error
CORS Headers
The endpoint includes CORS headers:Access-Control-Allow-Credentials: trueAccess-Control-Allow-Origin: *