快工助手跨境电商知识与商机助手

How do I use the "v2.product.update_tier_variation" API to update variations?

Shopee 官方资料 · Shopee Open Platform 常见问题(FAQ) · 适合开发者

stable本次发布有变化全部展示

来自 Shopee 官方资料快照 ·

打开官方原文 ↗
  1. 当前资料结构化阅读页
  2. 固定快照已留存,可追溯
  3. 官方原文可核对
查看技术与溯源信息
平台 / profile
Shopee / profile.shopee.faq
语言
en
发布版本
cn-20260909-2
标签
zhuge/sourceplatform/shopeeaudience/developercategory/help_centertopic/apitopic/developertopic/faqtopic/feature-apistopic/product

资料正文

§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.

#