根据tmall.product.match.schema.get获取到的规则,填充相应地的字段值以及类目,匹配符合条件的产品,返回匹配product结果,注意,有可能返回多个产品ID,以逗号分隔(尤其是图书类目);
名称 | 类型 | 是否必须 | 示例值 | 更多限制 | 描述 |
---|---|---|---|---|---|
category_id | Number | 必须 | 1512 | 商品发布的目标类目,必须是叶子类目 | |
propvalues | String | 必须 | <itemRule> <field id="prop_13021751" name="货号" type="input"><value>123</value> </field> <field id="prop_20000" name="品牌" type="singleCheck"><value>30111</value> </field> </itemRule> | 根据tmall.product.match.schema.get获取到的模板,ISV将需要的字段填充好相应的值结果XML。 |
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
match_result | String | 231231231 | 返回匹配产品ID,部分类目可能返回多个产品ID,以逗号分隔。 |
1 2 3 4 5 6 | TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret); TmallProductSchemaMatchRequest req = new TmallProductSchemaMatchRequest(); req.setCategoryId(1512L); req.setPropvalues( "<itemRule> <field id=\"prop_13021751\" name=\"货号\" type=\"input\"><value>123</value> </field> <field id=\"prop_20000\" name=\"品牌\" type=\"singleCheck\"><value>30111</value> </field> </itemRule>" ); TmallProductSchemaMatchResponse rsp = client.execute(req, sessionKey); System.out.println(rsp.getBody()); |
1 2 3 | < tmall_product_schema_match_response > < match_result >231231231</ match_result > </ tmall_product_schema_match_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:category-not-found | 商品发布的目标类目不存在 | 商品发布的目标类目不存在,请检查参数 |
isp.service-unavailable | 系统繁忙,请稍后重试 | 系统繁忙,请稍后重试 |