Create Single Product
POST
/api/v1/public/products/create
Notes
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/api/v1/public/products/create' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
"store": {{store_id}},
"sku": "{{$helpers.fromRegExp('\''/[A-Z0-9]{4}-[A-Z0-9]{4}/'\'')}}",
"name": "{{$food.vegetable}}",
"original_price": "{{$commerce.price(min=1000,max=10000000,locale='\''vi'\'')}}",
"discounted_price": "{{$commerce.price(min=1000,max=10000000,locale='\''vi'\'')}}",
"condition": "NEW",
"status": 200,
"weight": 100,
"package_length": 10,
"package_width": 15,
"package_height": 11,
"product_brand": {{brand_id}},
"product_category": {{category_id}},
"info": {
"description": "{{$food.description}}"
},
"video_image": [
{
"image_url": "{{$image.url(width=200,height=200)}}",
"video_url": null,
"thumbnail_url": null,
"duration": 0,
"priority": 1
},
{
"image_url": "{{$image.url(width=200,height=200)}}",
"video_url": null,
"thumbnail_url": null,
"duration": 0,
"priority": 0
}
],
"is_dangerous": false,
"is_pre_order": false,
"config": {
"create_inventory_sku": true
}
}'
Response Response Example
200 - Success
{
"status_code": 200,
"data": {
"product_id": 36062
},
"error": false,
"error_code": null,
"log_id": null,
"messages": "",
"total": 1
}
Request
Header Params
Authorization
string
required
Default:
{{your_api_key_here}}
Body Params application/json