首页 - Goods - API
最后修改: 2019-10-14 12:01:19 

更新推荐商品

编号  :  updateGoodsRec

POST - http://域名/api-erp-updateGoodsRec.html
动态更新商品推荐
请求参数
参数名 参数类型 必传 缺省值 描述
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]}
最后修改: 2018-12-18 11:18:44 

品牌列表

编号  :  brandList

POST - http://域名/api-erp-brandList.html
请求参数
参数名 参数类型 必传 缺省值 描述
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":""}]}}
最后修改: 2019-06-04 15:09:15 

SKU列表

编号  :  skuList

POST - http://域名/api-erp-skuList.html
获取SKU列表
请求参数
参数名 参数类型 必传 缺省值 描述
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否
最后修改: 2018-03-26 10:20:20 

删除商品

编号  :  goodsRemove

POST - http://域名/api-erp-goodsRemove.html
通过JSON批量删除商品或者商品子SKU
请求参数
参数名 参数类型 必传 缺省值 描述
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: 参数为空或者参数重复
最后修改: 2018-09-25 15:45:23 

编辑商品

编号  :  updateGoods

POST - http://域名/api-erp-updateGoods.html
通过JSON批量更新商品信息,有传的值才会被更新。
请求参数
参数名 参数类型 必传 缺省值 描述
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,"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"},{"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"},{"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"},{"spec_value_name":"Black_M","codeno":"API1000-3","stock":999,"price":100,"weight":1.5,"barcode":"1213132131233"}]}]
2 实现商品更新,需要更新商品时候,goods_id和codeno不能同时留空
3 goods_id 优先于 codeno
4 当msg不为空,表示有更新不成功的排序
5 可一次性推送多条数据,最多不超过200个
6 字段说明
base_name 商品名称,不能为空
codeno 商品编号,可留空,如果不留空并且存在将不能添加成功
price 商品价格,选填
weight 商品重量, KG
category 分类名称 选填
brand_name 品牌名称 选填
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页面描述 选填
main_image 商品默认相册主图  选填  例:http://www.hgcuttingsystems.com/uploadImage/2016-10-05/2016100514493561986344.jpg  ,留空不更新
other_images 颜色默认相册其它细节图 多个以逗号隔开  ,留空不更新
例:"http://www.hgcuttingsystems.com/fckeditfile/image/1473146087.jpg,http://www.hgcuttingsystems.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")
多规格数据 当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"),array("spec_value_name"=>"Red_M","codeno"=>"API1000-2","stock"=>999,"price"=>100,"weight"=>1.5,"barcode"=>"1213132131232"),array("spec_value_name"=>"Red_L","codeno"=>"API1000-3","stock"=>999,"price"=>100,"weight"=>1.5,"barcode"=>"1213132131233"))
muti_spec_image_name 多规格数据 选填 例:Color
muti_spec_images 多规格颜色图片 选填 每个颜色对应一组图片,同组多个图片以逗号隔开 例array("http://www.hgcuttingsystems.com/fckeditfile/image/1473146087.jpg,http://www.hgcuttingsystems.com/uploadImage/2016-09-06/201609061456137098227.jpg","http://www.hgcuttingsystems.com/fckeditfile/image/1473146087.jpg,http://www.hgcuttingsystems.com/uploadImage/2016-09-06/201609061456137098227.jpg")
那么对应的是:sku_option1中 "Color:Red,Yellow,Green" 的颜色顺序。
最后修改: 2018-01-17 13:45:59 

更新库存/价格

编号  :  updateSkuQty

POST - http://域名/api-erp-updateSkuQty.html
通过JSON批量更新商品库存
请求参数
参数名 参数类型 必传 缺省值 描述
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结构范例:[{"codeno":"LC79126-3","num":100,"price":23.00},{"codeno":"SKU_TEST","num":100}]
2 实现库存数据对接,需要上传商品时候,SKU编号要严格填写并且唯一, price不填写则不更新价格
3 update_options的JSON结构范例:{"update_listorder":1,"update_status":1}
update_listorder:缺货时候排序是否为负数,有货时候自动为正数。  0 表示禁用这个功能
update_status:缺货时候排序是否下架,有货时候自动为上架。  0 表示禁用这个功能
4 当msg不为空,表示有更新不成功的库存
5 可一次性推送多条数据,最多不超过200个
最后修改: 2018-09-21 16:14:29 

添加商品

编号  :  addGoods

POST - http://域名/api-erp-addGoods.html
通过JSON批量添加商品
请求参数
参数名 参数类型 必传 缺省值 描述
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","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"},{"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"},{"spec_value_name":"Black_L","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"},{"spec_value_name":"Black_L","codeno":"API1000-3","stock":999,"price":100,"weight":1.5,"barcode":"1213132131233"}],"muti_spec_image_name":"Color","muti_spec_images":["http:\/\/www.hgcuttingsystems.com\/fckeditfile\/image\/1473146087.jpg,http:\/\/www.hgcuttingsystems.com\/uploadImage\/2016-09-06\/201609061456137098227.jpg"],"main_image":"http:\/\/www.hgcuttingsystems.com\/uploadImage\/2016-10-05\/2016100514493561986344.jpg","other_images":"http:\/\/www.hgcuttingsystems.com\/uploadImage\/2016-09-06\/201609061456137098227.jpg,http:\/\/www.hgcuttingsystems.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"]}}]
2 一次推送多条数据
3 字段说明:
base_name 商品名称,不能为空
codeno 商品编号,可留空,如果不留空并且存在将不能添加成功
price 商品价格,不能为空
weight 商品重量, KG
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")
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"),array("spec_value_name"=>"Red_M","codeno"=>"API1000-2","stock"=>999,"price"=>100,"weight"=>1.5,"barcode"=>"1213132131232"),array("spec_value_name"=>"Red_L","codeno"=>"API1000-3","stock"=>999,"price"=>100,"weight"=>1.5,"barcode"=>"1213132131233"))
muti_spec_image_name 多规格数据 选填 例:Color
muti_spec_images 多规格颜色图片 选填 每个颜色对应一组图片,同组多个图片以逗号隔开 例array("http://www.hgcuttingsystems.com/fckeditfile/image/1473146087.jpg,http://www.hgcuttingsystems.com/uploadImage/2016-09-06/201609061456137098227.jpg","http://www.hgcuttingsystems.com/fckeditfile/image/1473146087.jpg,http://www.hgcuttingsystems.com/uploadImage/2016-09-06/201609061456137098227.jpg")
那么对应的是:sku_option1中 "Color:Red,Yellow,Green" 的颜色顺序。  
spec_res diy商品定制规格数据  当spec_mode=2时必填 数据包括 spec_weight 规格附加重量 spec_price规格附加价格 例: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_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
main_image 商品默认相册主图 必填 例:http://www.hgcuttingsystems.com/uploadImage/2016-10-05/2016100514493561986344.jpg
other_images 颜色默认相册其它细节图 多个以逗号隔开 例:"http://www.hgcuttingsystems.com/fckeditfile/image/1473146087.jpg,http://www.hgcuttingsystems.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 资源服务器!
4 返回结果当code不为0,表示添加失败,msg提示信息;当code为0,提示failure_count失败数量,success_count成功数量,msg 数组提示失败产品名称 编号 信息
最后修改: 2018-01-17 13:45:15 

添加分类

编号  :  addCategory

POST - http://域名/api-erp-addCategory.html
通过JSON批量创建分类
请求参数
参数名 参数类型 必传 缺省值 描述
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个
最后修改: 2019-09-05 14:51:33 

商品列表

编号  :  goodsList

POST - http://域名/api-commonErp-goodsList.html
批量获取商品列表
请求参数
参数名 参数类型 必传 缺省值 描述
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,"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":null},"category_path_name":["B2Bzs"],"rel_category_path_name":[],"rel_category_path":[]}]}
备注
注意: 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表示下架
up_time : 上架时间
down_time : 下架上架
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 : 商品标签
sku_options : 购物属性 name:属性名称 value:子属性
property : 普通属性
images : 颜色默认相册其它细节图 多个以逗号隔开 
category_path_name :商品分类路径
sku :sku列表  具体备注请查找sku列表栏
最后修改: 2018-01-17 13:45:02 

分类列表

编号  :  categoryList

POST - http://域名/api-erp-categoryList.html
获取网站的所有商品
请求参数
参数名 参数类型 必传 缺省值 描述
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三要素之描述