v2.product.get_model_list
GET/api/v2/product/get_model_listGọi qua 360: GET https://partner.quantri360.com/v1/shopee/api/v2/product/get_model_list
Mô tả API
Phân loại (model) của MỘT sản phẩm: cấu trúc phân loại (màu, size…), từng phân loại với SKU, giá gốc / giá đang bán, tồn theo từng kho, trạng thái. Nguồn chính để đồng bộ giá và tồn kho theo SKU.
total_available_stockcó thể nhỏ hơn tổngseller_stock[].stock: kho cóif_saleable = falsekhông được tính (ví dụ thật: kho VNZ 1 + kho VN-MAU-02 2 → bán được 1).- Sản phẩm không phân loại (
has_model = false): đọc giá / tồn ở get_item_base_info. - item_id sai →
error: ".error_busi", message "please input correct product id".
Request
Địa chỉ
GET https://partner.quantri360.com/v1/shopee/api/v2/product/get_model_list
Xác thực & gian hàng
| Tên | Vị trí | Kiểu | Mẫu | Mô tả |
|---|---|---|---|---|
| Authorization | header | header | Bearer q360_live_ab12cd34_… | Khóa API của brand (tạo ở mục API key). Bắt buộc với mọi request. Brand suy từ key — không truyền mã brand. |
| platform_shop_id | query | string | 100001 | Gian hàng (lấy ở GET /v1/platforms → shops[].platform_shop_id). BẮT BUỘC khi brand có > 1 gian hàng trên nền tảng; 360 bỏ tham số này trước khi chuyển tiếp. |
Tham số request
| Tên | Vị trí | Kiểu | Bắt buộc | Mẫu | Mô tả |
|---|---|---|---|---|---|
| item_id | query | int | Có | 10000000081 | Mã sản phẩm (một mã). Sản phẩm phải có phân loại (has_model = true ở get_item_base_info). |
Ví dụ request
curl -s "https://partner.quantri360.com/v1/shopee/api/v2/product/get_model_list?item_id=10000000081" \ -H "Authorization: Bearer $KEY"
Python
import requests
KEY = "q360_live_..." # khóa API của brand
r = requests.get(
"https://partner.quantri360.com/v1/shopee/api/v2/product/get_model_list",
params={
"item_id": 10000000081
},
headers={"Authorization": f"Bearer {KEY}"},
timeout=60,
)
print(r.status_code)
print(r.json())Node.js
const KEY = 'q360_live_...'; // khóa API của brand
const url = new URL('https://partner.quantri360.com/v1/shopee/api/v2/product/get_model_list');
for (const [k, v] of Object.entries({"item_id":10000000081})) url.searchParams.set(k, typeof v === 'object' ? JSON.stringify(v) : String(v));
const r = await fetch(url, {
method: 'GET',
headers: { Authorization: `Bearer ${KEY}` },
});
console.log(r.status, await r.json());PHP
<?php $key = 'q360_live_...'; // khóa API của brand $url = 'https://partner.quantri360.com/v1/shopee/api/v2/product/get_model_list' . '?' . http_build_query(['item_id' => 10000000081]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $key]); $res = curl_exec($ch); $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); echo $status, "\n", $res;
Response
Tham số phản hồi (nguyên của Shopee)
| Tên | Kiểu | Mẫu | Mô tả |
|---|---|---|---|
| request_id | string | d52ca43b277a4f9292fb8be658bfd33d | Mã request của Shopee để tra lỗi. |
| error | string | Mã lỗi Shopee; rỗng = thành công. | |
| message | string | Mô tả lỗi. | |
| warning | string | ||
| response | object | ||
| tier_variation | object[] | Cấu trúc phân loại, tối đa 2 tầng. | |
| name | string | Màu sắc | Tên tầng. |
| option_list | object[] | Lựa chọn theo thứ tự (chỉ số = tier_index). | |
| option | string | Xanh nhạt | |
| image | object | Ảnh lựa chọn (chỉ tầng 1): image_id, image_url. | |
| model | object[] | Từng phân loại. | |
| model_id | int | 10000000091 | Mã phân loại. |
| model_name | string | Xanh đậm,S | Tên = các lựa chọn nối bằng dấu phẩy. |
| tier_index | int[] | [1,0] | Vị trí lựa chọn ở từng tầng của tier_variation. |
| model_sku | string | Sản phẩm mẫu | SKU phân loại. |
| model_status | string | MODEL_NORMAL | `MODEL_NORMAL` (bán được) · `MODEL_UNAVAILABLE` (người mua không chọn được). |
| price_info | object[] | Giá (VND, số nguyên). | |
| original_price | float | 300000 | Giá gốc. |
| current_price | float | 180000 | Giá đang bán (đã trừ khuyến mãi của shop đang chạy). |
| currency | string | VND | |
| promotion_id | int | 10000000100 | Khuyến mãi đang áp; 0 = không. |
| has_promotion | bool | true | |
| stock_info_v2 | object | Tồn kho. | |
| summary_info | object | ||
| total_available_stock | int | 1 | Tồn ĐANG BÁN ĐƯỢC (chỉ cộng kho if_saleable = true). |
| total_reserved_stock | int | 0 | Tồn giữ cho khuyến mãi. |
| seller_stock | object[] | Tồn người bán theo kho. | |
| location_id | string | VNZ | Mã kho — khớp location_id ở get_warehouse_detail. |
| stock | int | 1 | Số lượng. |
| if_saleable | bool | true | `false` = tồn của kho này hiện không bán được (vd kho đang nghỉ lễ). |
| shopee_stock | object[] | Tồn ở kho Shopee (hàng gửi kho Shopee). | |
| advance_stock | object | Tồn gửi trước (sellable_advance_stock, in_transit_advance_stock). | |
| weight | string | 0.5 | Cân nặng (kg) của phân loại. |
| dimension | object | Kích thước gói (cm). | |
| pre_order | object | is_pre_order, days_to_ship. | |
| standardise_tier_variation | object[] | Phân loại chuẩn Shopee tương ứng (variation_id, variation_name, variation_option_list[]); `variation_option_id = 0` = lựa chọn tự đặt. |
Mẫu phản hồi
{
"error": "",
"message": "",
"warning": "",
"request_id": "e3e3e7f35ef6c61a…",
"response": {
"tier_variation": [
{
"name": "Màu sắc",
"option_list": [
{
"option": "Xanh nhạt",
"image": {
"image_id": "vn-10000000092-7r98o-lxm4chmvslazf9",
"image_url": "https://example.com/anh-mau.jpg"
}
},
{
"option": "Xanh đậm",
"image": {
"image_id": "vn-10000000092-7r98o-lxm4clpdu7kp6b",
"image_url": "https://example.com/anh-mau.jpg"
}
}
]
},
{
"name": "Size",
"option_list": [
{
"option": "S"
},
{
"option": "M"
},
{
"option": "L"
},
{
"option": "XL"
}
]
}
],
"model": [
{
"model_id": 10000000091,
"model_name": "Xanh đậm,S",
"promotion_id": 10000000100,
"has_promotion": true,
"tier_index": [
1,
0
],
"price_info": [
{
"current_price": 180000,
"original_price": 300000,
"inflated_price_of_current_price": 180000,
"inflated_price_of_original_price": 300000,
"currency": "VND"
}
],
"model_sku": "Sản phẩm mẫu",
"pre_order": {
"is_pre_order": false,
"days_to_ship": 2
},
"stock_info_v2": {
"summary_info": {
"total_reserved_stock": 0,
"total_available_stock": 1
},
"seller_stock": [
{
"location_id": "VNZ",
"stock": 1,
"if_saleable": true
},
{
"location_id": "VN-MAU-02",
"stock": 2,
"if_saleable": false
}
],
"shopee_stock": [
{
"location_id": "",
"stock": 0
}
],
"advance_stock": {
"sellable_advance_stock": 0,
"in_transit_advance_stock": 0
}
},
"gtin_code": "",
"model_status": "MODEL_NORMAL",
"weight": "0.5",
"dimension": {
"package_length": 25,
"package_width": 20,
"package_height": 10
},
"is_fulfillment_by_shopee": false
}
],
"standardise_tier_variation": [
{
"variation_id": 101054,
"variation_name": "Màu sắc",
"variation_option_list": [
{
"variation_option_id": 0,
"variation_option_name": "Xanh nhạt"
},
{
"variation_option_id": 0,
"variation_option_name": "Xanh đậm"
}
]
},
{
"variation_id": 101056,
"variation_name": "Size",
"variation_group_id": 0,
"variation_option_list": [
{
"variation_option_id": 0,
"variation_option_name": "S"
}
]
}
]
},
"debug_message": ""
}
Mã lỗi của Shopee (15)
Bấm để xem
| Mã | Ý nghĩa |
|---|---|
| error_data | Dữ liệu không tồn tại hoặc không hợp lệ cho thao tác (vd mã không có, loại yêu cầu không cho phép). |
| error_param | Tham số sai / thiếu / sai kiểu — xem `message` để biết tham số nào. |
| error_server | Lỗi hệ thống Shopee — thử lại sau ít phút. |
| error_shop | Gian hàng không hợp lệ — kiểm tra platform_shop_id. |
| error_shop_not_found | Shop is not found. |
| error_item_not_found | Không tìm thấy item_id. |
| error_param_shop_id_not_found | Shop_id is not found. |
| error_inner | Lỗi hệ thống Shopee — thử lại sau. |
| error_auth | Ủy quyền gian hàng cho 360 đã hết hạn hoặc bị thu hồi (360 đã tự làm mới token một lần) — chủ gian hàng kết nối lại Shopee trong Partner. |
| error.param | Can not update item with stock less than reserved stock |
| error_system_busy | Hệ thống đang bận; thử lại sau. |
| error_limit | Chạm hạn mức gọi Shopee trong ngày của kết nối — 360 trả kèm thời điểm thử lại; giảm tần suất gọi. |
| error_rate_limit | Gọi quá nhanh — chờ vài giây rồi gọi lại (360 cũng giới hạn theo key: 429 + Retry-After). |
| shop_banned | Gian hàng đang bị Shopee khóa — mọi API tạm ngưng tới khi gỡ khóa. |
| error_kyc_auth | Gian hàng chưa hoàn tất đăng ký người bán trên Kênh Người Bán. |
Bắt đầu dùng
- Đăng ký tài khoản Partner
- Mở loại dữ liệu thuộc nhóm Sản phẩm ở trang nền tảng
- Tạo API key (tick kênh Shopee)
- Gọi theo ví dụ ở trên