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

tmall.product.schema.add (使用Schema文件发布一个产品)

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> 新发产品结果

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
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());

响应示例

  • XML示例
  • JSON示例
<tmall_product_schema_add_response>
    <add_product_result>&lt;itemrule&gt; &lt;field id=&quot;product_id&quot; name=&quot;产品ID&quot; type=&quot;input &quot;&gt;1221&lt;/field&gt; &lt;field id=&quot;create_time&quot; name=&quot;创建时间&quot; type=&quot;input &quot;&gt;2014-01-01 00:00:00&lt;/field&gt; &lt;itemrule&gt;</add_product_result>
</tmall_product_schema_add_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.parameter-parase-error:xml_data 入参数据无法被转换识别 按tmall.product.add.schema.get格式修改入参

API工具

如何获得此API

FAQ

返回
顶部