Authentication
This endpoint requires authentication with a JWT token and ADMIN role.
Authorization: Bearer <token>
Body Parameters
Product name (cannot be empty)
URL-friendly unique identifier (cannot be empty, must be unique)
Product description (cannot be empty)
Product price (must be >= 0, maximum 2 decimal places)
ID of the category (must be >= 1)
Response
Unique identifier for the created product
URL-friendly unique identifier
Product active status (defaults to false for new products)
ID of the category this product belongs to
Timestamp when the product was created
Timestamp when the product was last updated
curl -X POST https://api.kiototeteria.com/products \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Oolong Tea",
"slug": "oolong-tea",
"description": "Traditional oolong tea with smooth flavor",
"price": 11.99,
"categoryId": 1
}'
{
"id": 3,
"name": "Oolong Tea",
"slug": "oolong-tea",
"description": "Traditional oolong tea with smooth flavor",
"price": "11.99",
"isActive": false,
"categoryId": 1,
"createdAt": "2024-01-16T14:30:00Z",
"updatedAt": "2024-01-16T14:30:00Z"
}