Create variant
POST/openapi/2026-07/products/:product_id/variants
Create a new product variant with the specified details.
Request
Path Parameters
The product ID of the variant
- application/json
- Body
- Example
Bodyrequired
- Array [
- ]
variant objectrequired
The variant details
Option 1
Option 2
Option 3
ID of the variant's image
Compare at price (original price)
Price of the variant. The variant price will be set to the item's wholesale's price value when the variant price is 0 and the wholesale's price is not 0
SKU
The barcode of the variant
The note of the variant
Inventory quantity
The weight of the variant
Unit of weight, possible value are: kg, g, lb, oz
Cost price
wholesale_price object[]
Wholesale price list
Price
Mini Order Quantity
Retail price of the variant
Position of the variant in the list
extend object
Extend of the variant
Length of the variant
Width of the variant
Height of the variant
Dimension unit, possible value are: cm, in, mm
Origin country of the variant
Harmonized System Code of the variant
{
"variant": {
"option1": "string",
"option2": "string",
"option3": "string",
"image_id": "string",
"compare_at_price": 0,
"price": 0,
"sku": "string",
"barcode": "string",
"note": "string",
"inventory_quantity": 0,
"weight": 0,
"weight_unit": "string",
"cost_price": 0,
"wholesale_price": [
{
"price": 0,
"min_quantity": 0
}
],
"retail_price": 0,
"position": 0,
"extend": {
"length": 0,
"width": 0,
"height": 0,
"dimension_unit": "string",
"origin_country_code": "string",
"hs_code": "string"
}
}
}
Responses
- 200
OK
- application/json
- Schema
- Example
Schema
- Array [
- ]
error code
error message
data object
variant object
The created variant
The unique identifier of the variant
The product ID this variant belongs to
The image ID of the variant
The time of the variant was created
The time of the variant was updated
Title of the variant
The first option of the variant
The second option of the variant
The third option of the variant
image object
The image of the variant
Image's URL
Image's width in px
Image's height in px
Image's alt
Image's path
The position of the variant in the product
The compare at price of the variant
The price of the variant
The SKU of the variant
The barcode of the variant
The note of the variant
The inventory quantity of the variant
The weight of the variant
The weight unit of the variant, possible value are: kg, g, lb, oz
The cost price of the variant
whole_prices object[]
The whole prices of the variant
Price
Mini Order Quantity
The retail price of the variant
Whether the variant is discount
The origin price of the variant
extend object
Extend of the variant
The length of the variant
The width of the variant
The height of the variant
The dimension unit
Origin_country_code
Hs_code
{
"code": "string",
"message": "string",
"data": {
"variant": {
"id": "string",
"product_id": "string",
"image_id": "string",
"created_at": "string",
"updated_at": "string",
"title": "string",
"option1": "string",
"option2": "string",
"option3": "string",
"image": {
"src": "string",
"width": 0,
"height": 0,
"alt": "string",
"path": "string"
},
"position": 0,
"compare_at_price": 0,
"price": 0,
"sku": "string",
"barcode": "string",
"note": "string",
"inventory_quantity": 0,
"weight": 0,
"weight_unit": "string",
"cost_price": 0,
"whole_prices": [
{
"price": 0,
"min_quantity": 0
}
],
"retail_price": 0,
"is_discount": true,
"origin_price": 0,
"extend": {
"length": 0,
"width": 0,
"height": 0,
"dimension_unit": "string",
"origin_country_code": "string",
"hs_code": "string"
}
}
}
}