文档中心 > API类目 > 信息平台-采购

alibaba.ant.pur.product.save (批量新增产品)

批量新增产品

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
access_product_dtos AccessProductDto 必须 产品对象
  • └ brand_id
  • Number
  • 可选
  • 1
  • 品牌id
  • └ brand_name
  • String
  • 可选
  • 1
  • 品牌名称
  • └ buyer_work_no
  • String
  • 可选
  • 1
  • 采购员
  • └ catalog_category_id
  • Number
  • 可选
  • 1
  • 品类id
  • └ category_code
  • String
  • 可选
  • 1
  • 品类编码
  • └ category_id
  • Number
  • 可选
  • 1
  • 采购类别
  • └ category_use_id
  • Number
  • 可选
  • 21312
  • 采购用途
  • └ data_source
  • String
  • 必须
  • SN-TEST
  • 来源
  • └ front_category_id
  • Number
  • 可选
  • 1
  • 前台类目
  • └ id
  • Number
  • 可选
  • 1
  • id
  • └ img_storage_type
  • String
  • 可选
  • 1
  • 图片存储方式
  • └ img_url_list
  • String []
  • 可选
  • 1
  • 图片列表
  • └ mall_url
  • String
  • 可选
  • https://XXX
  • 产品跳转链接
  • └ order_type
  • String
  • 必须
  • 1
  • 计价方式 AMOUNT QUANTITY BOTH
  • product_attr_value_list
  • AccessProductAttrValueDto []
  • 可选
  • 1
  • 产品属性列表
  • └ attr_desc
  • String
  • 可选
  • 属性描述
  • └ attr_en_name
  • String
  • 可选
  • 1
  • 属性英文名称
  • └ attr_en_value_name_list
  • String []
  • 可选
  • []
  • 属性值英文名称列表
  • └ attr_name
  • String
  • 可选
  • 1
  • 属性名称
  • └ attr_value_name_list
  • String []
  • 可选
  • [1,2]
  • 属性值名称列表
  • └ is_key
  • String
  • 可选
  • y
  • 是否关键属性y/n
  • └ product_code
  • String
  • 可选
  • 11
  • 产品编码
  • └ product_desc
  • String
  • 可选
  • 11
  • 产品描述
  • └ product_name
  • String
  • 必须
  • 11
  • 产品名称
  • └ purchase_channel
  • String
  • 必须
  • VIRTUAL_PR
  • 采购通道 CATALOG, EXTERNAL,QUOTATION_SETTLEMENT, VIRTUAL_PR
  • └ recommendation
  • String
  • 可选
  • 产品详情
  • └ source_category_id
  • Number
  • 必须
  • 2
  • 外部分类
  • └ source_category_name
  • String
  • 必须
  • 1
  • 外部分类名
  • └ source_info
  • String
  • 可选
  • 1
  • 额外信息
  • └ source_type
  • String
  • 可选
  • 1
  • 子类型
  • └ source_value
  • String
  • 必须
  • 1345678
  • 来源值(产品ID)
  • └ status
  • String
  • 可选
  • 1
  • 状态
  • └ tenant_id
  • Number
  • 必须
  • 1
  • 租户
  • └ unit
  • String
  • 必须
  • 计价单位

响应参数

名称 类型 示例值 描述
result ResultModel 结果
  • └ error_code
  • String
  • 1
  • 错误码
  • └ error_message
  • String
  • 1
  • 错误消息
  • return_value
  • AccessProductResultDTO []
  • 返回值
  • └ product_id
  • Number
  • 1
  • 产品id
  • └ purchase_product_code
  • String
  • 1
  • 采购产品编码
  • └ source_value
  • String
  • 1
  • 来源值
  • └ source_type
  • String
  • 1
  • 资源类型
  • └ error_code
  • String
  • 1
  • 错误码
  • └ error_msg
  • String
  • 1
  • 错误消息
  • └ success
  • String
  • true
  • 成功标识

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaAntPurProductSaveRequest req = new AlibabaAntPurProductSaveRequest();
AlibabaAntPurProductSaveRequest.AccessProductDto obj1 = new AlibabaAntPurProductSaveRequest.AccessProductDto();
obj1.setBrandId(1L);
obj1.setBrandName("1");
obj1.setBuyerWorkNo("1");
obj1.setCatalogCategoryId(1L);
obj1.setCategoryCode("1");
obj1.setCategoryId(1L);
obj1.setCategoryUseId(21312L);
obj1.setDataSource("SN-TEST");
obj1.setFrontCategoryId(1L);
obj1.setId(1L);
obj1.setImgStorageType("1");
obj1.setImgUrlList("1");
obj1.setMallUrl("https://XXX");
obj1.setOrderType("1");
List<AlibabaAntPurProductSaveRequest.AccessProductAttrValueDto> list3 = new ArrayList<AlibabaAntPurProductSaveRequest.AccessProductAttrValueDto>();
AlibabaAntPurProductSaveRequest.AccessProductAttrValueDto obj4 = new AlibabaAntPurProductSaveRequest.AccessProductAttrValueDto();
list3.add(obj4);
obj4.setAttrDesc("我");
obj4.setAttrEnName("1");
obj4.setAttrEnValueNameList("");
obj4.setAttrName("1");
obj4.setAttrValueNameList("1,2");
obj4.setIsKey("y");
obj1.setProductAttrValueList(list3);
obj1.setProductCode("11");
obj1.setProductDesc("11");
obj1.setProductName("11");
obj1.setPurchaseChannel("VIRTUAL_PR");
obj1.setRecommendation("的");
obj1.setSourceCategoryId(2L);
obj1.setSourceCategoryName("1");
obj1.setSourceInfo("1");
obj1.setSourceType("1");
obj1.setSourceValue("1345678");
obj1.setStatus("1");
obj1.setTenantId(1L);
obj1.setUnit("件");
req.setAccessProductDtos(obj1);
AlibabaAntPurProductSaveResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_ant_pur_product_save_response>
    <result>
        <error_code>1</error_code>
        <error_message>1</error_message>
        <return_value>
            <access_product_result_d_t_o>
                <product_id>1</product_id>
                <purchase_product_code>1</purchase_product_code>
                <source_value>1</source_value>
                <source_type>1</source_type>
                <error_code>1</error_code>
                <error_msg>1</error_msg>
            </access_product_result_d_t_o>
        </return_value>
        <success>true</success>
    </result>
</alibaba_ant_pur_product_save_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

返回
顶部