Create a new product (admin only)
curl --request POST \
--url https://api.example.com/products \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"price": 123,
"stock": 123,
"categoryId": 123
}
'{
"id": 123,
"name": "<string>",
"description": "<string>",
"price": 123,
"imageUrl": "<string>",
"stock": 123,
"categoryId": 123,
"createdAt": {},
"updatedAt": {}
}Documentation Index
Fetch the complete documentation index at: https://mintlify.com/GioTaipe/E-commerce/llms.txt
Use this file to discover all available pages before exploring further.
POST /products
Authorization: Bearer <your_token>
multipart/form-data format due to the required image upload.
name: Must be a valid stringdescription: Must be a valid stringprice: Must be a number with maximum 2 decimal placesstock: Must be an integer with minimum value of 0categoryId: If provided, must be an integer >= 1image: Required file field - the endpoint will return a 400 error if missingcurl -X POST https://api.example.com/products \
-H "Authorization: Bearer <your_admin_token>" \
-F "name=Laptop" \
-F "description=High-performance laptop for professionals" \
-F "price=1299.99" \
-F "stock=15" \
-F "categoryId=2" \
-F "image=@/path/to/laptop.jpg"
{
"id": 1,
"name": "Laptop",
"description": "High-performance laptop for professionals",
"price": "1299.99",
"imageUrl": "https://example.com/uploads/laptop-1234567890.jpg",
"stock": 15,
"categoryId": 2,
"createdAt": "2026-03-06T10:30:00.000Z",
"updatedAt": "2026-03-06T10:30:00.000Z"
}
201 Created
{
"error": "La imagen del producto es obligatoria (campo 'image')"
}
400 Bad Request
{
"error": "Validation failed",
"details": [
{
"field": "price",
"message": "El precio debe ser un número válido con máximo 2 decimales"
}
]
}
400 Bad Request
{
"error": "Unauthorized"
}
401 Unauthorized
{
"error": "Admin access required"
}
403 Forbiddencurl --request POST \
--url https://api.example.com/products \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"price": 123,
"stock": 123,
"categoryId": 123
}
'{
"id": 123,
"name": "<string>",
"description": "<string>",
"price": 123,
"imageUrl": "<string>",
"stock": 123,
"categoryId": 123,
"createdAt": {},
"updatedAt": {}
}