v2.product.get_weight_recommendation
POST /api/v2/product/get_weight_recommendation
Get recommended weight. Now only BR shop support to use this api to get recommended weight.
Đường dẫn Endpoint
URL: https://partner.shopeemobile.com/api/v2/product/get_weight_recommendation
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_name | string | True | paper | Name of the item in local language. |
| cover_image_id | string | True | e9a76cf159c3e7f12510a7017e120467 | Image id of first product image. |
| category_id | int | True | 100061 | Shopee's mã định danh duy nhất for a category. |
| attribute_list | object[] | True | ||
| attribute_id | int | True | 100019 | The Identify of each attribute. |
| attribute_value_list | object[] | True | ||
| value_id | int | True | 1009 | Mã định danh duy nhất for value of this item attribute. |
| original_value_name | string | False | value | Value name of this item attribute. |
| value_unit | string | False | kg | Value unit of this item attribute. |
| brand_id | int | True | 100021 | Id of brand. |
| description_type | string | True | extended | Type of description, values: See Data Definition- description_type (normal , extended). |
| description | string | False | If description_type is normal , Description information should be set by this field. | |
| description_info | object | False | New description field. Only whitelist sellers can use it. If you use the field, please upload the description_type=extended. | |
| extended_description | object | False | If description_type is extended , Description information should be set by this field. | |
| field_list | object[] | False | Field of extended description. | |
| field_type | string | False | text | Type of extended description field, values: See Data Definition- description_field_type (text , image). |
| text | string | False | desc text | If field_type is text, text information will be set by this field. |
| image_info | object | False | If field_type is image, image information will be set by this field. | |
| image_id | string | False | 564d29618a333337fa1798f20476c4f5 | Image id. |
Tham số Response
| Tên | Kiểu | Mẫu | Mô tả |
|---|---|---|---|
| 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 | Indicate waring details if hit waring. Empty if no waring happened. | |
| request_id | string | 41b0c8c1c414ed0624bf1c9ebdb21d20 | The identifier for an API request for error tracking |
| response | object | ||
| normal_weight_range | float[] | [0.1,0.5] | Recommended weight range, in kg. If there are no recommended results, return empty. |
| error | string | error_param | Loại lỗi nếu có lỗi xảy ra. Trống nếu không có lỗi. |
Dữ liệu gửi
]
}
],
"brand_id": 100021,
"description_type": "extended",
"description_info": {
"extended_description": {
"field_list": [
{
"field_type": "text",
"text": "desc text",
}
]
}
}
}Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://open.admin.uat.shopee.io/api/v2/product/get\_weight\_recommendation?access\_token=access\_token&partner\_id=partner\_id&shop\_id=shop\_id&sign=sign×tamp=timestamp")
.header("Content-Type","application/json")
.body("{
"attribute_list": [
{
"attribute_id": 0,
"attribute_value_list": [
{
"original_value_name": "-",
"value_id": 0,
"value_unit": "-"
}
]
}
],
"brand_id": 0,
"category_id": 0,
"cover_image_id": "xaszciahddms",
"description": "-",
"description_info": {
"extended_description": {
"field_list": [
{
"field_type": "-",
"image_info": {
"image_id": "-"
},
"text": "-"
}
]
}
},
"description_type": "-",
"item_name": "paper"
}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://open.admin.uat.shopee.io/api/v2/product/get\_weight\_recommendation?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 => '{
"attribute_list": [
{
"attribute_id": 0,
"attribute_value_list": [
{
"original_value_name": "-",
"value_id": 0,
"value_unit": "-"
}
]
}
],
"brand_id": 0,
"category_id": 0,
"cover_image_id": "xaszciahddms",
"description": "-",
"description_info": {
"extended_description": {
"field_list": [
{
"field_type": "-",
"image_info": {
"image_id": "-"
},
"text": "-"
}
]
}
},
"description_type": "-",
"item_name": "paper"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
curl --location --request POST 'https://open.admin.uat.shopee.io/api/v2/product/get\_weight\_recommendation?access\_token=access\_token&partner\_id=partner\_id&shop\_id=shop\_id&sign=sign×tamp=timestamp'
--header 'Content-Type: application/json'
--data-raw '{
"attribute_list": [
{
"attribute_id": 0,
"attribute_value_list": [
{
"original_value_name": "-",
"value_id": 0,
"value_unit": "-"
}
]
}
],
"brand_id": 0,
"category_id": 0,
"cover_image_id": "xaszciahddms",
"description": "-",
"description_info": {
"extended_description": {
"field_list": [
{
"field_type": "-",
"image_info": {
"image_id": "-"
},
"text": "-"
}
]
}
},
"description_type": "-",
"item_name": "paper"
}'
import requests
import json
url = "https://open.admin.uat.shopee.io/api/v2/product/get\_weight\_recommendation?access\_token=access\_token&partner\_id=partner\_id&shop\_id=shop\_id&sign=sign×tamp=timestamp"
payload=json.dumps({
"attribute_list": [
{
"attribute_id": 0,
"attribute_value_list": [
{
"original_value_name": "-",
"value_id": 0,
"value_unit": "-"
}
]
}
],
"brand_id": 0,
"category_id": 0,
"cover_image_id": "xaszciahddms",
"description": "-",
"description_info": {
"extended_description": {
"field_list": [
{
"field_type": "-",
"image_info": {
"image_id": "-"
},
"text": "-"
}
]
}
},
"description_type": "-",
"item_name": "paper"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST",url,headers=headers, data=payload, allow_redirects=False)
print(response.text)
, "error": "" }