xiaodian.item.addItem

  • 免费
  • 需要授权
添加商品

公共参数

名称 类型 必选 描述
app_key Long 接入时申请的app_key
method String 接口名称
access_token String Oauth2.0授权获得的access_token
sign String 对 API 调用参数(除sign外)进行 md5 加密获得。参数的顺序为字母表的顺序
timestamp Long 时间戳,使用Unix时间戳格式
format String 响应格式。默认为json格式,固定
sign_method String 参数的加密方法选择,当前只支持Md5
version String API协议版本,固定值为:1.0

输入参数

名称 类型 必选 描述 示例值
item
Object 商品数据
title
String 商品标题
description
String 商品描述
classIds
String[] 店铺内分类id(通过xiaodian.common.decryptID编码后的id,非值类型)
decStockType
Number 1下单减库存,0付款减库存
cid
String (叶子)类目id
code
String 商品编码
isShelf
Number 0:上架,1:下架 0
brandId
String 品牌id
coverImages
String[] 封面图数组
skus
Object[] sku数据,多个sku属性时sku的数量为各个属性的笛卡尔积,如:颜色有白色、黑色,尺码有S、M,就应该有:白色-S、白色-M、黑色-S、黑色-M四条记录,可参考下面请求参数示例。
image
String sku图片(默认sku不传图则为商品主图)
stock
Number 库存
code
String sku编码
price
Number 价格
style
String 款式
size
String 尺码
attrs
Object[] sku属性,可以根据cid查询xiaodian.item.getSkuProperties获取到指定类目下的可填写属性信息,可参考下面请求参数示例。
name
String 属性名,比如:颜色
value
String 属性值,比如:黑色
props
Object 尺码对照信息(map/字典类型)
key
String 尺码对照属性值,比如:腰围
value
Object 尺码信息
name
String 属性名,比如:腰围
values
String[] 属性值:比如:66
postage
Object 运费模版数据
tplId
String 运费模版id
weight
String 重量
volume
String 体积
details
Object[] 商品详情模块数据
slug
String 模块英文名称,自定义模块格式:custom_module_0_+模块名称,比如:custom_module_0_服装效果
desc
String 模块描述
imageDescs
Object[] 图片列表
path
String 图片相对路径
properties
Object 商品属性,例如“细节:拼接; 图案:粗条纹; 风格:日韩;”,”新增“厂名”,"厂址"用来保存商品出产信息 properties字段的具体格式为:Map<String, List<String>> 如:properties:{"厚薄":["普通"],"领型": ["圆领"],"图案":["色块","千鸟格"],"衣长":["短款(41-50cm)"]}
threeStandardPic
String[] 三标图数组  说明:把入口展示给商家,让商家决定是否上传

返回参数

名称 类型 描述 默认值
data
String 添加成功后的itemId

请求参数示例

1).
{ "cid":"114q", "code":"", "coverImages":[ "http://s11.mogucdn.com/mlcdn/c45406/180417_7jdhe22ij22j10ic0c4216bg6lec5_666x1000.jpg" ], "decStockType":0, "description":"蘑菇街开放平台测试商品,请勿购买,谢谢配合", "details":[ { "desc":"蘑菇街开放平台测试商品,请勿购买", "imageDescs":[ { "path":"/mlcdn/55cf19/190228_7hb41h5ec9c0afekk9c2d5gg1fg0g_800x800.jpg" }, { "path":"/mlcdn/55cf19/190228_7hb41h5ec9c0afekk9c2d5gg1fg0g_800x800.jpg" }, { "path":"/mlcdn/55cf19/190228_7hb41h5ec9c0afekk9c2d5gg1fg0g_800x800.jpg" }, { "path":"/mlcdn/55cf19/190228_7hb41h5ec9c0afekk9c2d5gg1fg0g_800x800.jpg" } ], "slug":"model_img" } ], "isShelf":1, "postage":{ "tplId":"100" }, "properties":{ "开衩":[ "高开衩" ], "裙型":[ "蛋糕裙" ], "腰型":[ "高腰" ], "材质":[ "雪纺" ], "潮流":[ "韩系" ], "袖长":[ "短袖" ], "袖型":[ "常规袖" ], "组合形式":[ "三件套" ], "风格":[ "性感" ], "裙长":[ "超短裙(小于75cm)" ], "版型":[ "直筒" ], "摆型":[ "不对称" ], "元素":[ "铆钉" ], "衣门襟":[ "拉链" ], "领型":[ "圆领" ], "图案":[ "色块" ], "季节":[ "春季" ] }, "skus":[ { "attrs":[ { "name":"颜色", "props":{ }, "value":"白色" }, { "name":"尺码", "props":{ "裙长":{ "name":"裙长", "values":[ "88" ] }, "肩宽":{ "name":"肩宽", "values":[ "88" ] }, "腰围":{ "name":"腰围", "values":[ "88" ] }, "胸围":{ "name":"胸围", "values":[ "88" ] }, "臀围":{ "name":"臀围", "values":[ "88" ] }, "袖长":{ "name":"袖长", "values":[ "88" ] } }, "value":"M" } ], "code":"", "image":"http://s3.mogucdn.com/mlcdn/c45406/180417_3e18eba074kh6425h37fijkk1k6ja_720x720.jpg", "price":0.01, "size":"M", "stock":1000, "style":"白色" }, { "attrs":[ { "name":"颜色", "props":{ }, "value":"黑色" }, { "name":"尺码", "props":{ "裙长":{ "name":"裙长", "values":[ "78" ] }, "肩宽":{ "name":"肩宽", "values":[ "48" ] }, "腰围":{ "name":"腰围", "values":[ "88" ] }, "胸围":{ "name":"胸围", "values":[ "28" ] }, "臀围":{ "name":"臀围", "values":[ "98" ] }, "袖长":{ "name":"袖长", "values":[ "108" ] } }, "value":"S" } ], "code":"", "image":"http://s3.mogucdn.com/mlcdn/c45406/180417_3e18eba074kh6425h37fijkk1k6ja_720x720.jpg", "price":0.01, "size":"S", "stock":1000, "style":"黑色" }, { "attrs":[ { "name":"颜色", "props":{ }, "value":"白色" }, { "name":"尺码", "props":{ "裙长":{ "name":"裙长", "values":[ "88" ] }, "肩宽":{ "name":"肩宽", "values":[ "88" ] }, "腰围":{ "name":"腰围", "values":[ "88" ] }, "胸围":{ "name":"胸围", "values":[ "88" ] }, "臀围":{ "name":"臀围", "values":[ "88" ] }, "袖长":{ "name":"袖长", "values":[ "88" ] } }, "value":"S" } ], "code":"", "image":"http://s3.mogucdn.com/mlcdn/c45406/180417_3e18eba074kh6425h37fijkk1k6ja_720x720.jpg", "price":0.01, "size":"S", "stock":1000, "style":"白色" }, { "attrs":[ { "name":"颜色", "props":{ }, "value":"黑色" }, { "name":"尺码", "props":{ "裙长":{ "name":"裙长", "values":[ "78" ] }, "肩宽":{ "name":"肩宽", "values":[ "48" ] }, "腰围":{ "name":"腰围", "values":[ "88" ] }, "胸围":{ "name":"胸围", "values":[ "28" ] }, "臀围":{ "name":"臀围", "values":[ "98" ] }, "袖长":{ "name":"袖长", "values":[ "108" ] } }, "value":"M" } ], "code":"", "image":"http://s3.mogucdn.com/mlcdn/c45406/180417_3e18eba074kh6425h37fijkk1k6ja_720x720.jpg", "price":0.01, "size":"M", "stock":1000, "style":"黑色" } ], "title":"蘑菇街开放平台测试商品", "threeStandardPic":["http://s3.mogucdn.com/mlcdn/c45406/180417_3e18eba074kh6425h37fijkk1k6ja_720x720.jpg" ] }

返回示例

1).
{ "result": { "data": "18kahta" }, "status": { "code": "0000000", "msg": "" } }

异常示例

1).
{ "result":{ "data":{ } }, "status":{ "code":"1100403", "msg":"无权限访问该商品" } }