Schema体系发布一个产品
名称 | 类型 | 是否必须 | 示例值 | 更多限制 | 描述 |
---|---|---|---|---|---|
category_id | Number | 必须 | 1512 | 商品发布的目标类目,必须是叶子类目 | |
brand_id | Number | 可选 | 12345 | 品牌ID | |
xml_data | String | 必须 | <itemrule><field id="prop_14837340 " name="体积 (含包装)" type="input "></field></itemrule> | 根据tmall.product.add.schema.get生成的产品发布规则入参数据 |
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
add_product_result | String | <itemrule> <field id="product_id" name="产品ID" type="input ">1221</field> <field id="create_time" name="创建时间" type="input ">2014-01-01 00:00:00</field> <itemrule> | 新发产品结果 |
1 2 3 4 5 6 7 | TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret); TmallProductSchemaAddRequest req = new TmallProductSchemaAddRequest(); req.setCategoryId(1512L); req.setBrandId(12345L); req.setXmlData( "<itemrule><field id=\"prop_14837340 \" name=\"体积 (含包装)\" type=\"input \"></field></itemrule>" ); TmallProductSchemaAddResponse rsp = client.execute(req, sessionKey); System.out.println(rsp.getBody()); |
1 2 3 | < tmall_product_schema_add_response > < add_product_result ><itemrule> <field id="product_id" name="产品ID" type="input ">1221</field> <field id="create_time" name="创建时间" type="input ">2014-01-01 00:00:00</field> <itemrule></ add_product_result > </ tmall_product_schema_add_response > |
1 2 3 4 5 6 | < error_response > < code >50</ code > < msg >Remote service error</ msg > < sub_code >isv.invalid-parameter</ sub_code > < sub_msg >非法参数</ sub_msg > </ error_response > |
错误码 | 错误描述 | 解决方案 |
---|---|---|
isv.invalid-parameter:cid | 产品对应类目删除或者屏蔽 | 不能发布该类目的产品 |
isv.parameter-parase-error:xml_data | 入参数据无法被转换识别 | 按tmall.product.add.schema.get格式修改入参 |