文档中心 > API类目 > 淘宝商品API

tmall.product.add.schema.get (产品发布规则获取接口)

获取用户发布产品的规则

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
category_id Number 必须 1512 商品发布的目标类目,必须是叶子类目
brand_id Number 可选 1 品牌ID

响应参数

名称 类型 示例值 描述
add_product_rule String <itemRule><field id="title" name="商品标题" type="input"></field><itemRule> 返回发布产品的规则文档

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
TmallProductAddSchemaGetRequest req = new TmallProductAddSchemaGetRequest();
req.setCategoryId(1512L);
req.setBrandId(1L);
TmallProductAddSchemaGetResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<tmall_product_add_schema_get_response>
    <add_product_rule>&lt;itemRule&gt;&lt;field id=&quot;title&quot; name=&quot;商品标题&quot; type=&quot;input&quot;&gt;&lt;/field&gt;&lt;itemRule&gt;</add_product_rule>
</tmall_product_add_schema_get_response>

异常示例

  • XML示例
  • JSON示例
<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.invalid-parameter 参数格式不正确,brand_id或category_id未添加 参数格式不正确,请检查brand_id、category_id参数信息

API工具

如何获得此API

FAQ

返回
顶部