文档中心 > API类目 > 菜鸟末端商业

cainiao.cntec.supplier.item.savemainitem (保存主商品信息)

创建或更新货品池主商品信息

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
main_item_sync MainItemSyncDto 必须 请求信息
  • └ feature
  • String
  • 可选
  • {"product_item":"商品名称","product_quantity":"商品数量"}
  • 扩展字段 json格式
  • └ production_country
  • String
  • 可选
  • 国产
  • 进口/国产
  • └ item_height
  • String
  • 可选
  • 30
  • 高度,单位cm
  • └ item_width
  • String
  • 可选
  • 20
  • 宽度,单位cm
  • └ item_length
  • String
  • 可选
  • 10
  • 长度,单位cm
  • └ storage_conditions
  • String
  • 可选
  • 常温
  • 存储温度 常温,冷藏,冷冻
  • └ weight
  • String
  • 可选
  • 500
  • 重量,单位克
  • └ tax
  • String
  • 可选
  • 0.01
  • 税率,最大为1
  • └ bill_content
  • String
  • 可选
  • 开票内容
  • 开票内容
  • └ life_time
  • String
  • 可选
  • 10
  • 保质期,单位天
  • └ barcode
  • String
  • 可选
  • 条形码
  • 条形码
  • └ video_material
  • String
  • 可选
  • 供应商素材视频URL
  • 供应商素材视频
  • └ package_method
  • String
  • 可选
  • 包装方式
  • 包装方式
  • └ outer_brand_name
  • String
  • 可选
  • 品牌名称
  • 外部品牌名称
  • └ outer_brand_id
  • String
  • 可选
  • 123123
  • 外部品牌ID
  • └ last_level_category_id
  • String
  • 必须
  • 123123
  • 五级外部分类id
  • └ last_level_category_name
  • String
  • 必须
  • RT的部门
  • 五级外部分类名称
  • └ fourth_level_category_id
  • String
  • 必须
  • 123123
  • 四级外部分类id
  • └ fourth_level_category_name
  • String
  • 必须
  • RT的部门
  • 四级外部分类名称
  • └ third_level_category_id
  • String
  • 必须
  • 123123
  • 三级外部分类id
  • └ third_level_category_name
  • String
  • 必须
  • RT的部门
  • 三级外部分类名称
  • └ second_level_category_id
  • String
  • 必须
  • 123123
  • 二级外部分类id
  • └ second_level_category_name
  • String
  • 必须
  • RT的部门
  • 二级外部分类名称
  • └ first_level_category_id
  • String
  • 必须
  • 121212
  • 一级外部分类id
  • └ first_level_category_name
  • String
  • 必须
  • RT的部门
  • 一级外部分类名称
  • └ item_description
  • String
  • 必须
  • <p><img src="https://img.alicdn.com/imgextra/i1/2074370454/O1CN011FDyPREtcDfeD3N_!!2074370454-0-communitygroup.jpg" align="absmiddle"> <img src="https://img.alicdn.com/imgextra/i4/2074370454/O1CN011FDyPREtcDiCVUx_!!2074370454-0-communitygroup.jpg" align="absmiddle"> </p>
  • 商品文描
  • └ main_image_url
  • String
  • 必须
  • ["https://img02.fn-mart.com//pic/5ae8133d4e2bc4458c15/K282nn7n_TLMKlVgXn/1xoamRJy3GdaZa/CsmRsVjkPMCAPFzYAAGNFNNMs0I098.jpg","https://img02.fn-mart.com//pic/bd661342ad291bac0801/K28TTT1z_zCMBdugcz/7xeamRoGuRdyWa/CsmRs1z3OBiAOoSUAAMt5mRF2bo929.jpg","https://img02.fn-mart.com//pic/d5a41342ad211bac2dc8/h2Hn22szD2CgKMZMJn/5YeaeGO9OaCGCa/CsmRtFz3OBqAN4WbAAHdSdpS9Q4427.jpg"]
  • 商品主图
  • └ sell_points
  • String
  • 可选
  • 轻便
  • 商品卖点
  • └ specifications
  • String
  • 必须
  • 100g/袋
  • 商品规格
  • └ item_title
  • String
  • 必须
  • 香蕉
  • 商品标题
  • └ out_item_id
  • String
  • 必须
  • 123123
  • 外部供应商商品ID
  • └ supplier_code
  • String
  • 可选
  • DRF
  • 供应商编码
  • └ modified_time
  • Number
  • 必须
  • 1619682741556
  • 更新时间戳

响应参数

名称 类型 示例值 描述
result Result 接口返回model
  • └ error_msg
  • String
  • "参数错误"
  • 错误信息
  • └ model
  • Boolean
  • true
  • 请求结果信息
  • └ err_code
  • String
  • 001
  • 错误码
  • └ success
  • Boolean
  • true
  • 是否成功

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
CainiaoCntecSupplierItemSavemainitemRequest req = new CainiaoCntecSupplierItemSavemainitemRequest();
CainiaoCntecSupplierItemSavemainitemRequest.MainItemSyncDto obj1 = new CainiaoCntecSupplierItemSavemainitemRequest.MainItemSyncDto();
obj1.setFeature("{\"product_item\":\"商品名称\",\"product_quantity\":\"商品数量\"}");
obj1.setProductionCountry("国产");
obj1.setItemHeight("30");
obj1.setItemWidth("20");
obj1.setItemLength("10");
obj1.setStorageConditions("常温");
obj1.setWeight("500");
obj1.setTax("0.01");
obj1.setBillContent("开票内容");
obj1.setLifeTime("10");
obj1.setBarcode("条形码");
obj1.setVideoMaterial("供应商素材视频URL");
obj1.setPackageMethod("包装方式");
obj1.setOuterBrandName("品牌名称");
obj1.setOuterBrandId("123123");
obj1.setLastLevelCategoryId("123123");
obj1.setLastLevelCategoryName("RT的部门");
obj1.setFourthLevelCategoryId("123123");
obj1.setFourthLevelCategoryName("RT的部门");
obj1.setThirdLevelCategoryId("123123");
obj1.setThirdLevelCategoryName("RT的部门");
obj1.setSecondLevelCategoryId("123123");
obj1.setSecondLevelCategoryName("RT的部门");
obj1.setFirstLevelCategoryId("121212");
obj1.setFirstLevelCategoryName("RT的部门");
obj1.setItemDescription("<p><img src=\"https://img.alicdn.com/imgextra/i1/2074370454/O1CN011FDyPREtcDfeD3N_!!2074370454-0-communitygroup.jpg\" align=\"absmiddle\"> <img src=\"https://img.alicdn.com/imgextra/i4/2074370454/O1CN011FDyPREtcDiCVUx_!!2074370454-0-communitygroup.jpg\" align=\"absmiddle\"> </p>");
obj1.setMainImageUrl("[\"https://img02.fn-mart.com//pic/5ae8133d4e2bc4458c15/K282nn7n_TLMKlVgXn/1xoamRJy3GdaZa/CsmRsVjkPMCAPFzYAAGNFNNMs0I098.jpg\",\"https://img02.fn-mart.com//pic/bd661342ad291bac0801/K28TTT1z_zCMBdugcz/7xeamRoGuRdyWa/CsmRs1z3OBiAOoSUAAMt5mRF2bo929.jpg\",\"https://img02.fn-mart.com//pic/d5a41342ad211bac2dc8/h2Hn22szD2CgKMZMJn/5YeaeGO9OaCGCa/CsmRtFz3OBqAN4WbAAHdSdpS9Q4427.jpg\"]");
obj1.setSellPoints("轻便");
obj1.setSpecifications("100g/袋");
obj1.setItemTitle("香蕉");
obj1.setOutItemId("123123");
obj1.setSupplierCode("DRF");
obj1.setModifiedTime(1619682741556L);
req.setMainItemSync(obj1);
CainiaoCntecSupplierItemSavemainitemResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<cainiao_cntec_supplier_item_savemainitem_response>
    <result>
        <error_msg>&quot;参数错误&quot;</error_msg>
        <model>true</model>
        <err_code>001</err_code>
        <success>true</success>
    </result>
</cainiao_cntec_supplier_item_savemainitem_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>

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部