来自 Shopee 官方资料快照 ·
- 当前资料结构化阅读页
- 固定快照已留存,可追溯
- 官方原文可核对
资料正文
§1 How do I use the "v2.product.update_tier_variation" API to update variations?
How do I use the "v2.product.update_tier_variation" API to update variations?
Assuming that the product has 3 models, red, yellow, and blue, at the beginning. The info about "tier_index"/ "option"/ "original_price"/ "stock"/ "model_sku"/ "model_id" is as follows:
Scenario 1: The seller wants to delete the yellow color and call the "v2.product.update_tier_variation" API to upload the "model_list" parameter
{
"item_id": 800250275,
"tier_variation": [
{
"name": "Color",
"option_list": [
{
"option": "red"
},
{
"option": "blue"
}
]
}
],
"model_list": [
{
"tier_index": [0],
"model_id": 10000
},
{
"tier_index": [1],
"model_id": 30000
}
]
}
The result will be:
If you call the "v2.product.update_tier_variation" API without uploading the "model_list" parameter:
{
"item_id": 800250275,
"tier_variation": [
{
"name": "Color",
"option_list": [
{
"option": "red"
},
{
"option": "blue"
}
]
}
]
}
The result will be:
Scenario 2: The seller wants to add a green color with the option order: red, yellow, green, and blue by calling the "v2.product.update_tier_variation" API
{
"item_id": 800250275,
"tier_variation": [
{
"name": "Color",
"option_list": [
{
"option": "red"
},
{
"option": "yellow"
},
{
"option": "green"
},
{
"option": "blue"
}
]
}
],
"model_list": [
{
"tier_index": [0],
"model_id": 10000
},
{
"tier_index": [1],
"model_id": 20000
},
{
"tier_index": [3],
"model_id": 30000
}
]
}
The result will be:
Then, call the "v2.product.add_model" API to add the green model's info, including "stock", "original_price", and "model_sku".
{
"item_id": 800250275,
"model_list": [
{
"tier_index": [2],
"original_price": 444,
"model_sku": "sku4",
"seller_stock": [
{
"stock": 44
}
]
}
]
}
The result will be:
In summary: (Without changing the "tier_variation" structure) If you want to add/delete/adjust the "option" order while keeping the original model info, it is recommended to call the "v2.product.update_tier_variation" API with "model_list" parameter. If you want to change the "tire_variation" structure, please use the "v2.product.init_tier_variation" API.
