更新时间:2022-09-27 06:12:06下载pdf
本文介绍添加商品的 API。
将商品添加到店铺商品库,支持单个添加。
POST: /v1.0/sellercenter/commodity
body
说明
参数名 | 类型 | 参数位置 | 是否必填 | 说明 |
---|---|---|---|---|
title | String | true | 商品标题,最多 80 个字符。 | |
description | String | false | 商品描述,最多 250 个字符。 | |
brand | String | false | 商品品牌,最多 30 个字符。 | |
code | String | false | 商品编码或者型号,最多 50 个字符。 | |
pid | String | false | 商品 PID,最多 16 个字符。 | |
first_category_code | String | true | 一级类目 Code。 | |
second_category_code | String | true | 二级类目 Code。 | |
third_category_code | String | true | 三级类目 Code。 | |
video | String | false | 商品展示视频。使用该接口时,要求传视频 URL,该 URL 支持通过浏览器打开视频文件。仅支持 MP4 格式,不超过 50M,建议时长 9-30 秒。 | |
video_pic | String | false | 视频展示图。使用该接口时,要求传图片 URL,该 URL 支持通过浏览器打开。当 video 不为空时,该参数为必要参数。 | |
show_pictures | List | true | 商品展示图片。使用该接口时,要求传图片 URL,该 URL 支持通过浏览器打开。最多支持 10 张图片,只支持 JPG、PNG 和 GIF 格式。每张图片的尺寸小于等于 500 KB,建议尺寸 750 × 750 像素。 | |
detail_pictures | List | true | 商品详情图片。使用该接口时,要求传图片 URL,该 URL 支持通过浏览器打开。最多支持 15 张图片,只支持 JPG、PNG 和 GIF 格式。每张图片的尺寸小于等于 3 MB,建议尺寸 750 × 750 像素。 | |
sku_list | List | true | SKU 列表,最多支持 100 组 SKU。 | |
postage_type | Integer | true | 邮费类型。
| |
postage_fee | BigDecimal | false | 商品邮费。如果 postageType 为 2 ,则该字段必填。 | |
install_type | Integer | false | 安装类型。
| |
install_fee | BigDecimal | false | 安装费用。 | |
is_jump | Boolean | false | 是否跳转第三方。
| |
jump_link | String | false | 商品跳转链接。如果 isJump 为 true , 则此字段为必填。 | |
publish | Boolean | false | 商品是否上架。
| |
mall_code | String | true | 商城 code。 | |
site_code | String | true | 国家码。 |
sku_list
说明
参数名 | 类型 | 参数位置 | 是否必填 | 说明 |
---|---|---|---|---|
original_price | BigDecimal | false | SKU 原价,最多支持两位小数。 | |
sale_price | BigDecimal | true | SKU 售价,最多支持两位小数。 | |
inventory | Integer | true | 库存,支持整数。 | |
weight | BigDecimal | true | 重量,最多支持三位小数,单位 KG。 | |
external_code | String | true | 外部 code。 | |
sku_attr_list | List | true | SKU 属性集合。 |
sku_attr_list
说明
参数名 | 类型 | 参数位置 | 是否必填 | 说明 |
---|---|---|---|---|
attr_code | String | true | 属性 code。 | |
attr_value_id | Long | true | 属性值 ID。 |
参数名 | 类型 | 说明 |
---|---|---|
result | CommodityAddOpenApiVO | 返回结果。 |
result
说明
参数名 | 类型 | 说明 |
---|---|---|
commodity_code | String | 商品唯一 code。 |
POST: /v1.0/sellercenter/commodity
{
"mall_code": "8h4tiureddm***",
"site_code": "CN",
"title": "冰箱",
"brand": "",
"code": "define_code",
"detail_pictures": [
"http://image-demo.oss-cn-hangzhou.aliyuncs.com/exa****.jpg"
],
"first_category_code": "12",
"second_category_code": "1312",
"third_category_code": "131211",
"install_fee": 1,
"install_type": 2,
"is_jump": false,
"pid": "",
"postage": 100,
"postage_type": 1,
"publish": true,
"show_pictures": [
"http://image-demo.oss-cn-hangzhou.aliyuncs.com/exa****.jpg"
],
"video": "",
"video_pic": "",
"sku_list": [
{
"external_code": "",
"inventory": 100,
"original_price": 1,
"sale_price": 2,
"sku_attr_list": [
{
"attr_code": "COLOR",
"attr_value_id": 1001
}
],
"weight": 0
}
]
}
{
"result": {
"commodity_code": "CMaplyr4bzck***"
},
"t": 1624969838836,
"success": true
}
参考 错误码。
错误码 | 错误信息 | 说明 |
---|---|---|
2000000 | params error | 参数错误 |
2000001 | character limit exceeded | 超出字符限制 |
2002001 | pid error | 商品 PID 有误 |
2002002 | commodity title already exists | 商品标题已存在 |
2002003 | category does not exist | 商品类目不存在 |
2002004 | failed to add commodity | 商品添加失败 |
2002200 | sku list can not empty | SKU 列表不能为空 |
2002201 | sku exceeds the maximum limit | SKU 数量超出最大限制 |
2002202 | sku attribute does not exist | SKU 属性不存在 |
2002203 | the sku combination rule is wrong | SKU 未按照规则组合 |
2004000 | image size exceeds limit | 媒体文件大小超出限制 |
2004001 | the number of pictures exceeds the limit | 图片数量超出限制 |
2004002 | picture error | 图片有误 |
2004003 | video error | 视频文件有误 |
该内容对您有帮助吗?
是意见反馈该内容对您有帮助吗?
是意见反馈