删除SKU接口
编号 : skuRemove
请求参数
参数名 | 参数类型 | 必传 | 缺省值 | 描述 |
---|---|---|---|---|
token | string | Y | ||
sku_res | json | Y | JSON结构 |
返回值
成功:{"code":0,"success_count":1,"status":1,"msg":[]} 失败:{"code":400,"msg":"goods_id_empty and goods_codeno_empty"}
备注
sku_res 的JSON结构范例:[{"goods_id":243020,"sku_codeno":"990478_990481"},{"goods_codeno":"AA_LQ5239-10","sale_prop":[{"prop_name":"color","prop_value":"Red"},{"prop_name":"Size","prop_value":"S"}]}] 2 一次推送多条数据 3 字段说明: goods_id 商品id,商品id和goods_codeno不能同时为空 goods_codeno 商品编号,商品id和goods_codeno不能同时为空 sku_codeno SKU编号,和sale_prop不可以同时为空 sale_prop 需要删除的sku值,和sku_codeno不可以同时为空,其中数组的prop_name为属性名,prop_value是对应的属性值,例如 array(array('prop_name'=>'Size','prop_value'=>'S'),array('prop_name'=>'Color','prop_value'=>'Red'))
商品相册更新
编号 : updateGoodsImage
请求参数
参数名 | 参数类型 | 必传 | 缺省值 | 描述 |
---|---|---|---|---|
token | string | Y | ||
goods_res | json | Y | JSON结构 |
返回值
成功:{"code":0,"success_count":1,"msg":[]} 失败:{"code":400,"msg":"goods_id_empty and goods_codeno_empty"}
备注
goods_res 的JSON结构范例: 一次推送最多200条数据 字段说明: 更新默认相册: [{"goods_id":"211452","codeno":"1223556","is_append":"1","images":["image1.jpg","image2.jgp","image3.jpg"]}] 更新颜色相册: [{"goods_id":"211452","codeno":"1223556","sku_res":[{"is_append":"1","sku_option":{"name":"Color","value":"blue"},"images":["image1.jpg","image2.jgp","image3.jpg"]},{"is_append":"1","sku_option":{"name":"Color","value":"red"},"images":["image1.jpg","image2.jgp","image3.jpg"]}]}] 同时更新默认相册和颜色相册 [{"goods_id":"211452","codeno":"1223556","is_append":"1","images":["image1.jpg","image2.jgp","image3.jpg"],"sku_res":[{"is_append":"1","sku_option":{"name":"Color","value":"blue"},"images":["image1.jpg","image2.jgp","image3.jpg"]},{"is_append":"1","sku_option":{"name":"Color","value":"red"},"images":["image1.jpg","image2.jgp","image3.jpg"]}]}] goods_id为商品id codeno 为商品编号,goods_id和codeno 不可同时为空 is_append 等1时表示追加, 不填或者0表示覆盖更新 image 为追加或覆盖更新的图片 例如 array('image1.jpg','image2.jpg') sku_res为追加或更新颜色相册的内容,sku_res可以传多个属性: is_append 等1时表示颜色相册追加图片, 不填或者0表示覆盖更新颜色相册 sku_option 为更新或追加图片的规格属性,为数组形式 array('name' => Color,'value' => blue) images 为属性值相册图片链接,为数组形式array('image1.jpg','image2.jgp','image3.jpg')
追加SKU接口
编号 : updateGoodsByAddSKU
请求参数
参数名 | 参数类型 | 必传 | 缺省值 | 描述 |
---|---|---|---|---|
token | string | Y | ||
goods_sku_res | json | Y | JSON结构 |
返回值
成功:{"code":0,"success_count":1,"msg":[]} 失败:{"code":400,"msg":"goods_id_empty and goods_codeno_empty"}
备注
goods_sku_res 的JSON结构范例: 一次推送最多200条数据 字段说明: [{"goods_id":"211452","sku_res":{"sku_options":[{"name":"Color","value":"blue"},{"name":"Size","value":"XXL"}],"codeno":"blue-xxl","stock":"999","price":"100","weight":"1.5","barcode":"1222","volume":"1.5","images":["image1.jpg","image2.jgp","image3.jpg"]}}] goods_id为商品id goods_codeno 为商品编号,goods_id和goods_codeno 不可同时为空 sku_res为sku内容,sku_res下有: sku_options 是添加的属性,是数组,其中数组的name为属性名,value是对应的属性值,属性名和商品属性名要完全相同,例如商品有Color、Size那么本数组的name必须有Color、Size,不可另加,比如Length等,数组范例: array(array('name'=>'Color','value'=>'yellor'),array('name'=>'Size','value'=>'xxxl')) codeno 非必填,为sku编号 stock 为sku库存,不填默认为0 price 为sku价格,不填默认为0; 如果价格为0,将会取商品默认价格和原有sku价格中最大的一个作为追加sku的价格。(ps:对于在后台抬高价格打折的商品,可以利用传价格0来实现设置抬高后的价格,避免追加的sku原价再打折) weight 为sku重量,不填默认为0 barcode 非必填,为barcode条形码 volume 非必填,为sku体积,不填默认为0 images 非必填,为属性值相册,为数组形式array('image1.jpg','image2.jgp','image3.jpg')
删除属性规格
编号 : updateGoodsByDelSaleProp
请求参数
参数名 | 参数类型 | 必传 | 缺省值 | 描述 |
---|---|---|---|---|
token | string | Y | ||
goods_res | json | Y | JSON结构 |
返回值
成功:{"code":0,"success_count":1,"msg":[]} 失败:{"code":400,"msg":"goods_id_empty and goods_codeno_empty"}
备注
goods_res 的JSON结构范例:[{"goods_id":2139792,"goods_codeno":2139792,"sale_prop":[{"prop_name":"size","prop_value":"xl"},{"prop_name":"size","prop_value":"x"},{"prop_name":"color","prop_value":"red"}]},{"goods_codeno":"234234234","sale_prop":[{"prop_name":"size","prop_value":"xl"},{"prop_name":"size","prop_value":"x"},{"prop_name":"size","prop_value":"xxl"},{"prop_name":"color","prop_value":"blue"}]}] 2 一次推送多条数据 3 字段说明: goods_id 商品id,商品id和goods_codeno不能同时为空 goods_codeno 商品编号,商品id和goods_codeno不能同时为空 sale_prop 需要删除的属性数据,prop_name 为属性名称, prop_value 为属性值 例如 array(array('prop_name'=>'Size','prop_value'=>'X'),array('prop_name'=>'Color','prop_value'=>'Red'))
更新商品关联
编号 : updateGoodsRel
请求参数
参数名 | 参数类型 | 必传 | 缺省值 | 描述 |
---|---|---|---|---|
token | string | Y | ||
goods_rel_res | json | Y | {"goods_id":201737,"rel_goods":[{"goods_id":201716},{"goods_id":201384},{"goods_id":201382,"relation":"two"}]} | goods_id:主商品id ;rel_goods:相关商品数据 |
返回值
{"code":0,"status":1,"success_count":1,"failed_count":0,"error_msg":[]}
备注
goods_rel_res: 示例:{"goods_id":201737,"rel_goods":[{"goods_id":201716},{"goods_id":201384},{"goods_id":201382,"relation":"two"}]} goods_id 表示主商品 rel_goods 表示相关商品 rel_goods.goods_id 相关商品id rel_goods.relation one或者不填表示单向关联,mutual 表示 双向关联
编辑分类
编号 : editCategory
请求参数
参数名 | 参数类型 | 必传 | 缺省值 | 描述 |
---|---|---|---|---|
token | VARCHAR | Y | ||
category_res | VARCHAR | Y | JSON结构 |
返回值
{"code":0,"msg":[{"index":0,"msg":"udpate_fail"}]}
备注
1 category_res的JSON结构:[{"category_id":"238","base_name":"分类名字","status":"1","listorder":"9999","image":"http://cn01.imgcdn.ymcart.com/24073/2016/06/13/1/8/18f21bec9f03da1b.jpg","image1":"http://cn01.imgcdn.ymcart.com/24073/2016/06/13/1/8/18f21bec9f03da1b.jpg","image2":"http://cn01.imgcdn.ymcart.com/24073/2016/06/13/1/8/18f21bec9f03da1b.jpg","title":"seo title","keywords":"seo keywords","descript":"seo desc","b2b_status":"1","order_by":"buy_counts","order_field":"DESC"},{"category_id":"239","base_name":"分类名字","status":"1","listorder":"9999","image":"http://cn01.imgcdn.ymcart.com/24073/2016/06/13/1/8/18f21bec9f03da1b.jpg","image1":"http://cn01.imgcdn.ymcart.com/24073/2016/06/13/1/8/18f21bec9f03da1b.jpg","image2":"http://cn01.imgcdn.ymcart.com/24073/2016/06/13/1/8/18f21bec9f03da1b.jpg","title":"seo title","keywords":"seo keywords","descript":"seo desc","b2b_status":"1","order_by":"buy_counts","order_field":"DESC"}] 字段说明 category_id 分类ID base_name 分类名字, status 商城状态 0#不显示1#显示, listorder 排序, image 图片, image1 图片1, image2 图片2, title 标题, keywords 关键字, descript 描述, b2b_status 官网状态 0#不显示1#显示, order_by 排序指端 order_field ASC#升序 DESC#降序 2. 可一次性推送多条数据,最多不超过200个
更新商品销售模式
编号 : UpdateGoodsSaleMode
请求参数
参数名 | 参数类型 | 必传 | 缺省值 | 描述 |
---|---|---|---|---|
token | string | Y | ||
goods_sale_mode_res | json | Y | [{"goods_id":"176795","codeno":"176795","sale_mode":1,"discount":8,"start_time":"2020-04-21","end_time":"2020-04-30"}] |
返回值
{"code":0,"status":1,"success_count":1,"failed_count":0,"error_msg":[]}
备注
接口参数: 特价: goods_sale_mode_res : [{"goods_id":"176795","codeno":"176795","sale_mode":1,"discount":8,"start_time":"2020-04-21","end_time":"2020-04-30"}] 批发: goods_sale_mode_res : [{"goods_id":"176795","codeno":"176795","sale_mode":2,"moq":8,"min_qty":0,"range_end":[20,50,100],"range_discount":[8,7,6],"range_remark":["remark1","remark2","remark3"]}] 清空特价和批发: goods_sale_mode_res : [{"goods_id":"176795","codeno":"176795","sale_mode":0}] 参数说明: goods_id和codeno 选填一个 sale_mode:销售模式 0代表普通模式,1代表特价模式,2代表批发模式 sale_mode=1 : discount 折扣 ,start_time 开始时间,end_time结束时间 sale_mode=2 :moq 最小起订量,min_qty起始区间,range_end 区间件数,range_discount 区间折扣,range_remark 区间备注
更新商品推荐关联
编号 : UpdateGoodsRecRel
请求参数
参数名 | 参数类型 | 必传 | 缺省值 | 描述 |
---|---|---|---|---|
token | string | Y | ||
goods_rec_rel_res | json | Y | [{"goods_id":"176795","codeno":"176795","rec_ids":[3333,3768],"rec_names":["Hot 2018","HOT SALE"]},{"goods_id":"176796","codeno":"176796","rec_ids":[3333,3768],"rec_names":["Hot 2018","HOT SALE"]}] | rec_ids:推荐id ,可以是逗号隔开字符串,也可以是数组;rec_names:推荐名称,可以是逗号隔开的字符串,也可以是数组; goods_id和codeno选填一个; rec_ids 和 rec_names 选填一个 |
返回值
{"code":0,"status":1,"success_count":1,"failed_count":0,"error_msg":[]}
备注
清空商品推荐,使用clear_all 参数, 例:[{"goods_id":"176717","clear_all":true}] 默认追加商品推荐, 加clear_all 时才会清除旧的关联数据 例如:当传递clear_all=true时,清除旧的关联数据,如果同时传递了rec_ids 或 rec_names 还会继续新加商品推荐关联; 当未传递 clear_all时,传递rec_ids 或 rec_names 时追加商品推荐关联,旧的关联数据保留;
更新专题页
编号 : updateTopic
请求参数
参数名 | 参数类型 | 必传 | 缺省值 | 描述 |
---|---|---|---|---|
token | varchar | Y | ||
topic_res | varchar | Y | Json 结构 |
返回值
{"status":1,"code":0,"msg":"success"}
备注
topic_res :{"topic_goods":[{"tag_res":{"tag_id":"887","order_by":"","order_field":""},"tag_goods_res":[{"goods_id":"118280","listorder":40},{"goods_id":"131260","listorder":39},{"goods_id":"106326","listorder":2},{"goods_id":"142397","listorder":1}]},{"tag_res":{"tag_id":"886","order_by":"","order_field":""},"tag_goods_res":[{"goods_id":"154835","listorder":4},{"goods_id":"155478","listorder":3},{"goods_id":"149487","listorder":2},{"goods_id":"164941","listorder":1}]}],"topic_res":{"topic_id":"371","base_name":"专题名称","title":"SEO标题","keywords":"SEO关键字","descript":"SEO描述","status":"状态"}} topic_goods 商品标签商品 tag_res: "tag_id":"标签id", "order_by":"排序顺序" "order_field":"排序字段" (buy_counts_desc:销量,price_asc:价格,price_desc:价格,create_time_desc:新品,base_name_asc:名称,base_name_desc:名称,comment_counts_desc:评论,codeno_asc:编号,codeno_desc:编号,wishlist_counts_desc">收藏,visit_counts_desc">访问,artificial" selected="selected:人工) tag_goods_res "goods_id":"商品id", "listorder":排序值 topic_res "topic_id":"标签id" "base_name":"专题名称" "title":"SEO标题" "keywords":"SEO关键字" "descript":"SEO描述" "status":"状态"
更新商品会员组
编号 : updateGoodsUserGroup
请求参数
参数名 | 参数类型 | 必传 | 缺省值 | 描述 |
---|---|---|---|---|
token | varchar | Y | ||
goods_user_res | varchar | Y | JSON 结构 |
返回值
{ "code": 0, "status": 1, "msg": [ "164970 group VIP1 add success!", "164970 group VIP2 not exist!", "164970 group VIP3 not exist!", "165012 group VIP1 add success!", "165012 group Member add success!" ], "success_count": 2, "failed_count": 0 }
备注
goods_user_res [{"codeno":"","goods_id":"164970", "user_group":["VIP1","VIP2","VIP3"]},{"codeno":"165012","goods_id":"", "user_group":["VIP1","Member"]}] codeno 和 goods_id 只用填写一个 codeno 商品编号 goods_id 商品id user_group 用户组名字,数组结构
更新推荐商品
编号 : updateGoodsRec
请求参数
参数名 | 参数类型 | 必传 | 缺省值 | 描述 |
---|---|---|---|---|
token | VARCHAR | Y | ||
goods_rec | VARCHAR | Y | Json 结构 |
返回值
{"status":1,"code":0,"msg":"success"}
备注
goods_rec {"goods_rec":{"goods_rec_id":"5803","base_name":"商品推荐名","title":"商品推荐SEO标题","keywords":"商品推荐SEO关键词","descript":"商品推荐SEO描述","status":"商品推荐状态(0或1)"},"goods_list":[132,4313,43123,43254]}
品牌列表
编号 : brandList
请求参数
参数名 | 参数类型 | 必传 | 缺省值 | 描述 |
---|---|---|---|---|
token | VARCHAR | Y |
返回值
{"code":0,"status":1,"data":{"list":[{"id":"5","base_name":"Dear-Lover","title":"","keywords":"","descript":""},{"id":"6","base_name":"HX-Fashion","title":"","keywords":"","descript":""},{"id":"437","base_name":"Brand","title":"","keywords":"","descript":""}]}}
SKU列表
编号 : skuList
请求参数
参数名 | 参数类型 | 必传 | 缺省值 | 描述 |
---|---|---|---|---|
token | VARCHAR | Y | 加密串 | |
page_size | INT | N | 500 | 每页数量 |
page_no | INT | N | 1 | 页码 |
goods_codeno | VARCHAR | N | 商品编号 | |
sku_codeno | VARCHAR | N | SKU编号 | |
is_instock | INT | N | 0 缺货商品,1 库存中,不传输默认列出全部 | |
order_by | INT | N | 默认按商品ID 降序 , 1表示按商品ID 升序 |
返回值
{"status":1,"code":0,"count":"95","data":[{"id":"2015779","goods_id":"120300","sku_code":"0_0","codeno":"two22","store_id":"24073","base_name":null,"sku_value":"","barcode":"tiao111","stock_nums":"-20","status":"1","price":"9.0000","market_price":"0.0000","cost_price":"0.0000","weight":"0.0800","create_time":"1533116704","update_time":"1533116704","is_instock":"0"}]}
备注
id: goods_id:商品ID sku_code:SKU属性值编码,规则为:销售属性ID_销售属性ID2 codeno:sku编号 store_id:多语言站点ID base_name:名称 sku_value:属性值比如color:red size :大中小 barcode:条形码 stock_nums:库存可销售数量 status:状态 price:默认价格 market_price:售价 cost_price:成本价 weight:重量 create_time: update_time: is_instock:是否有库存 1是 0否
删除商品
编号 : goodsRemove
请求参数
参数名 | 参数类型 | 必传 | 缺省值 | 描述 |
---|---|---|---|---|
token | VARCHAR | Y | ||
goods_remove_res | VARCHAR | Y | JSON结构 |
返回值
{"code":0,"status":1,"msg":[{"codeno":"338004","sku_codeno":null,"msg":"codeno_404"},{"codeno":"888001","sku_codeno":null,"msg":"codeno_404"},{"codeno":null,"sku_codeno":"LC3257-2XXL","msg":"sku_codeno_404"}]}
备注
1 goods_remove_res 的JSON结构范例:[{"codeno":"LC3257-2"},{"codeno":"LC3257-1"},{"sku_codeno":"LC3257-2XXL"}] 2 codeno和sku_codeno不能同时留空,只能同时传输 3 可一次性推送多条数据,最多不超过200个 4 错误提示 sku_codeno_404: sku_codeno找不到 code_404: 商品codeno找不到 data_empty,data_too_large: 数据太长或者找不到 query_param_404, query_param_repeated: 参数为空或者参数重复
编辑商品
编号 : updateGoods
请求参数
参数名 | 参数类型 | 必传 | 缺省值 | 描述 |
---|---|---|---|---|
token | VARCHAR | Y | ||
goods_res | VARCHAR | Y | JSON结构 |
返回值
{"code":0,"msg":null}
备注
1 goods_res 的JSON结构范例:[{"goods_id":123860,"codeno":"LC3257-2","base_name":"Diva Green Lace Bow Teddy","main_image":"http://cn01.imgcdn.ymcart.com/28813/2018/08/13/b/e/be2420de4a1a4bff.jpg","other_images":"http://cn01.imgcdn.ymcart.com/28813/2018/09/8/5/859d24d783077af5.jpg,http://cn01.imgcdn.ymcart.com/28813/2018/09/3/1/317b72949774e54d.jpg","category":"women,dress","brand_name":"ONLY","tags":"summer,light,tight","group_codeno":"","buy_counts":43,"status":1,"listorder":1109,"title":"seo title","keywords":"seo keywords","descript":"seo descript","mini_detail":"","weight":21,"volume":"1.5","price":25,"spec_mode":1,"is_diy_remark":1,"create_time":"2016-7-21 11:20:44","sku_option1":"Color:Red,Black","sku_option2":"Size:S,M,L","muti_spec_res":[{"spec_value_name":"Red_S","codeno":"API1000-1","stock":999,"price":100,"weight":1.5,"barcode":"1213132131231","volume":"1.5"},{"spec_value_name":"Red_M","codeno":"API1000-2","stock":999,"price":100,"weight":1.5,"barcode":"1213132131232"},{"spec_value_name":"Red_L","codeno":"API1000-3","stock":999,"price":100,"weight":1.5,"barcode":"1213132131233","volume":"1.5"},{"spec_value_name":"Black_S","codeno":"API1000-3","stock":999,"price":100,"weight":1.5,"barcode":"1213132131233"},{"spec_value_name":"Black_L","codeno":"API1000-3","stock":999,"price":100,"weight":1.5,"barcode":"1213132131233","volume":"1.5"},{"spec_value_name":"Black_M","codeno":"API1000-3","stock":999,"price":100,"weight":1.5,"barcode":"1213132131233","volume":"1.5"}]}] 2 实现商品更新,需要更新商品时候,goods_id和codeno不能同时留空 3 goods_id 优先于 codeno 4 当msg不为空,表示有更新不成功的排序 5 可一次性推送多条数据,最多不超过200个 6 字段说明 base_name 商品名称,不能为空 codeno 商品编号,可留空,如果不留空并且存在将不能添加成功 price 商品价格,选填 weight 商品重量, KG volume 商品体积, CBM 立方米 category 分类名称 选填 brand_name 品牌名称 选填 group_codeno 组合编码 选填 detail 商品描述 选填 mini_detail 商品短描述 选填 is_diy_remark 是否留言定制 选填 is_bookable 是否缺货时,任然可以下单 选填 visit_counts 访问量 选填 buy_counts 购买量 选填 wishlist_counts 喜好收藏量 选填 tags 标签 选填 例:Hot,New status 上架状态 必填 0下架 1上架 title seo页面标题 选填 keywords seo页面关键词 选填 descript seo页面描述 选填 main_image 商品默认相册主图 选填 例:http://www.example.com/uploadImage/2016-10-05/2016100514493561986344.jpg ,留空不更新 other_images 颜色默认相册其它细节图 多个以逗号隔开 ,留空不更新 例:"http://www.example.com/fckeditfile/image/1473146087.jpg,http://www.example.com/uploadImage/2016-09-06/201609061456137098227.jpg" // 注意重复相同地址的图片,将不会更新 sku_option1 购物属性可选项 spec_mode=1 或 spec_mode=2时必填 格式:"属性名称:属性值1,属性值2,..." 例:"Color:Red,Yellow,Green" sku_option2 同上,以此类推 可选项最多到sku_option5 spec_mode:0单规格,1多规格 单规格数据 当spec_mode=0时必填 single_res 单规格数据 当spec_mode=0时必填 例:array("codeno"=>"Api_code_001-1","stock"=>"999","price"=>"99.99","weight"=>"1.5","barcode"=>"1213132131231","volume"=>"1.5") 多规格数据 当spec_mode=1时必填 muti_spec_res 例:array(array("spec_value_name"=>"Red_S","codeno"=>"API1000-1","stock"=>999,"price"=>100,"weight"=>1.5,"barcode"=>"1213132131231","volume":"1.5"),array("spec_value_name"=>"Red_M","codeno"=>"API1000-2","stock"=>999,"price"=>100,"weight"=>1.5,"barcode"=>"1213132131232","volume":"1.5"),array("spec_value_name"=>"Red_L","codeno"=>"API1000-3","stock"=>999,"price"=>100,"weight"=>1.5,"barcode"=>"1213132131233","volume":"1.5")) muti_spec_image_name 多规格数据 选填 例:Color muti_spec_images 多规格颜色图片 选填 每个颜色对应一组图片,同组多个图片以逗号隔开 例array("http://www.example.com/fckeditfile/image/1473146087.jpg,http://www.example.com/uploadImage/2016-09-06/201609061456137098227.jpg","http://www.example.com/fckeditfile/image/1473146087.jpg,http://www.example.com/uploadImage/2016-09-06/201609061456137098227.jpg") 那么对应的是:sku_option1中 "Color:Red,Yellow,Green" 的颜色顺序。 timed_release 定时发布,填写1时加入定时发布任务,同时create_time 填写大于当前时间的时间(例:2020-07-05 15:00:00) 以及status 填写0 supplier_remark 供应商备注 not_update_sku 当等于 true 时,不同步更新sku force_update_price 当等于 true 时, 强制更新diy定制商品的默认售价
更新库存/价格
编号 : updateSkuQty
请求参数
参数名 | 参数类型 | 必传 | 缺省值 | 描述 |
---|---|---|---|---|
token | VARCHAR | Y | ||
sku_res | VARCHAR | Y | JSON结构 | |
update_options | VARCHAR | N | JSON结构 |
返回值
{"code":0,"msg":[{"codeno":"LC79126-3","msg":"success"},{"codeno":"SKU_404","msg":"sku_null"}]}
备注
1 sku_res的JSON结构范例:[{"sku_code":"800673_800675","num":11,"price":11.00},{"id":"3145319","num":22},{"codeno":"sss12345","num":33}] 可传入sku的id、codeno、sku_code 任意一个参数即可 2 实现库存数据对接,需要上传商品时候,SKU编号要严格填写并且唯一, price不填写则不更新价格 3 update_options的JSON结构范例:{"update_listorder":1,"update_status":1} update_listorder:缺货时候排序是否为负数,有货时候自动为正数。 0 表示禁用这个功能 update_status:缺货时候排序是否下架,有货时候自动为上架。 0 表示禁用这个功能 4 当msg不为空,表示有更新不成功的库存 5 可一次性推送多条数据,最多不超过200个
添加商品
编号 : addGoods
请求参数
参数名 | 参数类型 | 必传 | 缺省值 | 描述 |
---|---|---|---|---|
token | VARCHAR | Y | 加密串 | |
goods_res | VARCHAR | Y | JSON结构 |
返回值
成功:{"code":0,"failure_count":0,"success_count":1,"msg":[]} 失败:{"code":400,"msg":"data empty"}
备注
1 goods_res的JSON结构范例:[{"base_name":"Api test product name 001","codeno":"Api_code_001","price":"10.5","weight":"0.5","volume":"1.5","category":"Midi Dresses","brand":"Dear-Lover","group_codeno":"","detail":"api test detail","mini_detail":"api mini detail","is_diy_remark":"1","visit_counts":"10","buy_counts":"12","wishlist_counts":"50","goods_tags":"Hot,New","status":"1","title":"api title","keywords":"api keywords","descript":"api descript","spec_mode":1,"sku_option1":"Color:Red,Black","sku_option2":"Size:S,M,L","muti_spec_res":[{"spec_value_name":"Red_S","codeno":"API1000-1","stock":999,"price":100,"weight":1.5,"barcode":"1213132131231","volume":1.5},{"spec_value_name":"Red_M","codeno":"API1000-2","stock":999,"price":100,"weight":1.5,"barcode":"1213132131232"},{"spec_value_name":"Red_L","codeno":"API1000-3","stock":999,"price":100,"weight":1.5,"barcode":"1213132131233","volume":"1.5"},{"spec_value_name":"Black_L","codeno":"API1000-3","stock":999,"price":100,"weight":1.5,"barcode":"1213132131233","volume":"1.5"},{"spec_value_name":"Black_L","codeno":"API1000-3","stock":999,"price":100,"weight":1.5,"barcode":"1213132131233","volume":"1.5"},{"spec_value_name":"Black_L","codeno":"API1000-3","stock":999,"price":100,"weight":1.5,"barcode":"1213132131233","volume":"1.5"}],"muti_spec_image_name":"Color","muti_spec_images":["http://www.example.com/fckeditfile/image/1473146087.jpg,http://www.example.com/uploadImage/2016-09-06/201609061456137098227.jpg"],"main_image":"http://www.example.com/uploadImage/2016-10-05/2016100514493561986344.jpg","other_images":"http://www.example.com/uploadImage/2016-09-06/201609061456137098227.jpg,http://www.example.com/fckeditfile/image/1473146087.jpg","goods_type":"Dress","common_property":[{"name":"PRICE RANGE","value":"$50 - $80"},{"name":"HEMLINE","value":["FLOOR","TEA","LONG"]}],"relation_codenos":{"one_way":["LC64190-2","LC25702-2"],"two_way":["LC61328-22"]},"listorder":1000,"is_taxed":1}] 2 一次推送多条数据 3 字段说明: base_name 商品名称,不能为空 codeno 商品编号,可留空,如果不留空并且存在将不能添加成功 price 商品价格,不能为空 weight 商品重量, KG volume 商品体积, CBM 立方米 category 分类名称 不能为空,若需添加二级三级分类,需把每级分类用英文逗号隔开,例如:category_name1,category_name1_1,(分类名称若不存在,则默认自动新建分类) category_rel 附属分类,多个用竖线 | 隔开,每个附属分类格式同主分类category一样 brand 品牌名称 选填 group_codeno 组合编码 选填 detail 商品描述 选填 mini_detail 商品短描述 选填 is_diy_remark 是否留言定制 选填 is_bookable 是否缺货时,任然可以下单 visit_counts 访问量 选填 buy_counts 购买量 选填 wishlist_counts 喜好收藏量 选填 goods_tags 标签 选填 例:Hot,New status 上架状态 必填 0下架 1上架 title seo页面标题 选填 keywords seo页面关键词 选填 descript seo页面描述 选填 spec_mode 规格模式,0是单规格,1是多规格现成,2商品DIY定制 sku_option1 购物属性可选项 spec_mode=1 或 spec_mode=2时必填 格式:"属性名称:属性值1,属性值2,..." 例:"Color:Red,Yellow,Green" sku_option2 同上,以此类推 可选项最多到sku_option5 single_res 单规格数据 当spec_mode=0时必填 例:array("codeno"=>"Api_code_001-1","stock"=>"999","price"=>"99.99","weight"=>"1.5","barcode"=>"1213132131231","volume":"1.5") muti_spec_res 多规格数据 当spec_mode=1时必填 例:array(array("spec_value_name"=>"Red_S","codeno"=>"API1000-1","stock"=>999,"price"=>100,"weight"=>1.5,"barcode"=>"1213132131231","volume":"1.5"),array("spec_value_name"=>"Red_M","codeno"=>"API1000-2","stock"=>999,"price"=>100,"weight"=>1.5,"barcode"=>"1213132131232","volume":"1.5"),array("spec_value_name"=>"Red_L","codeno"=>"API1000-3","stock"=>999,"price"=>100,"weight"=>1.5,"barcode"=>"1213132131233","volume":"1.5")) muti_spec_image_name 多规格数据 选填 例:Color muti_spec_images 多规格颜色图片 选填 每个颜色对应一组图片,同组多个图片以逗号隔开 例array("http://www.example.com/fckeditfile/image/1473146087.jpg,http://www.example.com/uploadImage/2016-09-06/201609061456137098227.jpg","http://www.example.com/fckeditfile/image/1473146087.jpg,http://www.example.com/uploadImage/2016-09-06/201609061456137098227.jpg") 那么对应的是:sku_option1中 "Color:Red,Yellow,Green" 的颜色顺序。 spec_res diy商品定制规格数据 当spec_mode=2时必填 数据包括 spec_weight 规格附加重量 spec_price规格附加价格 spec_volume规格附加体积 例:array('spec_add_weight'=>array(array('1','0','0'),array('0','2','0')),'spec_add_price'=>array(array('1','0','0'),array('0','2','0'),'spec_add_volume'=>array(array('1','0','0'),array('0','2','0')))) spec_add_weight 商品DIY定制数据 当spec_mode=2时必填 例:array(array('0','0','0'),array('0','0','0')) 对应属性值附加 无附加对应填0 spec_add_price 商品DIY定制数据 当spec_mode=2时必填 例:array(array('0','0','0'),array('0','0','0')) 对应属性值附加 无附加对应填0 spec_add_volume 商品DIY定制数据 当spec_mode=2时必填 例:array(array('0','0','0'),array('0','0','0')) 对应属性值附加 无附加对应填0 main_image 商品默认相册主图 必填 例:http://www.example.com/uploadImage/2016-10-05/2016100514493561986344.jpg other_images 颜色默认相册其它细节图 多个以逗号隔开 例:"http://www.example.com/fckeditfile/image/1473146087.jpg,http://www.example.com/uploadImage/2016-09-06/201609061456137098227.jpg" goods_type 商品类型名称 用于筛选 选填 名称必须是后台已存在的 例:Dress common_property 筛选属性 当goods_type不为空时 必填 例:array(array('name'=>'PRICE RANGE','value'=>'$50 - $80'),array('name'=>'HEMLINE','value'=>array('FLOOR','TEA')) 根据类型的属性来填写,单选或文本值 value 填写文本, 多选的value用数组表示, value 系统不存在时会自动创建 relation_codenos 商品关联 二维数组 例如:array('one_way'=>array("LC64190-2","LC25702-2"),'two_way'=>array("LC61328-22"));//one_way 单向关联 two 双向关联 数组值填写商品编号 注意:图片格式必须是带有 http 的完整可以访问的地址,后台将会自动下载到 YMCART-IMGCDN 资源服务器! timed_release 定时发布,填写1时加入定时发布任务,同时create_time 填写大于当前时间的时间(例:2020-07-05 15:00:00) 以及status 填写0 supplier_remark 供应商备注 sale_mode_res 销售模式,有特价,批发,预售三种 特价: array('sale_mode'=>1,'discount'=>8,'start_time'=>'2020-04-21','end_time'=>'2020-04-30'),sale_mode为1时是特价,discount为折扣(8表示八折),start_time为特价开始时间,end_time为特价结束时间 批发: array('sale_mode'=>2,'moq'=>2,'min_qty'=>8,range_end'=>array(20,50,100),range_discount'=>array(8,7,6),range_remark'=>array('remark1','remark2','remark3')) sale_mode为2时是批发,moq最小订购量,min_qty 起始区间,range_end 区间件数,一维数组,range_discount 区间折扣 一维数组(和区间件数对应折扣),range_remark 区间备注 一维数组(和区间件数、区间折扣对应) 预售: array('sale_mode'=>4,'start_time'=>'2020-04-21','end_time'=>'2020-04-30','ships'=>'2020-05-30','ordered_qty'=>8,range_end'=>array(20,50,0),range_discount'=>array(8,7,6)) sale_mode为4时是预售,start_time为预售开始时间,end_time为预售结束时间,ships配送时间,ordered_qty 已售数量,range_end 区间件数,一维数组(最后值请填写为0,如上表示0-20,,21-50,50以上),range_discount 区间折扣 一维数组(和区间件数对应折扣) listorder: 排序值,选填,数字 is_taxed:税费,指是否收税,1收税,0,不收税 4 返回结果当code不为0,表示添加失败,msg提示信息;当code为0,提示failure_count失败数量,success_count成功数量,msg 数组提示失败产品名称 编号 信息
添加分类
编号 : addCategory
请求参数
参数名 | 参数类型 | 必传 | 缺省值 | 描述 |
---|---|---|---|---|
token | VARCHAR | Y | ||
category_res | VARCHAR | Y | JSON结构 |
返回值
{"code":0,"msg":[{"index":0,"msg":"insert_fail"}]}
备注
1 category_res的JSON结构:[{"name":""},{"name":"category root A,category root A2"}] 2 多级分类请用英文的" , " 隔开。 3 当msg不为空,表示有创建不成功的分类 4 可一次性推送多条数据,最多不超过200个
商品列表
编号 : goodsList
请求参数
参数名 | 参数类型 | 必传 | 缺省值 | 描述 |
---|---|---|---|---|
token | VARCHAR | Y | ||
page_size | INT | N | 50 | 每页数量 |
page_no | INT | N | 1 | 页码 |
codeno | VARCHAR | N | 商品编号,多个用英文逗号隔开 | |
id | VARCHAR/INT | N | 商品ID,多个用英文逗号隔开 | |
category_id | INT | N | 分类ID,多个用英文逗号隔开 | |
status | INT | N | 状态 | |
start_modify_time | DATE | N | 修改开始日期。2016-9-9 0:0:0 | |
end_modify_time | DATE | N | 修改结束日期。2016-9-9 23:59:59 | |
max_id | INT | N | 从max_id开始 | |
brand_id | INT | N | 品牌ID | |
rec_id | INT | N | 推荐ID | |
tag_id | INT | N | 标签ID | |
other_category_id | INT | N | 附属分类ID | |
start_time | DATE | N | 上传开始日期。2016-9-9 0:0:0 | |
end_time | DATE | N | 上传结束日期。2016-9-9 23:59:59 |
返回值
{"code":0,"count":"1538","data":[{"id":"137808","store_id":"24073","base_name":"u65b0u589e","brand_id":"0","goods_type_id":"0","category_path":"38767,","category_id":"38767","codeno":"137808","image":"http://cn01.imgcdn.ymcart.com/24073/2019/06/04/e/8/e8fa8a9e1d52b54c.gif","price":"0.0000","cost_price":"0.0000","market_price":"0.0000","listorder":"1378080","status":"1","up_time":"0","down_time":"0","create_time":"1559636970","modify_time":"1559636978","template_page":"","visit_counts":"0","buy_counts":"0","wishlist_counts":"0","comment_counts":"0","comment_value":"0","stock_nums":"1","sale_mode":"0","spec_mode":"0","is_diy_remark":"0","weight":"0.2000","start_time":"0","end_time":"0","is_free_shipping":"0","special_offer_id":"0","discount":"10.0000","title":"","keywords":"","descript":"","mini_detail":"","group_codeno":"","moq":"0","is_bookable":"0","b2b_status":"1","category_name":"B2Bzs","brand_name":null,"tags":null,"recommends":["NEW ARRIVAL","HOT SALE"],"sku_options":null,"sku":[{"id":"2696255","goods_id":"137808","sku_code":"0_0","codeno":"","store_id":"24073","base_name":null,"sku_value":"","barcode":"","stock_nums":"9999999","status":"1","price":"0.0000","market_price":"0.0000","cost_price":"0.0000","weight":"0.2000","create_time":"1559636978","update_time":"1559636978","is_instock":"1"}],"details":null,"detail":"","property":null,"images":["http://cn01.imgcdn.ymcart.com/24073/2019/06/04/9/6/962bbe88c35a268e.gif","http://cn01.imgcdn.ymcart.com/24073/2019/06/04/4/8/48af8f39afbb8350.jpg"],"images_album":{"spec_name":"Header","spec_image":[{"muti_spec_value":"Grommet Top Silver","image":"http:\/\/cn01-imgcdn.ymcart.com\/24073\/2021\/04\/28\/9\/1\/919dacc9bb8fe6f0.jpg","images":[]},{"muti_spec_value":"Grommet Top Anti-brass","image":"http:\/\/cn01-imgcdn.ymcart.com\/24073\/2021\/04\/28\/3\/3\/33d7e3f135541f03.jpg","images":[]},{"muti_spec_value":"Grommet Top Silver-black","image":"http:\/\/cn01-imgcdn.ymcart.com\/24073\/2021\/04\/28\/c\/0\/c02f6b16123f7347.jpg","images":[]},{"muti_spec_value":"Tab Top","image":"http:\/\/cn01-imgcdn.ymcart.com\/24073\/2021\/04\/28\/0\/4\/0480c69bceba5198.jpg","images":[]},{"muti_spec_value":"Back Tab","image":"http:\/\/cn01-imgcdn.ymcart.com\/24073\/2021\/04\/28\/7\/c\/7c0b70e91b57413b.jpg","images":[]},{"muti_spec_value":"Single Rod Pocket","image":"http:\/\/cn01-imgcdn.ymcart.com\/24073\/2021\/04\/28\/5\/1\/51aee65fbf09ce29.jpg","images":[]},{"muti_spec_value":"Double Rod Pockets","image":"http:\/\/cn01-imgcdn.ymcart.com\/24073\/2021\/04\/28\/e\/1\/e14cd4acf0002a4e.jpg","images":[]},{"muti_spec_value":"Top Pinch Pleat","image":"http:\/\/cn01-imgcdn.ymcart.com\/24073\/2021\/04\/28\/7\/f\/7f382ffd356dd6d1.jpg","images":[]}]},"category_path_name":["B2Bzs"],"rel_category_path_name":[],"rel_category_path":[],"sale_mode_res":{"sale_mode":1,"discount":8,"start_time":"2020-04-21","end_time":"2020-04-30"}}]}
备注
注意: rec_id, tag_id, other_category_id 不能同时提交 id : 数据库自增ID store_id : 店铺id base_name : 商品名称 brand_id : 商品品牌id goods_type_id : 商品类型id category_path : 商品分类路径(id) category_id : 商品分类id codeno : 商品编号 image : 商品主图 price :商品默认售价 cost_price :商品折扣价 market_price :商品市场价 listorder : 商品排序 status : 商品状态,1表示上架,0表示下架 create_time : 商品添加时间 modify_time : 商品上一次修改时间 template_page : 模板页面 visit_counts : 访问量 buy_counts : 订购量 wishlist_counts : 收藏数 comment_counts : 评论量 comment_value : 用户评分 stock_nums : 库存量 sale_mode : 是否是特价商品 spec_mode : 规格模式,0是单规格,1是多规格现成,2商品DIY定制 is_diy_remark : 详细页定制留言 weight : 商品重量(kg) start_time : 商品特价活动开始时间 end_time : 商品特价活动结束时间 is_free_shipping : 是否是包邮商品 special_offer_id : 营销活动id discount : 商品折扣 title : seo三要素之标题 keywords : seo三要素之关键词 descript : seo三要素之描述 mini_detail : 商品简短描述 category_name : 商品分类名称 brand_name : 商品品牌名称 tags : 商品标签 recommends : 商品推荐 sku_options : 购物属性 name:属性名称 value:子属性 property : 普通属性 images : 颜色默认相册其它细节图 多个以逗号隔开 images_album 颜色相册 spec_name 颜色相册属性名称 spec_image 颜色相册 muti_spec_value 属性名称 image 颜色相册主图 images 颜色相册细节图 category_path_name :商品分类路径 sku :sku列表 具体备注请查找sku列表栏 moq: 最小起订量 mxoq:最大订购量 supplier_remark : 供应商备注 sale_mode_res 销售模式 sale_mode 为1表示特价,discount 折扣(8为八折),start_time 特价开始时间,end_time 特价结束时间,例如"sale_mode_res" : {"sale_mode":1,"discount":8,"start_time":"2020-04-21","end_time":"2020-04-30"} sale_mode 为2表示批发,moq 最小订购量,min_qty 起始区间,range_end 区间件数,一维数组,range_discount 区间折扣 一维数组(和区间件数对应),range_remark 区间备注 一维数组(和区间件数,区间折扣对应),例如,"sale_mode_res" : {"sale_mode":2,"moq":8,"min_qty":0,"range_end":[20,50,100],"range_discount":[8,7,6],"range_remark":["remark1","remark2","remark3"]} sale_mode 为4表示预售 ,start_time 预售开始时间,end_time 预售结束时间,ships 配送时间,ordered_qty 已售数量,range_end 区间件数,一维数组(最后值为0,如下例子,0-20,21-50,50以上),range_discount 区间折扣 一维数组(和区间件数对应),例如, {"sale_mode":4,"start_time":"2020-04-21","end_time":"2020-04-30","ships":"2020-05-30","ordered_qty":8,"range_end":[20,50,0],"range_discount":[8,7,6]}
分类列表
编号 : categoryList
请求参数
参数名 | 参数类型 | 必传 | 缺省值 | 描述 |
---|---|---|---|---|
token | VARCHAR | Y |
返回值
{"code":0,"data":[{"0":"1","id":"1","1":"Women","base_name":"Women","2":"0","parent_id":"0","3":"99990","listorder":"99990","4":"test","title":"test","5":"test","keywords":"test","6":"test","descript":"test"}]}
备注
id : 数据库自增ID base_name : 分类名称 parent_id : 上一层分类id listorder : 排序 title : SEO三要素之标题 keywords : SEO三要素之关键词 descript : SEO三要素之描述