Create Product
POST/openapi/2022-01/products
Create a new product with the provided details.
Request
- application/json
- Body
- Example
Body
- Array [
- ]
- Array [
- ]
- Array [
- Array [
- ]
- ]
product objectrequired
Product's title
Product's briefing description
Product's description
Whether it is published or not
Whether it is required to shipping
Whether it is taxable
Tags, separated by comma, for example: tag1,tag2
Vendor's name
Vendor's URL
SEO title
SEO description
SEO keywords, separated by comma, for example: key1,key2
Product's handle
Whether it is a single variant
trueWhether to tracking inventory
Inventory policy: continue, deny, auto_unpublished, required while inventory_tracking is true
Whether variant image is needed. It's required if has_only_default_variant is false
Product's SPU
Product's fake sales
Whether to display fake sales
options object[]
Option's name, for example: "color","size".
Option's values, for example: ["red", "black"],["small", "large"]
[]images object[]
Image's URL
Image's width in px
Image's height in px
Image's alt
variants object[]
Option 1
Option 2
Option 3
image object
Variant's images, e.g.: {"src":"//cn.cdn.shoplazza.com/c8bf5695d347092d7a010f00182581f7.jpeg"}
Image's URL
Image's width in px
Image's height in px
Image's alt
Compare at price ( original price )
Price, set it to "0.00" if you want to leave the price empty.
SKU
The barcode of the variant
Inventory quantity
Unit of weight, possible value are: kg, g, lb, oz
Cost price
wholesale_price object[]
Mini Order Quantity
Unique_token is a unique string identifier generated by your app, will be used for idempotency verification, for example: e6cc4df1-d4f5-4ad4-a019-2e0f3ddd6e63
Whether mixed wholesale is supported
{
"product": {
"title": "string",
"brief": "string",
"description": "string",
"published": true,
"requires_shipping": true,
"taxable": true,
"tags": "string",
"vendor": "string",
"vendor_url": "string",
"note": "string",
"seo_title": "string",
"seo_description": "string",
"seo_keywords": "string",
"handle": "string",
"has_only_default_variant": true,
"inventory_tracking": true,
"inventory_policy": "string",
"need_variant_image": true,
"spu": "string",
"fake_sales": 0,
"display_fake_sales": true,
"options": [
{
"name": "string",
"values": [
"string"
]
}
],
"images": [
{
"src": "string",
"width": 0,
"height": 0,
"alt": "string"
}
],
"variants": [
{
"option1": "string",
"option2": "string",
"option3": "string",
"image": {
"src": "string",
"width": 0,
"height": 0,
"alt": "string"
},
"compare_at_price": "string",
"price": "string",
"sku": "string",
"barcode": "string",
"note": "string",
"inventory_quantity": 0,
"weight": "string",
"weight_unit": "string",
"cost_price": "string",
"wholesale_price": [
{
"price": "string",
"min_quantity": 0
}
]
}
],
"unique_token": "string",
"mixed_wholesale": true
}
}
Responses
- 200
- 422
- 425
- 500
200
- application/json
- Schema
- Example
- Result
Schema
- Array [
- ]
- Array [
- ]
- Array [
- Array [
- ]
- ]
product object
9fb9f3c6-2300-42c1-8593-d9008d7cfc09Stylish ShirtA stylish shirt.truetruetruetruetruetrueshirt,stylish,cottonAwesome Vendorhttps://awesomevendor.com03002024-12-03T19:02:30Z2024-12-03T19:02:30Z2024-12-03T19:02:30ZSpecial promotion item.Buy Stylish Shirt OnlinePremium cottonshirt, cotton, stylishstylish-shirt-zbxftruefalsetruetruecontinuetruefalseSS1234050truetruetruetrueimage object
//img.fantaskycdn.com/loading.png01000100loading.pngimages object[]
15333433-a0d5-44c9-941b-2c59ea07683e9fb9f3c6-2300-42c1-8593-d9008d7cfc0901//img.fantaskycdn.com/loading.png010001002024-12-03T19:02:30Z2024-12-03T19:02:30Zoptions object[]
8e40555e-a152-45fc-9587-fe85280701c59fb9f3c6-2300-42c1-8593-d9008d7cfc0901Sizevariants object[]
d7c7f9ba-f824-46b6-94af-1c2d1befaf279fb9f3c6-2300-42c1-8593-d9008d7cfc092024-12-03T19:02:30Z2024-12-03T19:02:30ZSmall-RedSmallRed0129.9919.99SS1234-RD-S123456789012Limited01000.50kg12.99wholesale_price object[]
19.9901{
"product": {
"id": "9fb9f3c6-2300-42c1-8593-d9008d7cfc09",
"title": "Stylish Shirt",
"brief": "A stylish shirt.",
"description": "",
"published": true,
"requires_shipping": true,
"taxable": true,
"tags": "shirt,stylish,cotton",
"vendor": "Awesome Vendor",
"vendor_url": "https://awesomevendor.com",
"inventory_quantity": 300,
"published_at": "2024-12-03T19:02:30Z",
"created_at": "2024-12-03T19:02:30Z",
"updated_at": "2024-12-03T19:02:30Z",
"note": "Special promotion item.",
"seo_title": "Buy Stylish Shirt Online",
"seo_description": "Premium cotton",
"seo_keywords": "shirt, cotton, stylish",
"handle": "stylish-shirt-zbxf",
"has_only_default_variant": false,
"inventory_tracking": true,
"inventory_policy": "continue",
"need_variant_image": false,
"spu": "SS1234",
"fake_sales": 50,
"display_fake_sales": true,
"mixed_wholesale": true,
"image": {
"src": "//img.fantaskycdn.com/loading.png",
"width": 100,
"height": 100,
"path": "loading.png",
"alt": ""
},
"images": [
{
"id": "15333433-a0d5-44c9-941b-2c59ea07683e",
"product_id": "9fb9f3c6-2300-42c1-8593-d9008d7cfc09",
"position": 1,
"src": "//img.fantaskycdn.com/loading.png",
"width": 100,
"height": 100,
"alt": "",
"created_at": "2024-12-03T19:02:30Z",
"updated_at": "2024-12-03T19:02:30Z"
}
],
"options": [
{
"id": "8e40555e-a152-45fc-9587-fe85280701c5",
"product_id": "9fb9f3c6-2300-42c1-8593-d9008d7cfc09",
"position": 1,
"name": "Size",
"values": [
"Small"
]
}
],
"variants": [
{
"id": "d7c7f9ba-f824-46b6-94af-1c2d1befaf27",
"product_id": "9fb9f3c6-2300-42c1-8593-d9008d7cfc09",
"image_id": "",
"created_at": "2024-12-03T19:02:30Z",
"updated_at": "2024-12-03T19:02:30Z",
"title": "Small-Red",
"option1": "Small",
"option2": "Red",
"option3": "",
"image": {},
"position": 1,
"compare_at_price": "29.99",
"price": "19.99",
"sku": "SS1234-RD-S",
"barcode": "123456789012",
"note": "Limited",
"inventory_quantity": 100,
"weight": "0.50",
"weight_unit": "kg",
"cost_price": "12.99",
"wholesale_price": [
{
"price": "19.99",
"min_quantity": 1
}
],
"extend": {}
}
],
"category": {}
}
}
{
"product": {
"id": "9fb9f3c6-2300-42c1-8593-d9008d7cfc09",
"title": "Stylish Shirt",
"brief": "A stylish shirt.",
"description": "",
"published": true,
"requires_shipping": true,
"taxable": true,
"tags": "shirt,stylish,cotton",
"vendor": "Awesome Vendor",
"vendor_url": "https://awesomevendor.com",
"inventory_quantity": 300,
"published_at": "2024-12-03T19:02:30Z",
"created_at": "2024-12-03T19:02:30Z",
"updated_at": "2024-12-03T19:02:30Z",
"note": "Special promotion item.",
"seo_title": "Buy Stylish Shirt Online",
"seo_description": "Premium cotton",
"seo_keywords": "shirt, cotton, stylish",
"handle": "stylish-shirt-zbxf",
"has_only_default_variant": false,
"inventory_tracking": true,
"inventory_policy": "continue",
"need_variant_image": false,
"spu": "SS1234",
"fake_sales": 50,
"display_fake_sales": true,
"mixed_wholesale": true,
"image": {
"src": "//img.fantaskycdn.com/loading.png",
"width": 100,
"height": 100,
"path": "loading.png",
"alt": ""
},
"images": [
{
"id": "15333433-a0d5-44c9-941b-2c59ea07683e",
"product_id": "9fb9f3c6-2300-42c1-8593-d9008d7cfc09",
"position": 1,
"src": "//img.fantaskycdn.com/loading.png",
"width": 100,
"height": 100,
"alt": "",
"created_at": "2024-12-03T19:02:30Z",
"updated_at": "2024-12-03T19:02:30Z"
},
{
"id": "a926bfff-03b4-4d00-bd85-cae50e7f4941",
"product_id": "9fb9f3c6-2300-42c1-8593-d9008d7cfc09",
"position": 2,
"src": "//img.fantaskycdn.com/loading.png",
"width": 100,
"height": 100,
"alt": "",
"created_at": "2024-12-03T19:02:30Z",
"updated_at": "2024-12-03T19:02:30Z"
}
],
"options": [
{
"id": "8e40555e-a152-45fc-9587-fe85280701c5",
"product_id": "9fb9f3c6-2300-42c1-8593-d9008d7cfc09",
"position": 1,
"name": "Size",
"values": [
"Small",
"Medium",
"Large",
"Extra Large"
]
},
{
"id": "1e340474-6464-4d35-872c-75b751f6aa7f",
"product_id": "9fb9f3c6-2300-42c1-8593-d9008d7cfc09",
"position": 2,
"name": "Color",
"values": [
"Red",
"Blue",
"Black"
]
}
],
"variants": [
{
"id": "d7c7f9ba-f824-46b6-94af-1c2d1befaf27",
"product_id": "9fb9f3c6-2300-42c1-8593-d9008d7cfc09",
"image_id": "",
"created_at": "2024-12-03T19:02:30Z",
"updated_at": "2024-12-03T19:02:30Z",
"title": "Small-Red",
"option1": "Small",
"option2": "Red",
"option3": "",
"image": null,
"position": 1,
"compare_at_price": "29.99",
"price": "19.99",
"sku": "SS1234-RD-S",
"barcode": "123456789012",
"note": "Limited",
"inventory_quantity": 100,
"weight": "0.50",
"weight_unit": "kg",
"cost_price": "12.99",
"wholesale_price": [
{
"price": "19.99",
"min_quantity": 1
}
],
"extend": null
},
{
"id": "c7b74858-ad5a-4da3-9695-bdb936d3c057",
"product_id": "9fb9f3c6-2300-42c1-8593-d9008d7cfc09",
"image_id": "",
"created_at": "2024-12-03T19:02:30Z",
"updated_at": "2024-12-03T19:02:30Z",
"title": "Medium-Blue",
"option1": "Medium",
"option2": "Blue",
"option3": "",
"image": null,
"position": 2,
"compare_at_price": "29.99",
"price": "19.99",
"sku": "SS1234-BL-M",
"barcode": "123456789013",
"note": "Best-selling",
"inventory_quantity": 200,
"weight": "0.60",
"weight_unit": "kg",
"cost_price": "13.99",
"wholesale_price": [
{
"price": "19.99",
"min_quantity": 1
}
],
"extend": null
}
],
"category": null
}
}
422
- application/json
- Schema
- Example
- Result
Schema
{
"errors": [
"Title is required"
]
}
{
"errors": [
"Title is required"
]
}
425
- application/json
- Schema
- Example
- Result
Schema
{
"error": [
"Duplicate requests"
]
}
{ "error": ["Duplicate requests"] }
500
- application/json
- Schema
- Example
- Result
Schema
{
"error": [
"failed to get unique token value"
]
}
{ "error":[ "failed to get unique token value"] }