坑很多,有一些忘记了。文档乱的很,有问题可以私信我一下我看能不能想起来。
坑一、添加商品接口。 {"error_response": {"code":"62","zh_desc":"json转换时错误","en_desc":"json conversion error"}}
解决:描述内容中不能出现 # 符。
坑二、文档参数描述是错误的。下面是一个正常的添加商品的json(对于我店合适,你的店铺可能品类不一样要调整)
{"skus":[{"@type":"com.jd.pop.ware.ic.api.domain.Sku","venderId":0,"wareId":0,"status":0,"saleAttrs":[],"jdPrice":3.50,"stockNum":2186,"imgTag":0,"categoryId":0}],"ware":{"title":"【二手8成新】中国近现代史纲要(2013年修订版) 本书编写组 高等教育出版社 97870","venderId":0,"categoryId":15156,"categorySecId":0,"brandId":303072,"templateId":0,"transportId":0,"wareStatus":8,"barCode":"9787040377477","wareLocation":0,"colType":0,"delivery":0,"adWords":{"words":"正版二手图书,8成新左右,不附带光盘,笔记或多或少,不会影响正常使用"},"length":200,"width":100,"height":30,"weight":0.48,"props":[{"@type":"com.jd.pop.ware.ic.api.domain.Prop","attrId":"10144313","attrValues":["9787040377477"],"index":0},{"@type":"com.jd.pop.ware.ic.api.domain.Prop","attrId":"10144333","attrValues":["高等教育出版社"],"index":0},{"@type":"com.jd.pop.ware.ic.api.domain.Prop","attrId":"10144332","attrValues":["本书编写组"],"index":0}],"images":[{"@type":"com.jd.pop.ware.ic.api.domain.Image","imgId":0,"imgUrl":"jfs/t15079/268/767134958/15737/235a8e2b/5a379e59N9b44d5a5.jpg","colorId":"0000000000","imgIndex":1}],"introduction":"测试描述内容","marketPrice":23.00,"costPrice":0.0,"stockNum":2186,"skus":[{"@type":"com.jd.pop.ware.ic.api.domain.Sku","venderId":0,"wareId":0,"status":0,"saleAttrs":[],"jdPrice":3.50,"stockNum":2186,"imgTag":0,"categoryId":0}],"shopId":0,"jdPrice":3.50,"promiseId":0}}
坑三、京东三级类目下面都会有一些必填属性,比如图书的话有isbn 作者之类的,但是不同的三级分类下同一个属性名,它的id是不同的。。。。。并且这些id值还没地方去获取,我是靠一个个分类试过去,然后只要我调用接口的时候空了没填写,他就会报一个错误类似
{"error_response": {"code":"501","zh_desc":"调用参数错误","en_desc":"java.lang.Exception:参数错误.属性[出版社:10144395],作者:10144382],ISBN:10144374],必填#37da1cc3e4c942bb821a21ded183ff2c"}} 这样的错误,然后记录好这个 10144395 就是缺少的必填参数。。嗯,对的,29个目录,呵呵哒。。。。
后面认为有需要补充的会继续写。