文档中心 > 开发文档

【新接口】商品发布接入文档

本文档完整描述通过API发布商品的具体流程,包括接口参数设置以及发品相关接口的调用时机,旨在对第三方发品做一个指导。

一. 发布接口总览

发布商品首先需要通过alibaba.icbu.product.schema.get接口获取商品信息填写的规则(xml格式),然后接入方可以根据规则,渲染出自己的填写页面,收集商品填写数据,并将数据填充到之前获取的xml的指定字段,通过alibaba.icbu.product.schema.add接口来最终发布(下文简称add接口)。

二. 发布规则说明

商品所有需要填写的字段和填写格式,都以统一的格式体现在xml文件中,如附件1。具体xml文件的格式说明如下:

2.1 待填写字段 field

要使用Schema接口必须先理解schema体系的结构。当前使用xml格式来表述一个完整schema。一个完整的xml会由若干个field组成,每一个field都是用来描述规则和元素。
schema结构针对field定义了以下组成部分:

  • id
    用于描述唯一主键,以商品的标题为例,_id=‘title’_。
  • name
    用于描述field的显示名,以商品的标题为例,_name=‘商品标题’_。
  • type 用于描述field的值的数据输入类型,schema结构对于field定义了七种类型,分别为input、multiInput、singleCheck、multiCheck、complex、multiComplex和label。
  • input,说明当前field的值为文本输入型。

  • multiInput ,说明当前field的值为多行文本输入型。
  • singleCheck,说明当前field的值为单选输入型,类似于radio。
  • multiCheck ,说明当前field的值为多选输入型,类似于checkbox。
  • complex ,说明当前field的值为复合结构,表示数据的聚合。
  • multiComplex ,说明当前field的值为复合结构,与complex有差别的在于multiComplex的field是可以有多份数据实例样本。
  • values
    用于描述multiInput和multiCheck类型的field的value的集合
  • complex-values
    用于描述complex和multiComplex类型的field的多数据值的集合
  • value
    用于描述field的值,上一层级一般为values或者complex-values。
  • option 用于描述field的值的可选值,与html中select元素中的option标签类似。
  • displayName,用于描述可选值的展示名。

  • value,用于描述可选值主键。
  • label-group用于描述label的聚合,label主要用户描述说明信息。
  • rule 用于描述field的各类系统或者业务规则。
  • valueTypeRule,用于描述field值需要满足数据类型,包括了text(文本型)/decimal(小数型)/integer(整数型)/date(日期型)/long(长整数型)/url(超链接)/textarea(多行文本)/html(支持html标记语法的文本)
  • requiredRule,是否必填,默认为false,true/false
  • disableRule ,是否忽略此field,为true时,将不对rule进行check,同时他的value也将无效。默认为false,值范围包含true/false
  • maxLengthRule ,最大长度
  • minLengthRule ,最小长度
  • maxValueRule,最大值(数值类型时有效)
  • minValueRule ,最小值(数值类型时有效)
  • maxInputNumRule ,最多可选数(多选时有效)
  • minInputNumRule ,至少要选数(多选时有效)
  • maxTargetSizeRule ,最大目标文件大小
  • minTargetSizeRule ,最小目标文件大小
  • readOnlyRule ,只读,用户无法修改返回值,值范围为true/false
  • regxRule , 正则表达式匹配
  • tipRule ,Field中展示的tip信息,用于一些无法直接用语法描述或者过于复杂的规则,或者提示信息,需要给用户透出。
  • maxImageSizeRule,最大图片大小,指的是分辨率,如800*800
  • minImageSizeRule , 最小图片大小
    +devTipRule,一般用于给开发者提示,不需要展示给用户,开发者可以通过此Rule获取特定的信息,如例子中的如何获取售后模板信息。

2.2 填写类型 Type

2.2.1 单选类型

单选类型的字段,它的value字段值,都存放在value子节点中。单选具体又分为两类,详解如下:

  • input 输入类型,用户输入数据,具体数据类型参见 valueTypeRule。数据存放在value子节点中。填写案例如下:

规则xml:

<field id="productTitle" name="Product name" type="input">
        <rules>
            <rule name="tipRule" value="&lt;div&gt;A complete product name should include the name and type of product you are selling, its key specifications and attributes, model number, relevant certifications and industry standard terms - e.g. &quot;Dual Suspension Red 26” Mountain Bike &quot;. &lt;/div&gt; Please avoid repetitive words.&lt;a href=&quot;http://service.alibaba.com/ensupplier/faq_detail/13863828.htm?tracelog=ensupplier_ma_cw15&quot; target=&quot;_blank&quot;&gt;learn more&lt;/a&gt;"/>
            <rule name="tipRule" value="The key information of standardized products will be displaied by default, please do not repeat it in the product name"/>
            <rule name="requiredRule" value="true"/>
            <rule name="maxLengthRule" value="128" exProperty="include" unit="byte"/>
            <rule name="regexRule" value="[^\\x04-\\x80]+" exProperty="not include"/>
            <rule name="regexRule" value="\\w+(?:[\\-+.]\\w+)*@\\w+(?:[\\-.]\\w+)*\\.\\w+(?:[\\-.]\\w+)*" exProperty="not include"/>
            <rule name="regexRule" value="&lt;[^&gt;]+&gt;" exProperty="not include"/>
            <rule name="valueTypeRule" value="text"/>
        </rules>
    </field>

数据填写示例:

<field id="productTitle" name="Product name" type="input">
      <value>wang chen test api submit sourcing updateFields hah</value>
</field>
  • singleCheck 单选类型,候选项参见 option节点。通常在填写时,只需将候选值中的value属性填写在最终的value数据中。需要注意的是,当遇到带有-1的option时,表示该字段可以由用户自己输入值,例如下例子中的

规则xml:

<field id="priceUnit" name="Unit" type="singleCheck">
        <rules>
            <rule name="requiredRule" value="true"/>
            <rule name="valueTypeRule" value="long"/>
        </rules>
        <options>
            <option displayName="Acre/Acres" value="26"/>
            <option displayName="Ampere/Amperes" value="27"/>
            <option displayName="Bag/Bags" value="1"/>
            <option displayName="other" value="-1"/>
            <option displayName="Barrel/Barrels" value="4"/>
            ...
        </options>
    </field>

填写示例:

<field id="priceUnit" name="Unit" type="singleCheck">
        <value>4</value>
</field>

2.2.2 多选类型

多选类型的数据存在在values子节点中,具体又分为多输入和多选两种。

  • multiInput:多文本输入,值通常为多个字符串,但也有为每个输入项单独定制附加属性的情况。

规则xml:下面的规则文件表明该字段可以输入多个文本串,不过每个文本串还有附加属性需要填写,通过valueAttributeRule来表达,例如需要传propId,propName等等。

<field id="props" name="" type="multiInput">
<rules>
    <rule name="valueAttributeRule" value="propId"/>
    <rule name="valueAttributeRule" value="propName"/>
    <rule name="valueAttributeRule" value="propValueId"/>
    <rule name="valueAttributeRule" value="propValueName"/>
    <rule name="tipRule" value="值为属性id属性value的组合"/>
</rules>            
</field>

填写示例:

<field id="props" name="" type="multiInput">
       <values>
           <value propValueId="4348586" propId="191286172" propName="p-191286172" propValueName="Free">111:333;22,11</value>
           <value propValueId="3399503" propId="191288010" propName="p-191288010" propValueName="Brown">111:333;22,11</value>
       </values>
</field>
  • multiCheck:多选类型。候选项参见 option节点。通常在填写时,只需将候选值中的value属性填写在最终的value数据中。需要注意的是,当遇到带有-1的option时,表示该字段可以由用户自己输入值,例如下例子中的

示例规则xml:

<field id="predefined_method" type="multiCheck">
                <rules>
                    <rule name="valueTypeRule" value="text"/>
                    <rule name="requiredRule" value="false"/>
                </rules>
                <options>
                    <option displayName="L/C." value="L/C"/>
                    <option displayName="D/A." value="D/A"/>
                    <option displayName="D/P." value="D/P"/>
                    <option displayName="T/T." value="T/T"/>
                    <option displayName="Western Union." value="Western Union"/>
                    <option displayName="MoneyGram." value="MoneyGram"/>
                </options>
</field>

填写xml示例:

<field id="predefined_method" type="multiCheck">
                <values>
                    <value>L/C</value>
                    <value>D/A</value>
                </values>
</field>

2.2.3 复杂类型

复杂类型的字段,需要填写的数据通常由多个子Field节点构成,每个子Field节点的填写类型,根据子field节点的Type而定。

  • complex:complex类型的子字段规则都挂载在节点下,每个子字段规则都有单独节点表达。如下规则文件所示,fob字段由3个子字段组成,类型分别是input、input、singleCheck,填写规则分别参见 2.2.1节。
<field id="fob" name="FOB Price\n" type="complex">
        <fields>
            <field id="range_max" type="input">
                <rules>
                    <rule name="valueTypeRule" value="double"/>
                    <rule name="requiredRule" value="true"/>
                </rules>
            </field>
            <field id="range_min" type="input">
                <rules>
                    <rule name="valueTypeRule" value="double"/>
                    <rule name="requiredRule" value="true"/>
                </rules>
            </field>
            <field id="unit_type" type="singleCheck">
                <rules>
                    <rule name="valueAttributeRule" value="text"/>
                    <rule name="requiredRule" value="true"/>
                </rules>
                <options>
                    <option displayName="USD" value="1"/>
                    <option displayName="GBP" value="5"/>
                    <option displayName="RMB" value="2"/>
                    <option displayName="EUR" value="3"/>
                    <option displayName="AUD" value="7"/>
                    <option displayName="CAD" value="8"/>
                    <option displayName="CHF" value="9"/>
                    <option displayName="JPY" value="6"/>
                    <option displayName="HKD" value="12"/>
                    <option displayName="NZD" value="13"/>
                    <option displayName="SGD" value="14"/>
                    <option displayName="NTD" value="11"/>
                    <option displayName="Other" value="4"/>
                </options>
            </field>
        </fields>
    </field>

示例规则xml:complex类型字段的value则都挂载在节点之下,具体每个子field的值,则由单独的结构来表达。

<field id="fob" name="FOB Price\n" type="complex">
        <complex-value>
            <field id="range_min" type="input">
                <value>2.0</value>
            </field>
            <field id="range_max" type="input">
                <value>3.0</value>
            </field>
            <field id="unit_type" type="singleCheck">
                <value>1</value>
            </field>
        </complex-value>
</field>
  • multiComplex: 多个复合字段。规则字段结构同complex。

规则xml示例:

<field id="sku" name="" type="multiComplex">
        <fields>
            <field id="props" name="" type="multiInput">
                <rules>
                    <rule name="valueAttributeRule" value="propId"/>
                    <rule name="valueAttributeRule" value="propName"/>
                    <rule name="valueAttributeRule" value="propValueId"/>
                    <rule name="valueAttributeRule" value="propValueName"/>
                    <rule name="tipRule" value="值为属性id属性value的组合"/>
                </rules>
            </field>
            <field id="skuStock" name="Quantity in stock" type="multiInput">
                <rules>
                    <rule name="valueAttributeRule" value="warehouseCode"/>
                    <rule name="valueAttributeRule" value="srcValue"/>
                </rules>
            </field>
            <field id="price" name="Price" type="input"/>
            <field id="skuOuterId" name="sku code" type="input">
                <rules>
                    <rule name="maxLengthRule" value="20" exProperty="include" unit="byte"/>
                    <rule name="valueTypeRule" value="text"/>
                </rules>
            </field>
            <field id="skuId" name="" type="input">
                <rules>
                    <rule name="valueTypeRule" value="long"/>
                </rules>
            </field>
        </fields>
    </field>

填写示例:字段值在填写时,数据挂载在节点下,而且一个multiComplex字段下可以有多个,如如下面的SKU字段,有两条记录,分别表示两条SKU记录。

<field id="sku" name="" type="multiComplex">
        <complex-values>
         <field id="price" name="Price" type="input">
                <value>23.00</value>
            </field>
            <field id="skuStock" name="Quantity in stock" type="multiInput">
                <values>
                    <value srcValue="0" warehouseCode="CN_LOCAL_01">44</value>
                </values>
            </field>
            <field id="skuOuterId" name="sku code" type="input">
                <value>sku2</value>
            </field>
            <field id="props" name="" type="multiInput">
                <values>
                    <value propValueId="28318" propId="191286172" propName="p-191286172" propValueName="XXL">111:333;22,11</value>
                    <value propValueId="3399503" propId="191288010" propName="p-191288010" propValueName="Brown">111:333;22,11</value>
                </values>
            </field>
        </complex-values>
        <complex-values>
             <field id="price" name="Price" type="input">
                <value>23.00</value>
            </field>
            <field id="skuStock" name="Quantity in stock" type="multiInput">
                <values>
                    <value srcValue="0" warehouseCode="CN_LOCAL_01">33</value>
                </values>
            </field>
            <field id="skuOuterId" name="sku code" type="input">
                <value>sku1</value>
            </field>
            <field id="props" name="" type="multiInput">
                <values>
                    <value propValueId="4348586" propId="191286172" propName="p-191286172" propValueName="Free">111:333;22,11</value>
                    <value propValueId="3399503" propId="191288010" propName="p-191288010" propValueName="Brown">111:333;22,11</value>
                </values>
            </field>
        </complex-values>
    </field>

2.3 字段规则 rule

Schema结构中不同输入类型的field可能出现的Rule有:

每条规则都具有以下几个属性:
name:唯一标识该规则的类型,例如tipRule,RegexRule
** value; 标识具体的规则值,不同类型的业务规则,具体含义不同,例如当name=valueAttributeRule,标识具体的valueAttributeName,name=RegexRule时,表名具体的正则表达式,name=valueTypeRule时,标识具体的数据类型。
**exProperty:当前规则是maxLengthRule,regexRule等大小边界校验规则时,标识校验模式。具体含义见不同规则类型的介绍。
dependGroup:用来标识当前规则生效的前提条件,一般和disableRule搭配使用,其他规则通常不会使用该属性。

2.3.1 最大最小规则

涉及到最大和最小规则的rule都是区间rule,例如 MaxLengthRule,MinLengthRule,MaxValueRule, MinValueRule, MaxInputNumberRule, MinInputNumberRule, MaxTargetSizeRule, MinTargetSizeRule, MaxImageSizeRule,MinImageSizeRule

在区间rule里面,都有一个exProperty属性,表示开闭区。当exProperty=include时,为闭区间,大小比较时,包含rule的value指定的值;当exProperty=not include时,为开区间,大小比较时,不包含rule的value指定的值。

maxValueRule中value=2 且 exProperty=include时,表示返回值必须小于等于2maxValueRule中value=2 且 exProperty=not include时,表示返回值必须小于2

maxTargetSizeRule和minTargetSizeRule有个unit属性,表示规则的单位。这两个rule的单位主要有kb、mk、gb等,表示文件大小的单位。 maxLengthRule和minLengthRule也有unit属性,表示长度计量单位,有byte和character两种单位.

”a汉字” 这个字符串,当单位为byte时,长度是5,当单位是character时,长度是3


2.3.2 正则匹配规则-

RegexRule:? 正则表达式规则有exProperty属性,当校验模式是过滤非法字符时,则exProperty=not include,value里是非法字符串的正则表达式。当校验模式是提示正确的字符时,则exProperty=include,value里是合法字符串的正则表达式。

2.3.3 必填规则

RequiredRule: value=true时表示当前字段必填,value=false时表示当前字段非必填,如果当前字段没有这条规则,则默认表示非必填。

2.3.4 类型规则

valueTypeRule: value表示具体的数据类型。包括了text(文本型)/decimal(小数型)/integer(整数型)/date(日期型)/long(长整数型)/url(超链接)/textarea(多行文本)/html(支持html标记语法的文本)

2.3.5 联动规则

联动规则:通常用来描述某个字段的填写依赖另外一个字段是否填写。例如 售卖方式字段(saleType),只有当当前商品类型是下单品(market字段,且选择ReadyToShip)时才需要填写。在引入联动规则前,这种字段依赖,接入方可以通过观察填写阿里后台表单 post.alibaba.com/product/publish?catId=145 来获取,然后将规则固化到自己的程序里,但是当阿里后台的规则变化时,接入方无法及时感知,会造成接入方发布的数据不符合数据校验规范,从而发布失败,因此在xml文件中也将表单的字段依赖规则透传给接入方,接入方可以按照固定的格式来解析,并应用到自己的表单,从而将字段填写规则和阿里后台的表单填写规则保持一致,发品体验更加流畅。

具体联动规则的说明如下:
DisableRuleDisableRule=true表示该field可忽略,一般与depend-group成组出现,用于描述多个field之间的依赖关系。如例子中的开始时间是依赖于商品状态的值为1(定时上架)时才需要设置值,可以理解为只有fieldId=“item_status”的值不等于1时,disableRule为true才成立。
以开始时间为例:

<field id="item_status" name="商品状态" type="singleCheck">
    <rules>
      <rule name="requiredRule" value="true"/>
    </rules>
    <options>
      <option displayName="出售中" value="0"/>
      <option displayName="定时上架" value="1"/>
      <option displayName="仓库中" value="2"/>
    </options>
    <default-value>0</default-value>
  </field>
  <field id="start_time" name="开始时间" type="input">
    <rules>
      <rule name="valueTypeRule" value="time"/>
      <rule name="disableRule" value="true">
        <depend-group operator="and">
          <depend-express fieldId="item_status" value="1" symbol="!="/>
        </depend-group>
      </rule>
    </rules>
  </field>


depend-group用于描述依赖关系的集合。

  • operator ,用于描述集合中多个依赖关系的关系,包括 ‘and’(与关系)和’or’(或关系)

depend-express用于描述依赖关系,上层为depend-group,与Rule中的disableRule是成组出现的。一般可以理解为当满足依赖关系时,disableRule为true才成立 depend-express中会包含fieldId、value和symbol。目前支持的symbol有:

  • is null ,fieldId指向的字段的值为空
  • == ,fieldId指向的字段的值等于value
  • != , fieldId指向的字段的值不等于value
  • ‘>’,fieldId指向的字段的值大于value
  • ‘<’, fieldId指向的字段的值小于value
  • ‘>=’ , fieldId指向的字段的值大于等于value
  • ‘<=’ ,fieldId指向的字段的值小于等于value
  • contains, fieldId指向的字段的值中包含有value
  • not contains ,fieldId指向的字段的值中不包含有value
  • this field’s value in fieldOptions ,fieldId指向的字段的值中在fieldId对应的value列表中
  • this field’s value not in fieldOptions ,fieldId指向的字段的值中不在fieldId对应的value列表中

2.3.6 业务规则

TipRule 一般用于无法直接描述的复杂规则,isv可以将该规则在页面上透出给用户,使得用户填写体验更好。如下面规则中的tipRule

<field id="price" name="商品价格" type="input">
    <rules>
      <rule name="valueTypeRule" value="decimal"/>
      <rule name="requiredRule" value="true"/>
      <rule name="tipRule" value="一口价 应在 销售属性表中所填 最高与最低价格 范围区间内。"/>
      <rule name="minValueRule" value="0.00" exProperty="not include"/>
      <rule name="maxValueRule" value="100000000.00" exProperty="not include"/>
      <rule name="383278799_1" value="商品价格必须在销售属性表中所填最高与最低价格范围区间内"/>
      <rule name="tipRule" value="为避免一口价变动引发的违规,请谨慎输入价格。" url="http://rule.tmall.com/tdetail-1168.htm?tag=self"/>
    </rules>
  </field>

2.3.7 开发规则

DevTipRule一般用于给开发者提示,不需要展示给用户,开发者可以通过此Rule获取特定的信息,如例子中的如何获取售后模板信息。
以售后模板为例:

<field id="after_sale_id" name="售后说明模板ID" type="input">
    <rules>
      <rule name="valueTypeRule" value="long"/>
      <rule name="devTipRule" value="请使用taobao.aftersale.get接口获取售后说明模板信息" url="//open.taobao.com/apidoc/api.htm?path=cid:4-apiId:10448"/>
    </rules>

2.4 发布规则获取

通过接口alibaba.icbu.product.schema.get来获取。

三. 发品流程明细

发布商品通过接口?alibaba.icbu.product.schema.add发布最终数据,具体参数如下:

category_id: 发布商品的类目id

xml: 装填商品数据的xml文件,填写样例见附件2,下面流程中引述需要填写的字段时,使用格式 xml.fieldId 来表述 xml文件中的<field = “fieldId”> 的元素。

在填写xml元素的时候,填写规则一般需要注意以下rule,以标题字段为例:

<field id="productTitle" name="Product name" type="input">
        <rules>
            <rule name="tipRule" value="&lt;div&gt;A complete product name should include the name and type of product you are selling, its key specifications and attributes, model number, relevant certifications and industry standard terms - e.g. &quot;Dual Suspension Red 26” Mountain Bike &quot;. &lt;/div&gt; Please avoid repetitive words.&lt;a href=&quot;http://service.alibaba.com/ensupplier/faq_detail/13863828.htm?tracelog=ensupplier_ma_cw15&quot; target=&quot;_blank&quot;&gt;learn more&lt;/a&gt;"/>
            <rule name="tipRule" value="The key information of standardized products will be displaied by default, please do not repeat it in the product name"/>
            <rule name="requiredRule" value="true"/>
            <rule name="maxLengthRule" value="128" exProperty="include" unit="byte"/>
            <rule name="regexRule" value="[^\\x04-\\x80]+" exProperty="not include"/>
            <rule name="regexRule" value="\\w+(?:[\\-+.]\\w+)*@\\w+(?:[\\-.]\\w+)*\\.\\w+(?:[\\-.]\\w+)*" exProperty="not include"/>
            <rule name="regexRule" value="&lt;[^&gt;]+&gt;" exProperty="not include"/>
            <rule name="valueTypeRule" value="text"/>
        </rules>
    </field>

name=“Product name” 表示该字段在表单中向客户展示的名称,接入方可以使用该名称,以便和阿里后台表单保持一致,也可以使用自己定义的名称。
type=“input” 表示该字段的类型是 输入类型,更多字段格式 见2.1节中介绍。

表示该字段必填

表示该字段的最大长度128

regexRule表示该字段值不应该包含指定格式的输入,该指定格式用正则表达式来匹配,此例中输入不应该包含?**[^\x04-\x80]+** 。更多格式见 2.1节中介绍。

在接下来的填写声明中,如果该字段没有特殊的规则声明,则不再对该字段进行一一讲解,接入方可参照标题示例,对字段填写内容进行理解和解析。

3.1 填写类目

【是否必填】是
【对应字段】category_id
【填写说明】
由于发布商品时,**必须**先指定一个叶子类目。从接口alibaba.icbu.category.get.new中获取国际站的类目树信息,返回结果中的字段leaf_category表明该类目是否是叶子类目,category_id字段是该类目的id。

3.2 填写商品类型

【对应字段】xml.market

【填写说明】
当前国际站商品分为询盘品和下单品,在线下单商品用 1 表示,询盘商品用 2 表示。

3.3 基础信息Basic Information

3.3.1 填写标题

【对应字段】xml.productTitle
【是否必填】是
【填写示例】

<field id="productTitle" name="Product name" type="input">
        <value>wang chen test api submit sourcing updateFields hah</value>
 </field>

父字段的regexRule适用于子字段。

<field id="productKeywords" name="Product Keyword" type="complex">
        <rules>
            <rule name="tipRule" value="&lt;div&gt;Please enter keywords that are similar to the product’s name (e.g. a synonym) or words that you think buyers might use to search for your product.&lt;/div&gt;&lt;div&gt; &lt;strong&gt;Notice:&lt;/strong&gt; Please enter keywords that comply with the &lt;a href=&quot;http://service.alibaba.com/ensupplier/faq_detail/13863829.htm?tracelog=ensupplier_ma_cw16&quot; target=&quot;_blank&quot;&gt;Alibaba.com Keyword Guidelines&lt;/a&gt;, and make sure that they are not &lt;a href=&quot;http://service.alibaba.com/ensupplier/faq_list/11117340.htm?tracelog=ensupplier_ma_cw17&quot; target=&quot;_blank&quot;&gt;prohibited items on Alibaba.com&lt;/a&gt;. All products referring to any &lt;a href=&quot;http://service.alibaba.com/ensupplier/faq_detail/13863839.htm?tracelog=ensupplier_ma_cw18&quot; target=&quot;_blank&quot;&gt;third party intellectual property&lt;/a&gt;, must obtain prior relevant authorization. Please note that any violation of these policies might lead to the removal of your listing(s) or even the suspension of your account.&lt;/div&gt;"/>
            <rule name="tipRule" value="For more information about brands, please click &lt;a target=&quot;_blank&quot; href=&quot;https://us-productposting.alibaba.com/product/search/brandNameSearch.htm&quot;&gt;here&lt;/a&gt; for more details.\n"/>
            <rule name="tipRule" value="Please fill in keywords with correct format: 'modifier words + product name + application scenario', e.g., ‘Red 8GB mp3 for sports’."/>
            <rule name="minInputNumRule" value="1" exProperty="include"/>
            <rule name="maxInputNumRule" value="3" exProperty="include"/>
            <rule name="requiredRule" value="true"/>
            <rule name="regexRule" value="[^\\x04-\\x80]+" exProperty="not include"/>
            <rule name="regexRule" value="\\w+(?:[\\-+.]\\w+)*@\\w+(?:[\\-.]\\w+)*\\.\\w+(?:[\\-.]\\w+)*" exProperty="not include"/>
            <rule name="regexRule" value="&lt;[^&gt;]+&gt;" exProperty="not include"/>
            <rule name="regexRule" value="[;:,,]+" exProperty="not include"/>
        </rules>
        <fields>
            <field id="productKeywords_0" name="Product Keyword" type="input">
                <rules>
                    <rule name="valueTypeRule" value="text"/>
                    <rule name="maxLengthRule" value="128" exProperty="include" unit="byte"/>
                    <rule name="tipRule" value="Please fill in keywords with correct format: 'modifier words + product name + application scenario', e.g., ‘Red 8GB mp3 for sports’."/>
                </rules>
            </field>
            <field id="productKeywords_1" name="Product Keyword" type="input">
                <rules>
                    <rule name="valueTypeRule" value="text"/>
                    <rule name="maxLengthRule" value="128" exProperty="include" unit="byte"/>
                    <rule name="tipRule" value="Please fill in keywords with correct format: 'modifier words + product name + application scenario', e.g., ‘Red 8GB mp3 for sports’."/>
                </rules>
            </field>
            <field id="productKeywords_2" name="Product Keyword" type="input">
                <rules>
                    <rule name="valueTypeRule" value="text"/>
                    <rule name="maxLengthRule" value="128" exProperty="include" unit="byte"/>
                    <rule name="tipRule" value="Please fill in keywords with correct format: 'modifier words + product name + application scenario', e.g., ‘Red 8GB mp3 for sports’."/>
                </rules>
            </field>
        </fields>
    </field>

【填写示例】:

<field id="productKeywords" name="Product Keyword" type="complex">
        <complex-value>
            <field id="productKeywords_0" type="input">
                <value>hello wangchen updateFields</value>
            </field>
            <field id="productKeywords_1" type="input">
                <value>hello wangchen updateFields2</value>
            </field>
        </complex-value>
</field>

2.3.3 填写商品分组

【对应字段】xml.productGroup
【是否必填】否
【填写说明】
productGroup也是一个complex字段,字段格式同关键词。需要注意的是当前商品分组最多到三级,因此该字段有三个子字段用来填写一级分组(xml.productGroup.first_group_id)、二级分组(xml.productGroup.second_group_id)、三级分组(xml.productGroup.third_group_id)。所有子字段的输入值均来自用户的产品分组id。

通过接口alibaba.icbu.product.group.get获取当前商家的分组信息,通过alibaba.icbu.product.group.add来新增产品分组。

接口 作用 说明文档
alibaba.icbu.product.group.get 分组信息获取 https://open.taobao.com/api.htm?docId=25299&docType=2
alibaba.icbu.product.group.add 增加商品分组 https://open.taobao.com/api.htm?docId=25300&docType=2

【填写示例】

<field id="productGroup" name="Product group" type="complex">
        <complex-value>
            <field id="third_group_id" type="input">
                <value>806400963</value>
            </field>
            <field id="first_group_id" type="input">
                <value>806382565</value>
            </field>
            <field id="second_group_id" type="input">
                <value>806510057</value>
            </field>
        </complex-value>
</field>

3.3.4 填写系统类目属性

【是否必填】不同的属性必填信息不同,以具体的xml文件中填写规则为准。
【对应字段】xml.icbuCatProp
【填写说明】一个类目下有哪些类目属性,由xml文件中的字段值示例。icbuCatProp是一个复合组件,复合组件的子组件,则是该类目下的所有需要填写的属性值。例如下面文件示例,需要填写的属性有 size,type等等。每个属性的可选值,则由字段的option值确定,用户只需要将option值的value填写到属性字段中。注意Option值中如果有-1的选项,则表示该值可以由用户手动输入,手动输入的属性值需存放在 属性value的inputValue中。

当属性字段的输入类型是input时,例如下面的Model Number属性,属性value的值必须填写负数,而且输入值放在属性value的inputValue中。

<field id=\"icbuCatProp\" name=\"Product feature\" type=\"complex\">
        <rules>
            <rule name=\"tipRule\" value=\"Please fill in accurate and complete product attributes, so that buyers quickly understand the product features.\n\"/>
        </rules>
        <fields>
            <field id=\"p-191284006\" name=\"Size\" type=\"singleCheck\">
                <options>
                    <option displayName=\"Large\" value=\"136466616\"/>
                    <option displayName=\"Small\" value=\"4329104\"/>
                </options>
            </field>
            <field id=\"p-191284229\" name=\"Type\" type=\"singleCheck\">
                <options>
                    <option displayName=\"Multi-Span Agricultural Greenhouses\" value=\"364946\"/>
                    <option displayName=\"Single-Span Agricultural Greenhouses\" value=\"364947\"/>
                    <option displayName=\"Solar Agricultural Greenhouses\" value=\"364948\"/>
                    <option displayName=\"Plastic Shed\" value=\"1875821079\"/>
                    <option displayName=\"Other\" value=\"-1\"/>
                </options>
            </field>
            <field id=\"p-191292367\" name=\"Cover Material\" type=\"singleCheck\">
                <options>
                    <option displayName=\"Film\" value=\"11273565\"/>
                    <option displayName=\"Glass\" value=\"3837345\"/>
                    <option displayName=\"PC Sheet\" value=\"413570031\"/>
                    <option displayName=\"Other\" value=\"3237720\"/>
                </options>
            </field>
            <field id=\"p-191284004\" name=\"Model Number\" type=\"input\">
                <rules>
                    <rule name=\"maxLengthRule\" value=\"50\" exProperty=\"include\" unit=\"byte\"/>
                </rules>
            </field>
            <field id=\"p-191286002\" name=\"Brand Name\" type=\"input\">
                <rules>
                    <rule name=\"maxLengthRule\" value=\"50\" exProperty=\"include\" unit=\"byte\"/>
                </rules>
            </field>
        </fields>
    </field>

【填写示例】

<field id="icbuCatProp" name="Product feature" type="complex">
        <complex-value>
            <field id="p-191284229" name="Type" type="singleCheck">
                <value inputValue="myType">-1</value>//自定义属性值
            </field>
          
            <field id="p-191284006" name="Size" type="input">
                <value inputValue="small">4329104</value>
            </field>
           
            <field id="p-191284004" name="Model Number" type="input">
                <value inputValue="333">-2</value> //输入属性值
            </field>
            
            <field id="p-191286002" name="Brand Name" type="input">
                <value inputValue="222">-1</value>
            </field>
        </complex-value>
    </field>

3.3.5 填写自定义属性

【是否必填】否
【对应字段】xml.customMoreProperty
【填写说明】
自定义属性最多填写10个,customeMoreProperty因此也有10个子字段,每个子字段标识一个自定义属性,
属性名填写在字段 propName ,属性值填写在valueName
【填写示例】

<field id="customMoreProperty" name="More Details" type="complex">
        <complex-value>
            <field id="customMoreProperty_0" type="complex">
                <complex-value>
                    <field id="valueName" type="input">
                        <value>3333</value>
                    </field>
                    <field id="propName" type="input">
                        <value>2222</value>
                    </field>
                </complex-value>
            </field>
            <field id="customMoreProperty_1" type="complex">
                <complex-value>
                    <field id="valueName" type="input">
                        <value>2222</value>
                    </field>
                    <field id="propName" type="input">
                        <value>3333</value>
                    </field>
                </complex-value>
            </field>
        </complex-value>
</field>

3.4 商品描述Product description

3.4.1 设置商品主图

【是否必填】是
【对应字段】xml.scImages
【阿里表单】
image.png
【填写说明】
表单支持最多上传六张商品图片,因此scImages字段也是一个complex字段,有6个子字段来分别填写六张图片的信息。每张图片信息均需要填写图片的url和id。

在设置商品图片的时候,先使用接口 alibaba.icbu.photobank.upload将图片上传到卖家的图片银行中,然后将返回结果里的图片url设置到image字段的value值中,并将图片id设置到fileId中。
如果卖家之前已经在图片银行里有发布图片,则可以用alibaba.icbu.photobank.list 获取客户图片url和id
【注意】

  1. 发布/更新商品使用的图片,都 必须是来自图片银行里的图片,通过product.get接口获取的商品主图url,无法直接用来发布商品。
接口 作用 说明文档
alibaba.icbu.product.group.get 图片银行图片上传 https://open.taobao.com/api.htm?docId=24463&docType=2
alibaba.icbu.product.group.add 国际站图片银行查询 https://open.taobao.com/api.htm?docId=24463&docType=2

3.4.2 设置商品详情

【是否必填】否
【对应字段】xml.productDescType = 商品详情类型 xml.superText = 普通详情字段
【阿里表单】
image.png
【填写说明】
当前国际站支持两种详情种类,普通编辑和智能编辑。普通编辑是将富文本html设置到superText字段,同时productDescType设置为2。

api只支持普通编辑类型的商品详情。

【填写示例】

<field id="productDescType" name="Product Detail" type="singleCheck">
        <value>2</value>
</field>
<field id="superText" name="Custom Description " type="input">
  	<value>
   			 <p>test</p>
  	</value>
</field>

3.5 交易信息Trade Information

3.5.1填写价格类型

【是否必填】是
【对应字段】
下单品时,填写字段xml.marketPrice,1=阶梯价 2=SKU价
询盘品时,填写字段xml.scPrice 1=阶梯价 2=FOB价
【填写说明】每种商品只能有一种价格类型。

3.5.2 填写阶梯价

【是否必填】商品价格类型设置为阶梯价时必填,其他情况则不能填写
【对应字段】xml.ladderPrice
【阿里表单】
image.png
【填写说明】阶梯价字段也是complex类型,包含四个子字段,分别表示每个阶梯,填写时最小一个阶梯,最大四个阶梯

<rules>
  <rule name="minInputNumRule" value="1" exProperty="include"/>
  <rule name="maxInputNumRule" value="4" exProperty="include"/>
</rules>

每个阶梯的格式也是complex类型,例如字段 ladderPrice_0,每个阶梯价填写由MOQ和价格组成。

<fields>
            <field id="ladderPrice_0" type="complex">
                <fields>
                    <field id="quantity" name="MOQ" type="input">
                        <rules>
                            <rule name="valueTypeRule" value="long"/>
                            <rule name="requiredRule" value="true"/>
                        </rules>
                    </field>
                    <field id="price" name="FOB Price" type="input">
                        <rules>
                            <rule name="valueTypeRule" value="double"/>
                            <rule name="requiredRule" value="true"/>
                            <rule name="minDecimalDigitsRule" value="0.01" exProperty="include"/>
                            <rule name="maxDecimalDigitsRule" value="9999999.99" exProperty="include"/>
                        </rules>
                    </field>
                </fields>
            </field>
           ...
           ...
</fields>

【填写示例】

<field id="ladderPrice" name="Quantity Price" type="complex">
        <complex-value>
            <field id="ladderPrice_0" type="complex">
                <complex-value>
                    <field id="quantity" type="input">
                        <value>2</value>
                    </field>
                    <field id="price" type="input">
                        <value>3.0000</value>
                    </field>
                </complex-value>
            </field>
        </complex-value>
</field>

3.5.3 填写FOB价

【是否必填】询盘品价格类型设置为FOB价时必填,其他情况则不能填写
【填写字段】xml.fob
【阿里表单】
image.png
【填写说明】
xml.fob.range_max = 价格最大值?
xml.fob.range_min = 价格最小值
xml.fob.unit_type = 价格单位 ,单位枚举值在options 规则里
xml.minOrderQuantity = 最小起订量
【填写示例】

<field id="fob" name="FOB Price\n" type="complex">
        <complex-value>
            <field id="range_min" type="input">
                <value>2.0</value>
            </field>
            <field id="range_max" type="input">
                <value>3.0</value>
            </field>
            <field id="unit_type" type="singleCheck">
                <value text="USD">1</value>
            </field>
        </complex-value>
 </field>
<field id="minOrderQuantity" name="MOQ\n" type="input">
        <value>2.0</value>
</field>

3.5.4 计量单位

【是否必填】是
【对应字段】xml.priceUnit
【填写说明】单位枚举值在options 规则里
【阿里表单】
image.png
【填写示例】

<field id="priceUnit" name="Unit" type="singleCheck">
        <value>4</value>
</field>

3.5.5 设置规格属性

【是否必填】根据具体属性字段里的requiredRule决定
【对应字段】xml.saleProp
【填写说明】规则属性是和商品类目相关的,叶子类目上有规格属性,商品才能设置规格属性,又称SKU属性。
一个类目下有哪些销售属性,具体参见xml文件中saleProp中的子段值。具体填写方式和系统属性是一致的,参见3.3.4

需要注意的是,如果sku的属性值要自定义,属性Value值必须是负数,而且多个自定义值不能重复。自定义值如果想上传图片,需存放在属性value里的img中,这里的图片需要从图片银行中选择,并将图片的url设置到其中。
【填写示例】

<field id="saleProp" name="Sales Property" type="complex">
        <complex-value>
            <field id="p-191286172" name="Size" type="multiCheck">
                <values>
                    <value inputValue="one size">4348586</value>
                    <value inputValue="XXL">28318</value>
                    <value img = "https://sc01.alicdn.com/kf/H795f4fc22f284e9384203a7a6b17cc64N/200042360/H795f4fc22f284e9384203a7a6b17cc64N.jpg" 
                           inputValue="myColor">-1</value>
                </values>
            </field>
            <field id="p-191288010" name="Color" type="multiCheck">
                <values>
                    <value inputValue="BROWN">3399503</value>
                </values>
            </field>
        </complex-value>
</field>

3.5.6 设置SKU信息

【是否必填】否
【对应字段】xml.sku
【阿里表单】
image.png
【填写说明】
xml.sku.price = sku价,只有在下单品且选中价格类型=sku价时填写才有效
xml.marketMinOrderQuantity = 最小起订量,只在SKU价时填写才有效

xml.sku.stock = 库存,只有在下单品时才有效,填写方式为列表
xml.sku.skuOuterId = sku编码?
xml.sku.skuId = sku的数据库id,编辑时填写,新发时不用填写
xml.sku.props = sku的销售属性组合,在上图中该字段应该填写 size: one size , color:Beige 这种属性组合值,每条sku的销售属性组合是唯一的。理论上当销售属性确定之后,所有可用的sku也确定了。例如上图中销售属性size有2个值,color有2个值,则所有可用的sku是两个销售属性值集合的笛卡尔积,也就是2x2=4。则每条sku的销售属性组合来自4个组合中的一种。

如果有某一条SKU客户不想展示,则填写sku值时忽略该组合即可,只给想填写的sku创建value对象(?)

库存填写说明:
srcValue = 库存的原始值,新发时填0,编辑时填商品的原来库存。
warehouseCode = 库存仓编码,默认国内仓,用户不需填写
44 = 库存新值。

<field id="skuStock" name="Quantity in stock" type="multiInput">
  <values>
    <value srcValue="0" warehouseCode="CN_LOCAL_01">44</value>
  </values>
</field>

【填写示例】

<field id="sku" name="" type="multiComplex">
        <complex-values>
            <field id="price" name="Price" type="input"/>
            <field id="skuStock" name="Quantity in stock" type="multiInput">
                <values>
                    <value srcValue="0" warehouseCode="CN_LOCAL_01">44</value>
                </values>
            </field>
            <field id="skuOuterId" name="sku code" type="input">
                <value>sku2</value>
            </field>
            <field id="skuId" name="" type="input">
                
            </field>
            <field id="props" name="" type="multiInput">
                <values>
                    <value propValueId="28318" propId="191286172" propName="p-191286172" propValueName="XXL">111:333;22,11</value>
                    <value propValueId="3399503" propId="191288010" propName="p-191288010" propValueName="Brown">111:333;22,11</value>
                </values>
            </field>
        </complex-values>
        <complex-values>
            <field id="price" name="Price" type="input"/>
            <field id="skuStock" name="Quantity in stock" type="multiInput">
                <values>
                    <value srcValue="0" warehouseCode="CN_LOCAL_01">33</value>
                </values>
            </field>
            <field id="skuOuterId" name="sku code" type="input">
                <value>sku1</value>
            </field>
            <field id="skuId" name="" type="input">
            </field>
            <field id="props" name="" type="multiInput">
                <values>
                    <value propValueId="4348586" propId="191286172" propName="p-191286172" propValueName="Free">111:333;22,11</value>
                    <value propValueId="3399503" propId="191288010" propName="p-191288010" propValueName="Brown">111:333;22,11</value>
                </values>
            </field>
        </complex-values>
    </field>

3.5.7 填写付款方式 - 询盘品特有

【是否必填】否
【对应字段】xml.paymentMethod
【阿里表单】
image.png
【填写说明】系统中预设了一些付款方式,填写在xml.paymentMethod.predefined_method,付款方式枚举值在options 规则里。用户也可以自己定义付款方式,只能定义一种,填写在字段?xml.paymentMethod.self_defined_0
【填写示例】

<field id="paymentMethod" name="Payment Options\n" type="complex">
        <complex-value>
            <field id="predefined_method" type="multiCheck">
                <values>
                    <value>L/C</value>
                    <value>D/A</value>
                </values>
            </field>
            <field id="self_defined_0" type="input">
                <value>dddd</value>
            </field>
        </complex-value>
 </field>

3.5.8 填写售卖方式 – 下单品特有

【是否必填】商品类型是下单品是必填,其他情况填写无效
【对应字段】xml.saleType :?是否按批售卖 , xml.batchNum: 按批售卖的具体每批数量
【阿里表单】

image.png
【填写示例】

<field id="saleType" name="Sale Type\n" type="singleCheck">
        <value>batch</value>
</field>
<field id="batchNum" name="1 batch equals\n" type="input">
  			<value>1000</value>
</field>

3.5.9 样品信息 – 下单品特有

【是否必填】否
【对应字段】
xml.marketSample = 是否支持样品
xml.marketSamplingQuantity = 样品最大订购量
xml.marketSamplingPrice = 样品价格
xml.marketSamplingDescription = 样品描述
【阿里表单】
image.png
【填写示例】

<field id="marketSample" name="Sample service settings" type="singleCheck">
        <value>1</value>
    </field>
    <field id="marketSamplingQuantity" name="Maximum samples per time" type="input">
        <value>2</value>
    </field>
    <field id="marketSamplingPrice" name="Sample price" type="input">
        <value>3.0</value>
    </field>
    <field id="marketSamplingDescription" name="Sample description" type="input">
        <value>33333333333</value>
    </field>

3.6 物流信息Logistics Information

3.6.1 发货周期

【是否必填】询盘品选填,下单品必填
【对应字段】xml.ladderPeriod
【阿里表单】
image.png
【填写示例】

<field id="ladderPeriod" name="Shipping" type="complex">
        <complex-value>
            <field id="ladderPeriod_0" type="complex">
                <complex-value>
                    <field id="quantity" type="input">
                        <value>2</value>
                    </field>
                    <field id="day" type="input">
                        <value>3</value>
                    </field>
                </complex-value>
            </field>
        </complex-value>
</field>

3.6.2 发货港口 - 询盘品特有

【是否必填】否
【对应字段】xml.port?
【填写示例】

<field id="port" name="Shipping port" type="input">
        <value>Shanghai</value>
</field>

3.6.2 供货能力填写 - 询盘品特有

【是否必填】否
【对应字段】xml.supply.supply_number =?供货数量,xml.supply.quantity_unit =??供货数量单位,单位枚举值见option字段,xml.supply.time_unit =?供货周期单位,周期单位枚举值见option字段
【阿里表单】
image.png
【填写示例】

<field id="supply" name="Quantities &amp; units " type="complex">
        <complex-value>
            <field id="quantity_unit" type="singleCheck">
                <value>26</value>
            </field>
            <field id="time_unit" type="singleCheck">
                <value>Day</value>
            </field>
            <field id="supply_number" type="input">
                <value>333.0</value>
            </field>
        </complex-value>
</field>

3.6.3 物流模式 – 询盘品特有

【是否必填】是
【对应字段】xml.logisticsMode
【阿里表单】
image.png
【填写说明】
该功能目前还在灰度中,客户如需使用,先申请加入灰度测试。
【填写示例】

<field id="logisticsMode" name="Logistics mode" type="multiCheck">
        <values>
            <value>2</value>
            <value>1</value>
        </values>
 </field>

3.6.4 快递信息填写 - 下单品特有

【是否必填】是
【对应字段】
xml.pkgMeasure =?包装尺寸 单位是厘米
xml.pkgWeight = 包装毛重 单位是kg
xml.shippingTemplateId = 物流模板id ,商家下所有可选物流模板值,在option字段里

【填写示例】

<field id="shippingTemplateId" name="Shipping Template" type="singleCheck">
        <value>2008472002</value>
</field>
<field id="pkgMeasure" name="Dimensions" type="complex">
        <complex-value>
            <field id="width" type="input">
                <value>30</value>
            </field>
            <field id="length" type="input">
                <value>20</value>
            </field>
            <field id="height" type="input">
                <value>40</value>
            </field>
        </complex-value>
</field>
<field id="pkgWeight" name="Gross Weight\n" type="input">
  				<value>80.0</value>
</field>

3.6.5 物流属性 –下单品特有(2023.02.20更新)

【是否必填】是
【对应字段】

<field id=\"logisticsProperty\" name=\"Logistics attribute\" type=\"multiCheck\">

可选项见对应字段的options选项,线上支持的属性集合如下(可能会更新):

<options><option displayName=\"纯电池:单块电池≤100Wh\" value=\"battery.battery.oneLessHundredWh\"/><option displayName=\"纯电池:单块电池>100Wh\" value=\"battery.battery.oneMoreHundredWH\"/><option displayName=\"内置电池(非锂电池):单块电池≤100Wh\" value=\"battery_0_0\"/><option displayName=\"内置电池(非锂电池):单块电池&gt;100Wh\" value=\"battery_1_1\"/><option displayName=\"内置电池(锂电池):单块电池≤100Wh\" value=\"battery.builtinBatteryLithium.oneLessHundredWh\"/><option displayName=\"内置电池(锂电池):单块电池&gt;100Wh\" value=\"battery.builtinBatteryLithium.oneMoreHundredWH\"/><option displayName=\"配套电池(非锂电池):单块电池≤100Wh\" value=\"battery_2_2\"/><option displayName=\"配套电池(非锂电池):单块电池&gt;100Wh\" value=\"battery_3_3\"/><option displayName=\"配套电池(锂电池):单块电池≤100Wh\" value=\"battery.attachBatteryLithium.oneLessHundredWh\"/><option displayName=\"配套电池(锂电池):单块电池&gt;100Wh\" value=\"battery.attachBatteryLithium.oneMoreHundredWH\"/><option displayName=\"油状化妆品-不含酒精:单个商品≤100ml\" value=\"liquid.oilMakeupNonAlcohol.oneLessHundredMl\"/><option displayName=\"油状化妆品-不含酒精:单个商品&gt;100ml\" value=\"liquid_0\"/><option displayName=\"膏状化妆品-不含酒精:单个商品≤100ml\" value=\"liquid.creamMakeupNonAlcohol.oneLessHundredMl\"/><option displayName=\"膏状化妆品-不含酒精:单个商品&gt;100ml \" value=\"liquid_2\"/><option displayName=\"水状化妆品-不含酒精:单个商品≤100ml\" value=\"liquid.waterMakeupNonAlcohol.oneLessHundredMl\"/><option displayName=\"水状化妆品-不含酒精:单个商品&gt;100ml \" value=\"liquid_4\"/><option displayName=\"食品饮料:非充气包装零食\" value=\"special.foodAndBeverage.inflatedSnackBag\"/><option displayName=\"食品饮料:充气包装零食\" value=\"food_beverage_0\"/><option displayName=\"食品饮料:生鲜\" value=\"food_beverage_2\"/><option displayName=\"食品饮料:饮料\" value=\"food_beverage_1\"/><option displayName=\"餐刀:未开刃\" value=\"special.dinnerKnives.unedged\"/><option displayName=\"餐刀:开刃\" value=\"special.dinnerKnives.edged\"/></options>


历史更新:

2023.02.22之前为单选项即SingleCheck类型,之后升级为MultiCheck类型支持物流属性多选,即对应field的value从单个变成了List(注意普货与其他物流属性冲突不可同时选择,否则影响后续运费逻辑)。
物流属性升级后,调用alibaba.icbu.product.schema.render渲染出的xml中会新增一个“valid”字段,valid字段为true则代表该物流属性为有效状态,valid为false则代表该属性已经失效(为历史属性),而发品时会校验**至少要填写一个有效的物流属性**。举例:原本商品中带有的物流属性为property1,而物流团队更新了物流属性后property1这个属性失效了,那么alibaba.icbu.product.schema.render接口获取到该属性的valid = false,如果只有这一个属性,会导致发品失败,请万般注意

3.7. 特殊服务Featured services & others

3.7.1 定制服务

【是否必填】否
【对应字段】xml.productLightCustom = 是否支持轻定制 xml.customizedServices = 定制的具体内容
【阿里表单】
image.png
【填写说明】
定制信息对象数据,custom_type字段设置定制项的名称,当前系统预设的定制项名称有三种系统预设值:Customized logo,Customized packaging,Graphic customization,都在字段的Option字段里。需要注意的是custom_type字段的类型是虽然是单选,但是也可以自己自定义定制类型。规则是表示当前值可以自定义。

?quantity?设置定制项的起订量。

<field id="custom_type" type="singleCheck">
  <rules>
    <rule name="valueTypeRule" value="text"/>
    <rule name="requiredRule" value="false"/>
  </rules>
  <options>
    <option displayName="Customized logo" value="Customized logo"/>
    <option displayName="Customized packaging" value="Customized packaging"/>
    <option displayName="Graphic customization" value="Graphic customization"/>
    <option displayName="other" value="-1"/>
  </options>
</field>

【填写示例】

<field id="customizedServices" name="Custom Content" type="complex">
        <complex-value>
            <field id="customizedServices_0" type="complex">
                <complex-value>
                    <field id="quantity" type="input">
                        <value>3</value>
                    </field>
                    <field id="custom_type" type="singleCheck">
                        <value>Customized packaging</value>
                    </field>
                </complex-value>
            </field>
            <field id="customizedServices_1" type="complex">
                <complex-value>
                    <field id="quantity" type="input">
                        <value>2</value>
                    </field>
                    <field id="custom_type" type="singleCheck">
                        <value>self custom</value>
                    </field>
                </complex-value>
            </field>
        </complex-value>
    </field>

3.7.2 电商一站式 & 生产可视化

【是否必填】否
【对应字段】
xml.produceVisualization = 生产可视化
xml.ecIntegration = 电商一站式
【阿里表单】
image.png
【填写示例】

<field id="produceVisualization" name="Production View Service" type="singleCheck">
        <value>2</value>
    </field>
    <field id="ecIntegration" name="One-Stop Service" type="singleCheck">
        <value>2</value>
    </field>

三. 发布RTS品

rts品的判定条件包括三个:

  1. 商品是下单品。这个提交需要用户将商品类型设置为下单品。设置商品类型 参见2.2
  2. 有明确的运费。这一个条件需要用户设置合理的运费模板,并将运费模板设置到商品中。设置运费模板 参见 3.4.4
  3. 最小起订量的交期小于15天。 商品上设置了最小起订量,同时设置了发货周期,当前发货周期设置是根据起订量范围而设置的,如果商品的最小起订量,符合某个发货周期的时间范围,并且该发货周期小于等于15天,则满足该条件。例如最小起订量是10,而发货周期设置为 ?起订量 < 8, 发货期 = 10;起订量 >= 8, 发货期 = 20。由于最小起订量是10,对应的发货周期是20,则不满足条件,相反,如果最小起订量是5,对应的发货期则是10,满足条件。设置发货周期 参见 3.4.1

四 接口对接实战

4.1 Schema Java SDK使用说明

使用新的商品发布体系,可以借助?Schema SDK 来帮助设置xml中的数据。当前只有java版本有这个工具类,其他语言可以借助自己语法体系里的xml解析工具,来达到同样的目的。在解析xml数据时,接入方需要关注fieldId,该属性唯一标识一个需要填写的字段,其次关注Type,该属性标识这个字段是多选、单选、可输入还是复杂类型,不同类型的字段,设置字段值的方式不同,最后应该关注Rule子节点,不同的rule标明了字段的校验规则,例如必填、非法字符校验等。
以下为Java SDK 设置数据的示例。

  • input类型
Map<String, Field> fieldMap = SchemaReader.readXmlForMap(file);
InputField priceField = (InputField) fieldMap.get("price");
priceField.setValue("20.00");

isv从xml文件中获取field的map,再根据field的id取出field,用field的get方法可以获取field中各个属性和规则的信息,最后只需要调用setValue方法就可以对field设置返回值了。

  • multiInput类型
Map<String, Field> fieldMap = SchemaReader.readXmlForMap(file);
MultiInputField itemTagField = (MultiInputField) fieldMap.get("itemTag");
itemTagField.addValue("t1");
itemTagField.addValue("t2");
itemTagField.addValue("t3");
  • singleCheck类型
Map<String, Field> fieldMap = SchemaReader.readXmlForMap(file);
SingleCheckField freightPayerField = (SingleCheckField) fieldMap.get("freightPayer");
freightPayerField.setValue("seller");
  • multiCheck类型
Map<String, Field> fieldMap = SchemaReader.readXmlForMap(file);
MultiCheckField sellerCidsField = (MultiCheckField) fieldMap.get("seller_cids");
sellerCidsField.addValue("410132580");
sellerCidsField.addValue("二级二级");
  • complex类型
Map<String, Field> fieldMap = SchemaReader.readXmlForMap(file);
ComplexField addressField = (ComplexField) fieldMap.get("address");
ComplexValue complexValue = new ComplexValue();
complexValue.setSingleCheckFieldValue("country", new Value("1"));
complexValue.setSingleCheckFieldValue("province", new Value("3"));
complexValue.setSingleCheckFieldValue("city", new Value("3"));
addressField.setComplexValue(complexValue);
  • multiComplex类型
Map<String, Field> fieldMap = SchemaReader.readXmlForMap(file);
MultiComplexField skuField = (MultiComplexField) fieldMap.get("sku");
ComplexValue complexValue1 = new ComplexValue();
complexValue1.setSingleCheckFieldValue("prop_1627207", new Value("3232483"));
complexValue1.setSingleCheckFieldValue("prop_20509", new Value("28381"));
complexValue1.setInputFieldValue("price", "10.00");
ComplexValue complexValue2 = new ComplexValue();
complexValue2.setSingleCheckFieldValue("prop_1627207", new Value("3232484"));
complexValue2.setSingleCheckFieldValue("prop_20509", new Value("28381"));
complexValue2.setInputFieldValue("price", "15.00");
skuField.addComplexValue(complexValue1);
skuField.addComplexValue(complexValue2);

4.2 Schema体系使用说明


Schema体系的top接口调用方式统一,固定模式为先调用读接口获取schema 规则xml,使用Schema SDK读取规则xml,通过readXmlForList拿到一个List,然后调用readXmlForMap方法读取出一个map,map的key就是FieldId,然后调用sdk中setValue的方法给每一个Field设置Value,完成所有Field的数据组装后,通过writeParamXmlString方法生成商品信息xml生成xml,然后调用对应的写接口完成操作。
针对更新商品标题为例:(JAVA伪代码,仅用于说明调用逻辑)

简单示例

String sessionKey = “该商品对应卖家的sessionKey”;
Long itemId = 40905418326L;
String xmlData = '<?xml version="1.0" encoding="UTF-8"?><itemParam><field id="update_fields" name="更新字段列表" type="multiCheck"><values><value>title</value><value>title</value></values></field></itemParam>';
TaobaoClient client=new DefaultTaobaoClient(url, appkey, secret);
TmallItemIncrementUpdateSchemaGetRequest req=new TmallItemIncrementUpdateSchemaGetRequest();
req.setItemId(itemId);
req.setXmlData(xmlData);
TmallItemIncrementUpdateSchemaGetResponse response = client.execute(req , sessionKey);
String xmlStirng = response.getUpdateItemResult();
List<Field> fieldList = SchemaReader.readXmlForList(xmlStirng);
    /**
     * 对fieldList进行各种修改操作数据组装
     */
String addXml = SchemaWriter.writeParamXmlString(fieldList);
TmallItemSchemaIncrementUpdateRequest addReq = new TmallItemSchemaIncrementUpdateRequest();
addReq.setItemId(itemId);
addReq.setXmlData(addXml);
TmallItemSchemaIncrementUpdateResponse updateRes = client.execute(updateReq , sessionKey);

4.3 Schema体系对接思路



在schema体系的对接中需要调整以前的思路,需要关注三点:
1 变更检测
由于业务的变化速度非常快,开发者实现一个变更检测的功能,对于商家来说,每天定期拉取商家对应类目下规则,比较xml差异,根据差异进行业务处理的调整;
2 动态映射
开发者需要针对每一个商家实现一个动态映射的能力,将本地数据与线上返回的xml结构的元素进行一一映射,改变以前的写死参数的方式,这是接入schema体系最重要的事情
3 关注field的type
开发者在实现时,应该考虑的是field的type和rule,关注不同type的field的处理方式和不同规则的前置校验和透出,而业务字段则由动态映射能力去处理,例如某些字段的type从singleCheck升级为MultiCheck类型,大家的实现要具备一定的灵活性

五 新发demo

使用类目333发布,注意demo中的图片需要替换成商家自己的图片

<itemSchema>
 
  <field id="productTitle" name="Product name" type="input">
      <value>wang chen test api submit sourcing</value>
  </field>
  <field id="scImages" name="Product Photo" type="complex">
      <complex-value>
          <field id="scImages_0" type="input">
              <value fileId="4425871434">https://sc02.alicdn.com/kf/Ha7d031ffcb2443f2929693011e3df2d2H/200042360/Ha7d031ffcb2443f2929693011e3df2d2H.jpg</value>
          </field>
      </complex-value>
  </field>
  <field id="icbuCatProp" name="商品属性" type="complex">
      <complex-value>
          <field id="p-200000446" type="singleCheck">
              <value inputValue="knee-length">283930606</value>
          </field>
          <field id="p-200000329" type="singleCheck">
              <value inputValue="PRINT">7336907</value>
          </field>
          <field id="p-200000876" type="singleCheck">
              <value inputValue="Floral Print">109932653</value>
          </field>
          <field id="p-210194333" type="singleCheck">
              <value inputValue="Trumpet / Mermaid">1875814901</value>
          </field>
          <field id="p-100002012" type="singleCheck">
              <value inputValue="SATIN">6133696</value>
          </field>
          <field id="p-100002013" type="multiCheck">
              <values>
                  <value inputValue="breathable">42283793</value>
              </values>
          </field>
          <field id="p-200000364" type="singleCheck">
              <value inputValue="O-Neck">1875812521</value>
          </field>
          <field id="p-200000363" type="singleCheck">
              <value inputValue="Dropped">762078802</value>
          </field>
          <field id="p-191284183" type="singleCheck">
              <value inputValue="short sleeve">98172026</value>
          </field>
          <field id="p-100007008" type="singleCheck">
              <value inputValue="In-stock Items">417552495</value>
          </field>
          <field id="p-210192633" type="singleCheck">
              <value inputValue="CASUAL">4183079</value>
          </field>
          <field id="p-210202006" type="singleCheck">
              <value inputValue="short">6111186</value>
          </field>
          <field id="p-210202532" type="multiCheck">
              <values>
                  <value inputValue="OTHER">4</value>
              </values>
          </field>
          <field id="p-191284014" type="singleCheck">
              <value inputValue="Spandex / Polyester">676224672</value>
          </field>
          <field id="p-210194507" type="singleCheck">
              <value inputValue="summer">3455309</value>
          </field>
          <field id="p-191284169" type="singleCheck">
              <value inputValue="printed">8665793</value>
          </field>
          <field id="p-230797472" type="singleCheck">
              <value inputValue="support">6212099</value>
          </field>
      </complex-value>
  </field>
  <field id="productKeywords" name="Product Keyword" type="complex">
      <complex-value>
          <field id="productKeywords_0" type="input">
              <value>hello</value>
          </field>
          <field id="productKeywords_1" type="input">
              <value>hello</value>
          </field>
      </complex-value>
  </field>
  <field id="port" name="Shipping port" type="input">
      <value>Shanghai</value>
  </field>
  <field id="wholeSalePkgDesc" name="Packaging Description" type="input">
      <value>ddddddd</value>
  </field>
  <field id="ladderPeriod" name="Shipping" type="complex">
      <complex-value>
          <field id="ladderPeriod_0" type="complex">
              <complex-value>
                  <field id="quantity" type="input">
                      <value>2</value>
                  </field>
                  <field id="day" type="input">
                      <value>3</value>
                  </field>
              </complex-value>
          </field>
      </complex-value>
  </field>
  <field id="priceUnit" name="Unit" type="singleCheck">
      <value>27</value>
  </field>
  <field id="paymentMethod" name="Payment Options\n" type="complex">
      <complex-value>
          <field id="predefined_method" type="multiCheck">
              <values>
                  <value>L/C</value>
                  <value>D/A</value>
              </values>
          </field>
          <field id="self_defined_0" type="input">
              <value>dddd</value>
          </field>
      </complex-value>
  </field>
  <field id="logisticsMode" name="Logistics mode" type="multiCheck">
      <values>
          <value>2</value>
          <value>1</value>
      </values>
  </field>
  <field id="fob" name="FOB Price\n" type="complex">
      <complex-value>
          <field id="range_min" type="input">
              <value>2.0</value>
          </field>
          <field id="range_max" type="input">
              <value>3.0</value>
          </field>
          <field id="unit_type" type="singleCheck">
              <value text="USD">1</value>
          </field>
      </complex-value>
  </field>
  <field id="supply" name="Quantities &amp; units " type="complex">
      <complex-value>
          <field id="quantity_unit" type="singleCheck">
              <value>26</value>
          </field>
          <field id="time_unit" type="singleCheck">
              <value>Day</value>
          </field>
          <field id="supply_number" type="input">
              <value>333.0</value>
          </field>
      </complex-value>
  </field>
  <field id="market" name="Type of product" type="singleCheck">
      <value>2</value>
  </field>
  <field id="scPrice" name="Price Setting\n" type="singleCheck">
      <value>2</value>
  </field>
  <field id="minOrderQuantity" name="MOQ\n" type="input">
      <value>2.0</value>
  </field>
  <field id="productDescType" name="Product Detail" type="singleCheck">
      <value>2</value>
  </field>

</itemSchema>

六 常见问题(2023.2.20更新)


根据日常中ISV反馈频率较高的问题,将商品发布接口相关的咨询整理如下,部分知识确认或者xml中field含义的信息暂不放在此处,请参考前述发布接口使用部分,如果仍不清楚,请在群内联系**景又**反馈

1.物流属性和运费(物流)模板有什么区别?
● 物流属性对应的组件是logisticsProperty,也就是带电、带磁、普货等属性
● 运费模板对应组件的shippingTemplateId,是客户自己创建的,包括发货国、快递线路等自定义配置
如果发品接口遇到关于上述组件相关报错信息,那么一般都会包括property、Template等错误信息,可以对号入座,自行排查


2.CHK_STEP_CATEGORY_QUALITY_MINSIZE_ERROR-该类目下最小起订量必须不少于xx
2022年10月份行业做了moq严肃化升级,出现该报错证明行业运营方增加了moq的最小限制,请酌情修改moq


3.CHK_IMAGE_FILE_COUNT_EXCEED-主图数量超过限制
目前国际站发布商品最多允许上传6张主图,请减少主图数量

4.CHK_STEP_LADDER_PERIOD_QUANTITY_EMPTY_ERROR-阶梯交期数量不能为空
对应的后台组件如下,属于必填组件
image

5.CHK_STEP_LADDER_PERIOD_VALUE_ERROR-发货期数量必须由小到大
对应的后台校验如下,阶梯交期每一阶梯对应的起订量必须是递增的
image

6.PUB_BIZCHECK_SALE_PROPERTY_VALEU_IS_NOT_EXPECT-属性的值错误
一般是某些类目属性设置的valueId不在提供的选项当中,可以以此为标准进行检查

7.PUB_BIZCHECK_SKU_PRICE-无效的SKU价格
检查对应的sku信息,是否部分sku的价格设置成了负数或者0

8.PUB_BIZCHECK_CAT_PUB_RESTRICT-该类目不在经营类目范围内,不可发布商品
经营类目项目限制,商家只能在自己经营类目下的发布、编辑商品,属于正常业务逻辑

9.PUB_BIZCHECK_CAT_ID_NOTEXIST-类目不能为空、PUB_BIZCHECK_CAT_DATA_NOTEXIST-类目不存在或已失效
发品时选择的catId为空或者非法,catId是可枚举的,并不是随意填写的数字

10.PUB_BIZCHECK_SUSPICIOUS-禁限售违规
一般是店铺被禁限售处罚了,导致整个店铺无法进行发品,请联系客户到后台查看自己的违规记录

**11.PUB_BIZCHECK_COMP_PROMOTION_LOCK_ERROR 商品在活动中不能编辑
说明该商品参加了网站的促销、折扣等活动,暂时不能编辑该商品,属于业务逻辑

**12.PUB_BIZCHECK_SALE_PROPERTY_IMAGE_ERROR 属性的图片出错
商家自定义了属性图片,但是图片的链接不符合格式,导致发品失败

FAQ

关于此文档暂时还没有FAQ
返回
顶部