Create a new product with images (Admin only)
curl --request POST \
--url https://api.example.com/api/admin/product \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"price": 123,
"stock": 123,
"categoryId": 123,
"variant": "<string>",
"images": [
null
]
}
'{
"statusCode": 123,
"message": "<string>",
"data": {
"id": 123,
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"variant": [
{}
],
"price": 123,
"stock": 123,
"category_id": 123,
"category_name": "<string>",
"img_urls": [
{}
],
"created_at": "<string>"
}
}Documentation Index
Fetch the complete documentation index at: https://mintlify.com/memoowi/e-comm-api-demo-2/llms.txt
Use this file to discover all available pages before exploring further.
multipart/form-data to support file uploads.
["S", "M", "L", "XL"] or ["Red", "Blue", "Green"])Show Product Object
curl --request POST \
--url 'https://api.example.com/api/admin/product' \
--header 'Authorization: Bearer your_admin_token_here' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Premium Leather Jacket' \
--form 'description=High-quality leather jacket with modern design' \
--form 'price=199.99' \
--form 'stock=50' \
--form 'categoryId=3' \
--form 'variant=["S","M","L","XL"]' \
--form 'images=@/path/to/image1.jpg' \
--form 'images=@/path/to/image2.jpg' \
--form 'images=@/path/to/image3.jpg'
{
"statusCode": 201,
"message": "Product added successfully",
"data": {
"id": 42,
"name": "Premium Leather Jacket",
"slug": "premium-leather-jacket",
"description": "High-quality leather jacket with modern design",
"variant": ["S", "M", "L", "XL"],
"price": 199.99,
"stock": 50,
"category_id": 3,
"category_name": "Outerwear",
"img_urls": [
"uploads/products/1234567890-image1.jpg",
"uploads/products/1234567891-image2.jpg",
"uploads/products/1234567892-image3.jpg"
],
"created_at": "2026-03-03T10:30:00.000Z"
}
}
{
"statusCode": 400,
"message": "All fields are required"
}
{
"statusCode": 400,
"message": "At least one image file is required"
}
{
"statusCode": 400,
"message": "Invalid format for variants. Must be a JSON array."
}
{
"statusCode": 409,
"message": "Product already exists"
}
slug is automatically generated from the product name by converting to lowercase, replacing spaces with hyphens, and removing special charactersvariant field should be a JSON string representation of an arrayimages fieldcurl --request POST \
--url https://api.example.com/api/admin/product \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"price": 123,
"stock": 123,
"categoryId": 123,
"variant": "<string>",
"images": [
null
]
}
'{
"statusCode": 123,
"message": "<string>",
"data": {
"id": 123,
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"variant": [
{}
],
"price": 123,
"stock": 123,
"category_id": 123,
"category_name": "<string>",
"img_urls": [
{}
],
"created_at": "<string>"
}
}