接口名称:添加商品
https:api.weixin.qq.com/channels/ec/product/add?
入参:
{"sub_title":"","cats":[{"cat_id":"7419"},{"cat_id":"378091"},{"cat_id":"378095"}],"skus":[{"out_sku_id":"115318537571","stock_num":1,"thumb_img":"https://mmecimage.cn/p/wxcb0fa09aae86908a/HKRcw1r-zoKFjf9sLo1UOV-ZrhjlQmRg20xZffaM20M","sale_price":19900,"sku_code":"gxt2","sku_attrs":[{"attr_key":"规格","attr_value":"玫瑰味"}]},{"out_sku_id":"115318537570","stock_num":1,"thumb_img":"https://mmecimage.cn/p/wxcb0fa09aae86908a/HGubSDfH3XArDCYdWy47jjVQ7xQmMWa3moncFsxVI3w","sale_price":19900,"sku_code":"gxt1","sku_attrs":[{"attr_key":"规格","attr_value":"原味"}]}],"spu_code":"gxtcs","out_product_id":"114769013941","title":"贡禧堂阿胶糕200g/红袋","express_info":{"template_id":"125324208004"},"head_imgs":["https://mmecimage.cn/p/wxcb0fa09aae86908a/HL8ZNHZd33xzHRevk7vcSQUQxihp4y2cN1mPI7HeNMA","https://mmecimage.cn/p/wxcb0fa09aae86908a/HH3TPn2y4cx7Rddvw_tbnw9EVR4J5z_ep8FpVj4eQoA","https://mmecimage.cn/p/wxcb0fa09aae86908a/HE2rirJ46Lj13n0nGC3GKZX8WiarjhNYxGV-QIphiaA","https://mmecimage.cn/p/wxcb0fa09aae86908a/HC_drl5_RRn1pylUGlpFMHpSXbjIIIsW-VZlEOwZyu0","https://mmecimage.cn/p/wxcb0fa09aae86908a/HMK26L6QQZXysMAVMLzorFvPJ6EOLv0wKsGKNUDU0IY"],"attrs":[{"attr_key":"品牌","attr_value":"贡禧堂"},{"attr_key":"生产企业名称","attr_value":"山东东阿东方阿胶股份有限公司"},{"attr_key":"产地","attr_value":"山东东阿"},{"attr_key":"贮存条件","attr_value":""},{"attr_key":"食品生产许可证编号","attr_value":""},{"attr_key":"保质期(天/月/年)","attr_value":"12个月"}]}
返回值:
{"errcode":10020096,"errmsg":"商品参数属性键attrs[].attr_key不能重复"}
没有填必填属性时会返回 errcode":10020096。api_rid:642c01a2-2f5fb17b-6245a6ab
当把所有非必填的属性值都填入后调用接口又是成功的。难道所有根据类目获取到的属性都是必须要填写的吗?