Model phản hồi Product API
Với response_format: "standard" (mặc định), endpoint sản phẩm trả về các kiểu dưới đây. TypeScript chính thức: packages/shared/src/products.ts.
Endpoints: detail · search · image search · parse
Envelope phản hồi {#envelope}
| Endpoint | Shape |
|---|---|
detail, parse | { product: StandardProductDetail, request_id } |
search, search-by-image | StandardProductList & { request_id } |
upload-image | { channel, image_id, request_id } |
StandardProductDetail {#standard-product-detail}
Snapshot sản phẩm đầy đủ cho trang sản phẩm và checkout. Map sang đơn hàng: search/detail id → lines[].id (offer_id / Taobao mi_id still accepted), variants[].sku_id → spec_id (Procurement orders).
Danh tính & kênh
| Field | Type | Description |
|---|---|---|
id | string | Taobao = mi_id (lines[].id đơn hàng; thay đổi định kỳ — không cache lâu). 1688 = offerId. Weidian hiện dùng prod_weidian_{source_product_id} |
channel | string | 1688, taobao, hoặc weidian |
source_product_id | string | 1688 = offerId (same as id); Taobao = original item_id |
source_url | string | URL trang sản phẩm chính tắc |
Văn bản bản địa hóa (title, description)
| Field | Type | Description |
|---|---|---|
original | string | Văn bản marketplace (thường là tiếng Trung) |
translated | string | null | Bản dịch cho language được yêu cầu |
language | string | Locale của translated |
description | object | null | Chi tiết dài (thường là HTML) |
Giá (price, price_tiers[])
Tất cả số tiền là CNY yuan (không phải fen). Ưu tiên promotion_amount khi có, nếu không dùng display_amount.
| Field | Type | Description |
|---|---|---|
price.original_amount | number | Giá niêm yết trước khuyến mãi |
price.display_amount | number | Giá hiển thị cho người mua (CNY) |
price.promotion_amount | number | null | Đơn giá khuyến mãi khi áp dụng |
price.original_currency / display_currency | string | Luôn là CNY |
price_tiers[] | array | Bậc giá sỉ 1688 (offer mới bắt đầu ≥2); rỗng trên Taobao |
min_order_quantity | number | null | MOQ 1688 |
distribution_min_quantity | number | null | Số lượng tối thiểu dropship 1688 |
Media (images[], videos)
| Field | Type | Description |
|---|---|---|
images[].url | string | URL CDN ảnh |
images[].type | enum | main, gallery, hoặc variant |
videos.main / videos.detail | string | null | Video 1688; Taobao null |
Attributes so với variants
Chỉ variants[] điều khiển việc chọn SKU và order lines.
| Field | Vai trò |
|---|---|
attributes[] | CPV specs — chỉ hiển thị, không dùng để resolve SKU |
variants[] | Ma trận SKU có thể mua, gồm giá, tồn kho, specs |
Object variant (variants[])
| Field | Type | Description |
|---|---|---|
sku_id | string | Truyền làm spec_id khi order create |
upstream_sku_id | string | null | skuId số của 1688 |
attributes[] | array | Chiều spec (màu, size, …) |
attributes[].name / value | string | Nhãn hiển thị (đã dịch theo language) |
attributes[].original_name / original_value | string | Khóa tiếng Trung ổn định để nhóm / khớp |
attributes[].prop_id | string | null | ID thuộc tính upstream dạng string (Taobao prop_id; 1688 attributeId). Ưu tiên hơn tên văn bản |
attributes[].value_id | string | null | ID giá trị upstream dạng string (Taobao value_id). 1688 không có valueId → null |
attributes[].image | string | null | Ảnh tùy chọn / mẫu màu |
price | object | Giá cấp SKU theo yuan |
stock | number | Số lượng khả dụng; 0 = hết hàng |
image | string | null | Ảnh chính của SKU |
shipping | object | null | Kích thước kiện SKU 1688 (bảng bên dưới); Taobao là null |
min_order_quantity | number | null | MOQ 1688 (giá trị cấp sản phẩm trên mỗi SKU) |
distribution | object | null | Giá dropship 1688 |
Kích thước kiện SKU (variants[].shipping)
Ánh xạ từ upstream 1688 productShippingInfo.skuShippingDetails (SkuShippingDetail). Taobao không có tương đương — luôn null. Giá trị rỗng hoặc 0 được chuẩn hóa thành null; nếu SKU không có dữ liệu, shipping là null.
| Trường | Kiểu | Mô tả |
|---|---|---|
width_cm | number | null | Rộng, cm (người bán khai báo) |
length_cm | number | null | Dài, cm |
height_cm | number | null | Cao, cm |
weight_kg | number | null | Nặng, kg |
official_width_cm | number | null | Chiều rộng đo chính thức, cm |
official_length_cm | number | null | Chiều dài đo chính thức, cm |
official_height_cm | number | null | Chiều cao đo chính thức, cm |
official_weight_kg | number | null | Trọng lượng đo chính thức, kg |
ai_weight_kg | number | null | Trọng lượng dự đoán AI, kg |
ai_weight_accuracy | string | null | Độ chính xác trọng lượng AI theo danh mục lá (vd. 80%) |
source | string | null | Nguồn kích thước (vd. 商家自填) |
Khi ước tính cước, ưu tiên official_*, rồi kích thước/trọng lượng người bán, rồi ai_weight_kg (dùng ai_weight_accuracy làm gợi ý độ tin cậy).
Người bán, vận chuyển & metadata
| Field | Type | Description |
|---|---|---|
seller.id / seller.name | string | Shop id và tên hiển thị |
seller.shop_url | string | null | Link storefront |
shipping.shipping_from | string | null | Khu vực gửi hàng nội địa |
shipping.domestic_shipping_fee | object | null | Phí nội địa ước tính theo yuan |
metadata.raw_category | string | null | Danh mục upstream |
metadata.brand | string | null | Thương hiệu khai báo |
metadata.updated_at | string | Lần đồng bộ cuối ISO 8601 |
trade_score | string | null | Điểm chất lượng 1688 |
Ví dụ (đã rút gọn)
{
"product": {
"id": "554456348334",
"channel": "1688",
"source_product_id": "554456348334",
"title": {
"original": "...",
"translated": "...",
"language": "en"
},
"price": {
"display_amount": 29.9,
"promotion_amount": 24.9
},
"variants": [
{
"sku_id": "b266e0...",
"upstream_sku_id": "12123313",
"stock": 100,
"shipping": {
"width_cm": 10,
"length_cm": 10,
"height_cm": 10,
"weight_kg": 1.2,
"official_width_cm": 5,
"official_length_cm": 12,
"official_height_cm": 14,
"official_weight_kg": 0.001,
"ai_weight_kg": 0.001,
"ai_weight_accuracy": "80%",
"source": "商家自填"
}
}
]
},
"request_id": "req_..."
}Khả dụng field theo kênh
| Field | 1688 | Taobao | Weidian |
|---|---|---|---|
videos, price_tiers, trade_score | ✓ | — | Tùy trường hợp |
variants[].shipping, distribution | ✓ | — | — |
variants[].attributes[].prop_id | ✓ (attributeId) | ✓ (prop_id) | — |
variants[].attributes[].value_id | — (null) | ✓ (value_id) | — |
source_product_id cho orders | offerId | mi_id | Platform id |
StandardProductList {#standard-product-list}
Từ search và image search. Mỗi mục items[] là tóm tắt — gọi detail để lấy ma trận SKU.
| Field | Type | Description |
|---|---|---|
channel | string | Marketplace được truy vấn |
keyword | string | Echo của keyword (rỗng khi chỉ tìm bằng ảnh) |
page / page_size | number | Phân trang đã áp dụng |
total | number | Tổng upstream (có thể xấp xỉ) |
items[] | array | Object StandardProductListItem |
pic_region_info | object | Tìm bằng ảnh: vùng crop được phát hiện |
StandardProductListItem
| Field | Type | Description |
|---|---|---|
id, channel, source_product_id, source_url | string | Dùng source_product_id để fetch detail |
title | LocalizedTitle | Tiêu đề listing |
price | ProductPrice | Giá tóm tắt bằng CNY yuan |
image | string | URL thumbnail |
seller.name | string | Tên shop |
Phản hồi upload-image {#upload-image-response}
| Field | Type | Description |
|---|---|---|
channel | string | Marketplace đã lưu ảnh |
image_id | string | Tái sử dụng trong image search |
Chọn variant {#variant-selection}
- Load detail → đọc
product.variants. - Nhóm theo
attributes[].original_namecho bộ chọn chiều (hoặc theoprop_idnếu có). - Lọc variant theo từng lựa chọn của người dùng; disable tùy chọn hết hàng.
- Truyền
sku_idvàsource_product_idkhớp sang order preview.
Khóa khớp: với Taobao, ưu tiên prop_id + value_id khi có (định danh CPV ổn định; tránh nhầm khi nhiều SKU dùng cùng tên thuộc tính). Nhóm UI dùng original_name + original_value. name / value chỉ để hiển thị. Không suy luận kiểu ngữ nghĩa từ nhãn.
{
"prop_id": "1627207",
"value_id": "43553464153",
"name": "Color Classification",
"value": "[Special for Bicycle Maintenance] Professional 46-Piece Set",
"original_name": "颜色分类",
"original_value": "【自行车维修专用】专业46件套",
"image": "https://img.alicdn.com/..."
}1688 dùng cùng cấu trúc: prop_id ← attributeId và value_id: null (SkuAttribute upstream không có valueId).
Get Support
Need integration help? Contact Developer Support at support@hiobuy.com · Response within 1–2 business days