v2.product.update_tier_variation
POST /api/v2/product/update_tier_variation
This api can only be used without changing the tier structure, you can add options, delete options, and update the option image by this api. More detail please check: https://open.shopee.com/developer-guide/219
Đường dẫn Endpoint
URL: https://partner.shopeemobile.com/api/v2/product/update_tier_variation
Tham số chung
| Tên | Kiểu | Mẫu | Mô tả |
|---|---|---|---|
| partner_id | int | 1 | Partner ID được gán khi đăng ký thành công. Bắt buộc cho tất cả các yêu cầu. |
| timestamp | timestamp | 1610000000 | Dùng để chỉ định thời gian của yêu cầu. Bắt buộc cho tất cả các yêu cầu. Hết hạn sau 5 phút. |
| access_token | string | c09222e3fc40ffb25fc947f738b1abf1 | Token truy cập API, dùng để xác định quyền của bạn đối với API. Có thể sử dụng nhiều lần và hết hạn sau 4 giờ. |
| shop_id | int | 600000 | Mã định danh duy nhất của Shopee cho một cửa hàng. Tham số bắt buộc cho hầu hết các API. |
| sign | string | e318d3e932719916a9f9ebb57e2011961bd47abfa54a36e040d050d8931596e2 | Signature generated by partner_id, api path, timestamp, access_token, shop_id and partner_key via HMAC-SHA256 hashing algorithm. More details: https://open.shopee.com/documents?module=87&type=2&id=58&version=2 |
Tham số Request
| Tên | Kiểu | Bắt buộc | Mẫu | Mô tả |
|---|---|---|---|---|
| item_id | int64 | True | 1000 | ID of item. |
| model_list | object[] | False | Item's model list | |
| model_id | int64 | True | 1002066586922 | ID of model |
| tier_index | int64[] | True | [1,1] | Model's tier_variation |
| standardise_tier_variation | object[] | False | item standardise biến thể theo cấp There is at least one standardise_tier_variation and tier_variation | |
| variation_id | int64 | True | standardise biến thể theo cấp ID | |
| variation_name | string | False | standardise biến thể theo cấp name | |
| variation_group_id | int64 | False | standardise biến thể theo cấp group id | |
| variation_option_list | object[] | True | standardise biến thể theo cấp option list | |
| variation_option_id | int64 | True | standardise biến thể theo cấp option ID | |
| variation_option_name | string | False | standardise biến thể theo cấp option value | |
| image_id | string | False | ID of image |
Tham số Response
| Tên | Kiểu | Mẫu | Mô tả |
|---|---|---|---|
| error | string | Loại lỗi nếu có lỗi xảy ra. Trống nếu không có lỗi. | |
| message | string | Chi tiết lỗi nếu có lỗi xảy ra. Trống nếu không có lỗi. | |
| warning | string | Warning message. | |
| request_id | string | The identifier for an API request for error tracking |
Dữ liệu gửi
,{"model_id":276195602327,"tier_index":[1]},{"model_id":276195602328,"tier_index":[2]},{"model_id":276195602329,"tier_index":[3]},{"model_id":276195602330,"tier_index":[4]},{"model_id":276195602331,"tier_index":[5]},{"model_id":276195602332,"tier_index":[6]},{"model_id":276195602333,"tier_index":[7]},{"model_id":276195602334,"tier_index":[8]},{"model_id":276195602335,"tier_index":[9]},{"model_id":276195602336,"tier_index":[10]},{"model_id":276195602337,"tier_index":[11]},{"model_id":276195602338,"tier_index":[12]},{"model_id":276195602339,"tier_index":[13]},{"model_id":276195602340,"tier_index":[14]},{"model_id":276195602341,"tier_index":[15]}],"standardise_tier_variation":[{"variation_id":0,"variation_name":"Warna","variation_option_list":[{"variation_option_id":0,"variation_option_name":"GSCM A1","image_id":"id-11134207-7ra0j-mdpqg26q6lawfe"},{"variation_option_id":0,"variation_option_name":"GSCM A2","image_id":"id-11134207-7ra0o-mdpqg26q7zvcec"},{"variation_option_id":0,"variation_option_name":"GSCM A3","image_id":"id-11134207-7ra0j-mdpqg26q9efsa1"},{"variation_option_id":0,"variation_option_name":"GSCM A4","image_id":"id-11134207-7ra0r-mdpqg26qat0874"},{"variation_option_id":0,"variation_option_name":"GSCM A5","image_id":"id-11134207-7ra0n-mdpqeryrcrovc6"},{"variation_option_id":0,"variation_option_name":"GSCM A6","image_id":"id-11134207-7ra0o-mdpqeryre69b67"},{"variation_option_id":0,"variation_option_name":"GSCM A7","image_id":"id-11134207-7ra0o-mdpqeryrfktra9"},{"variation_option_id":0,"variation_option_name":"GSCM A8","image_id":"id-11134207-7ra0p-mdpqeryrgze7c6"},{"variation_option_id":0,"variation_option_name":"GSCM A9","image_id":"id-11134207-7ra0h-mdpqeryridyne5"},{"variation_option_id":0,"variation_option_name":"GSCM A10","image_id":"id-11134207-7ra0u-mdpqeryrjsj36d"},{"variation_option_id":0,"variation_option_name":"GSCM A11","image_id":"id-11134207-7ra0l-mdpqeryrl73j59"},{"variation_option_id":0,"variation_option_name":"GSCM A12","image_id":"id-11134207-7ra0i-mdpv3c3tk70s2d"},{"variation_option_id":0,"variation_option_name":"GSCM A13","image_id":"id-11134207-7ra0l-mdpv3c3tlll891"},{"variation_option_id":0,"variation_option_name":"GSCM A14","image_id":"id-11134207-7ra0o-mdpv3c3tn05o55"},{"variation_option_id":0,"variation_option_name":"GSCM A15","image_id":"id-11134207-7ra0l-mdpv3c3toeq4eb"},{"variation_option_id":0,"variation_option_name":"GSCM A16","image_id":"id-11134207-7ra0i-mdpv3c3tptak60"}]}]}Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://partner.uat.shopeemobile.com/api/v2/product/update\_tier\_variation?sign=sign&access\_token=access\_token×tamp=timestamp&shop\_id=shop\_id&partner\_id=partner\_id")
.header("Content-Type","application/json")
.body("{
"item_id": 1000,
"tier_variation": [
{
"name": "-",
"option_list": [
{
"image": {
"image_id": "-"
},
"option": "-"
}
]
}
]
}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://partner.uat.shopeemobile.com/api/v2/product/update\_tier\_variation?access\_token=access\_token&partner\_id=partner\_id&shop\_id=shop\_id&sign=sign×tamp=timestamp',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"item_id": 1000,
"tier_variation": [
{
"name": "-",
"option_list": [
{
"image": {
"image_id": "-"
},
"option": "-"
}
]
}
]
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
curl --location --request POST 'https://partner.uat.shopeemobile.com/api/v2/product/update\_tier\_variation?access\_token=access\_token×tamp=timestamp&shop\_id=shop\_id&partner\_id=partner\_id&sign=sign'
--header 'Content-Type: application/json'
--data-raw '{
"item_id": 1000,
"tier_variation": [
{
"name": "-",
"option_list": [
{
"image": {
"image_id": "-"
},
"option": "-"
}
]
}
]
}'
import requests
import json
url = "https://partner.uat.shopeemobile.com/api/v2/product/update\_tier\_variation?access\_token=access\_token&partner\_id=partner\_id&shop\_id=shop\_id&sign=sign×tamp=timestamp"
payload=json.dumps({
"item_id": 1000,
"tier_variation": [
{
"name": "-",
"option_list": [
{
"image": {
"image_id": "-"
},
"option": "-"
}
]
}
]
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST",url,headers=headers, data=payload, allow_redirects=False)
print(response.text)