版本:202201
更新子款式
PUT/openapi/2022-01/variants/:variant_id
根据提供的信息更新已有的子款式。
请求
Path参数
variant_id string必填
待更新的子款式 ID。
- application/json
- 请求体
- 示例
请求体
- Array [
- ]
variant object
option1string
The first style value of the variant
option2string
The second style value of the variant
option3string
The third style value of the variant
image object
Variant image, mandatory if need_variant_image is true
srcstring必填
Image's URL
widthint32
Image's width in px
heightint32
Image's height in px
altstring
Image's alt
image_idstring
compare_at_pricestring
Variant original price, used for comparison with the actual price, can be converted to float64, supports only two decimal places
pricestring
Variant actual price, can be converted to float64, supports only two decimal places, set to "0.00" if price needs to be empty
skustring
SKU
barcodestring
The barcode of the variant.
notestring
inventory_quantityint32
weightstring
weight_unitstring
Weight unit, supports kg, g, lb, oz
cost_pricestring
wholesale_price object[]
pricestring
min_quantityint32
Mini Order Quantity
{
"variant": {
"option1": "string",
"option2": "string",
"option3": "string",
"image": {
"src": "string",
"width": 0,
"height": 0,
"alt": "string"
},
"image_id": "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
}
]
}
}
响应
- 200
- 422
200
- application/json
- 数据结构
- 示例
- Result
数据结构
- Array [
- ]
variant object
idstring
示例:
88e68830-4ef5-4125-bf7d-aef8047176b2product_idstring
示例:
a1a88be0-a1d4-47e4-a2f2-ba6e131cf447image_idstring
示例:
8ef098c5-5a08-44b4-b5fb-89214bb507dccreated_atstring
示例:
2024-04-17T02:15:18Zupdated_atstring
示例:
2024-04-17T02:15:18Ztitlestring
示例:
S-blue-Toption1string
示例:
Soption2string
示例:
blueoption3string
示例:
Timage object
srcstring
示例:
//cdn.shoplazza.com/ccf0794c594bad32a320eea0d6bfe40c.jpegwidthinteger
默认值:
0示例:
174heightinteger
默认值:
0示例:
180pathstring
示例:
ccf0794c594bad32a320eea0d6bfe40c.jpegaltstring
示例:
positioninteger
默认值:
0示例:
1compare_at_pricestring
示例:
12.10pricestring
示例:
10.10skustring
示例:
T-M-S-blue-T-A001004barcodestring
示例:
6929000212340notestring
示例:
nodeinventory_quantityinteger
默认值:
0示例:
10weightstring
示例:
1.10weight_unitstring
示例:
kgcost_pricestring
示例:
1.10wholesale_price object[]
pricestring
示例:
10.10min_quantityinteger
默认值:
0示例:
1extend object
lengthinteger
默认值:
0示例:
10widthinteger
默认值:
0示例:
10heightinteger
默认值:
0示例:
10dimension_unitstring
示例:
inorigin_country_codestring
示例:
AGhs_codestring
示例:
62114390{
"variant": {
"id": "88e68830-4ef5-4125-bf7d-aef8047176b2",
"product_id": "a1a88be0-a1d4-47e4-a2f2-ba6e131cf447",
"image_id": "8ef098c5-5a08-44b4-b5fb-89214bb507dc",
"created_at": "2024-04-17T02:15:18Z",
"updated_at": "2024-04-17T02:15:18Z",
"title": "S-blue-T",
"option1": "S",
"option2": "blue",
"option3": "T",
"image": {
"src": "//cdn.shoplazza.com/ccf0794c594bad32a320eea0d6bfe40c.jpeg",
"width": 174,
"height": 180,
"path": "ccf0794c594bad32a320eea0d6bfe40c.jpeg",
"alt": ""
},
"position": 1,
"compare_at_price": "12.10",
"price": "10.10",
"sku": "T-M-S-blue-T-A001004",
"barcode": "6929000212340",
"note": "node",
"inventory_quantity": 10,
"weight": "1.10",
"weight_unit": "kg",
"cost_price": "1.10",
"wholesale_price": [
{
"price": "10.10",
"min_quantity": 1
}
],
"extend": {
"length": 10,
"width": 10,
"height": 10,
"dimension_unit": "in",
"origin_country_code": "AG",
"hs_code": "62114390"
}
}
}
{
"variant":
{
"id": "88e68830-4ef5-4125-bf7d-aef8047176b2",
"product_id": "a1a88be0-a1d4-47e4-a2f2-ba6e131cf447",
"image_id": "8ef098c5-5a08-44b4-b5fb-89214bb507dc",
"created_at": "2024-04-17T02:15:18Z",
"updated_at": "2024-04-17T02:15:18Z",
"title": "S-blue-T",
"option1": "S",
"option2": "blue",
"option3": "T",
"image": {
"src": "//cdn.shoplazza.com/ccf0794c594bad32a320eea0d6bfe40c.jpeg",
"width": 174,
"height": 180,
"path": "ccf0794c594bad32a320eea0d6bfe40c.jpeg",
"alt": ""
},
"position": 1,
"compare_at_price": "12.10",
"price": "10.10",
"sku": "T-M-S-blue-T-A001004",
"barcode": "6929000212340",
"note": "node",
"inventory_quantity": 10,
"weight": "1.10",
"weight_unit": "kg",
"cost_price": "1.10",
"wholesale_price": [
{
"price": "10.10",
"min_quantity": 1
}
],
"extend": {
"length": 10,
"width": 10,
"height": 10,
"dimension_unit": "in",
"origin_country_code": "AG",
"hs_code": "62114390"
}
}
}
422
- application/json
- 数据结构
- 示例
- Result
数据结构
errorsstring[]
{
"errors": [
"No variants found"
]
}
{
"errors": [
"No variants found"
]
}