商品 API 响应模型

使用 response_format: "standard"(默认)时,商品端点返回下列类型。权威 TypeScript 定义:packages/shared/src/products.ts。

端点:详情 · 搜索 · 以图搜索 · 解析

响应信封

Endpoint结构
detail, parse{ product: StandardProductDetail, request_id }
search, search-by-imageStandardProductList & { request_id }
upload-image{ channel, image_id, request_id }

StandardProductDetail

用于商品页与结账的完整商品快照。预览时,product.id 对应 lines[].id,所选 variants[].sku_id 对应 lines[].spec_id。淘宝创单使用预览返回的已解析配对。

标识与渠道

字段类型说明
idstring淘宝 = mi_id(预览传 lines[].id;会周期性变化,勿长期缓存)。1688 = offerId。微店目前为 prod_weidian_{source_product_id}
channelstring1688、taobao 或 weidian
source_product_idstring1688 = offerId(与 id 相同);淘宝 = 原 item_id
source_urlstring规范商品页 URL

本地化文本(title、description)

字段类型说明
originalstring卖场原文(通常为中文)
translatedstring | null按请求 language 翻译的文本
languagestringtranslated 的语言区域
descriptionobject | null长描述(常为 HTML)

定价(price、price_tiers[])

所有金额为 CNY 元(非分)。优先使用 promotion_amount,否则用 display_amount。

字段类型说明
price.original_amountnumber1 件标价(1688 有 retailPrice 时用零售价)
price.display_amountnumber买家可见 1 件价(CNY)
price.promotion_amountnumber | null适用时的促销单价
price.original_currency / display_currencystring恒为 CNY
variants[].price.wholesale_amountnumber | null1688 SKU 批发价(≥2 件;仅新零售价货盘)
price_tiers[]array1688 批发阶梯(新货盘首档 ≥2);淘宝为空
min_order_quantitynumber | null1688 用上游起订量;淘宝零售默认 1
order_quantity_multipleinteger购买数量倍数(一手数量);1688 映射 batchNumber。缺失或无效时,以及淘宝、微店,默认 1。
distribution_min_quantitynumber | null1688 代发最低量

购买数量规则

product.order_quantity_multiple 为正整数,购买数量必须为此值的整数倍。1688 映射 batchNumber(一手数量),缺失或无效时默认 1;淘宝和微店返回 1。

起订量和数量倍数需分别满足。例如 min_order_quantity = 10、order_quantity_multiple = 6 时,数量应从 12、18、24…… 开始,并满足库存及渠道的其他购买规则。

商品详情请求中,response_format: "upstream" 保留原始 batchNumber;该标准字段不会改名原始响应,也不会自动调整下单数量。

媒体(images[]、videos)

字段类型说明
images[].urlstring图片 CDN URL
images[].typeenummain、gallery 或 variant
videos.main / videos.detailstring | null1688 视频;淘宝为 null

属性 vs 规格变体

仅 variants[] 驱动 SKU 选择与订单行。

字段作用
attributes[]CPV 规格——仅展示,不用于 SKU 解析
variants[]可购 SKU 矩阵,含价格、库存、规格

变体对象(variants[])

字段类型说明
sku_idstring所选 SKU 标识,用于预览 spec_id;淘宝创单使用预览解析后的配对
upstream_sku_idstring | null1688 数字 skuId
attributes[]array规格维度(颜色、尺码等)
attributes[].name / valuestring展示文案(按请求 language 翻译)
attributes[].original_name / original_valuestring稳定中文键,用于分组 / 匹配
attributes[].prop_idstring | null上游属性 ID(字符串;淘宝 prop_id;1688 attributeId)。有值时优先于名称文本
attributes[].value_idstring | null上游属性值 ID(字符串;淘宝 value_id)。1688 无 valueId → null
attributes[].imagestring | null规格配图 / 色块图
priceobjectSKU 级价格(元)
stocknumber可用数量;0 = 缺货
imagestring | nullSKU 主图
shippingobject | null1688 SKU 件重尺(见下表);淘宝为 null
min_order_quantitynumber | null1688 商品级下发到各 SKU;淘宝默认 1
distributionobject | null1688 代发定价

淘宝下单前的 SKU 价格

商品展示时,读取所选 variant 的 price.promotion_amount ?? price.display_amount,单位为 CNY 元。不要把商品级价格当作所有 SKU 的价格。淘宝 SKU 金额优先使用上游 SKU 促销价,否则使用 SKU 价格;original_amount 不保证是未优惠的采购原价。目录数据是快照,不是结账报价。

获取当前采购报价时,以所选标识、数量和实际收货地址调用 POST /v1/orders/preview,并确认 success === true。读取 sellers[].lines[].unit_price.amount 获取 SKU 报价单价、line_total.amount 获取返回的行小计。total.payment.amount 是包含国内运费的整单应付金额,不是 SKU 单价。预览 Money 单位为 CNY 分(CNY_minor):5580 表示 55.80 元。未返回行价格时,不要按零价处理。

报价遵循 App 的履约模式。HIOBuy Fulfillment(warehouse)预览排除平台促销,使用未优惠的采购价格,因此可能与目录促销价不同。预览不锁价;create 金额也可能是估算值,创单后应调用 POST /v1/orders/detail,在付款前确认当前订单金额。

SKU 件重尺(variants[].shipping)

映射自 1688 上游 productShippingInfo.skuShippingDetails(SkuShippingDetail)。淘宝无此数据,恒为 null。空值或 0 的尺寸/重量会规范为 null;若该 SKU 完全无件重尺数据,整个 shipping 为 null。

字段类型说明
width_cmnumber | null宽,cm(商家自填)
length_cmnumber | null长,cm
height_cmnumber | null高,cm
weight_kgnumber | null重,kg
official_width_cmnumber | null官方测量宽度,cm
official_length_cmnumber | null官方测量长度,cm
official_height_cmnumber | null官方测量高度,cm
official_weight_kgnumber | null官方测量重量,kg
ai_weight_kgnumber | nullAI 预测重量,kg
ai_weight_accuracystring | nullAI 预测重量在该商品叶子类目的准确率(如 80%)
sourcestring | null件重尺来源(如 商家自填)

运费估算可优先使用 official_*,其次商家自填尺寸/重量,再用 ai_weight_kg(并参考 ai_weight_accuracy)。

卖家、运费与元数据

字段类型说明
seller.id / seller.namestring店铺 ID 与展示名
seller.shop_urlstring | null店铺链接
shipping.shipping_fromstring | null国内发货地区
shipping.domestic_shipping_feeobject | null预估国内运费(元)
metadata.raw_categorystring | null上游类目
metadata.brandstring | null申报品牌
metadata.updated_atstringISO 8601 最后同步时间
trade_scorestring | null1688 质量分

示例(截断)

{
  "product": {
    "id": "554456348334",
    "channel": "1688",
    "source_product_id": "554456348334",
    "min_order_quantity": 10,
    "order_quantity_multiple": 6,
    "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_..."
}

各渠道字段可用性

字段1688TaobaoWeidian
order_quantity_multiplebatchNumber / 111
videos, price_tiers, trade_score✓—视情况
variants[].shipping, distribution✓——
variants[].attributes[].prop_id✓(attributeId)✓(prop_id)—
variants[].attributes[].value_id—(null)✓(value_id)—
下单 lines[].idid / offerIdid(mi_id)平台 ID

StandardProductList

来自搜索与以图搜索。items[] 每项为摘要——需调用详情获取 SKU 矩阵。

字段类型说明
channelstring查询的卖场
keywordstring关键词回显(纯以图搜索时为空)
page / page_sizenumber已应用的分页
totalnumber上游总数(可能为近似值)
items[]arrayStandardProductListItem 对象
pic_region_infoobject以图搜索:检测到的裁剪区域

StandardProductListItem

字段类型说明
id, channel, source_product_id, source_urlstring使用搜索结果 id 获取详情;淘宝 source_product_id 是原始 item_id
titleLocalizedTitle列表标题
priceProductPrice摘要价格(CNY 元)
imagestring缩略图 URL
seller.namestring店铺名称

上传图片响应

字段类型说明
channelstring存储图片的卖场
image_idstring在以图搜索中复用

规格选择

  1. 加载详情 → 读取 product.variants。
  2. 按 attributes[].original_name 分组做维度选择器(有 prop_id 时也可按 ID 分组)。
  3. 随用户每次选择过滤变体;禁用缺货选项。
  4. 将商品 id 与所选 variants[].sku_id 传入订单预览。淘宝创单使用预览返回的已解析配对。

匹配键: 淘宝在同时有 prop_id + value_id 时优先用 ID——这是稳定的 CPV 身份,可避免多 SKU 共用同一属性名(如大量选项都叫 Color Classification)导致的串配。UI 分组可回退到 original_name + original_value。name / value 仅用于展示。不要根据文案推断语义类型。

{
  "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 使用同一结构:prop_id 来自 attributeId,value_id 为 null(上游 SkuAttribute 无 valueId)。

1688 评分:当前页过滤

items[].trade_score: 仅 1688 关键词及店铺标准搜索:上游 tradeScore,数值字符串;缺失或无效时为 null。其他渠道及图片搜索保持不变。

page、page_size、total 保留未筛选的上游含义(上游缺少总数时,total 沿用当前页原始数量)。rating_filter.source_count 是当前页筛选前数量,returned_count 是筛选后数量;rating_filter.scope 固定为 current_page。仅在启用过滤时返回此元数据。

结果可能少于一页,甚至 items 为空,但仍存在后续页。has_next(若有)根据未筛选的上游分页计算;缺失时表示分页信息未知,不能用筛选后数量判断结束。客户端继续翻页时应设置最大页数。

rating_start: 可选的 1688 当前页最低 trade_score;JSON 数字 ≥ 0,仅标准格式支持。分页、缺失评分及示例见 1688 评分过滤。

获取支持

需要集成帮助?请联系开发者支持 support@hiobuy.com · 预计 1–2 个工作日内回复

发送邮件