文档中心 > API类目 > 天猫供应链

alibaba.dchain.aoxiang.scitem.batch.create (新建货品)

新建货品

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
batch_create_scitem_request BatchCreateScItemRequest 必须 批量新建货品入参,数量不大于30
  • sc_items
  • ScItem []
  • 必须
  • 货品列表,批量数量不大于30
  • └ sc_item_name
  • String
  • 必须
  • xxx
  • 货品名称
  • └ sc_item_code
  • String
  • 必须
  • xxx
  • 货品商家编码
  • └ bar_code
  • String
  • 可选
  • xxx
  • 货品条码
  • └ industry
  • String
  • 必须
  • NORMAL
  • 行业。综合-NORMAL 图书-BOOKS 美妆-BEAUTY
  • └ owner_code
  • String
  • 必须
  • xxx
  • 货主编码;优仓分配,长度不会超过32位,不含特殊字符
  • └ warehouse_code
  • String
  • 可选
  • xxx
  • 仓库编码。需要下发仓库时,必填
  • └ brand_name
  • String
  • 可选
  • xxx
  • 品牌名称
  • └ category_name
  • String
  • 可选
  • xxx
  • 类目名称
  • └ pic_path
  • String
  • 可选
  • xxx
  • 货品主图。填写URL
  • └ length
  • Number
  • 可选
  • 1000
  • 长(毫米)
  • └ width
  • Number
  • 可选
  • 1000
  • 宽(毫米)
  • └ height
  • Number
  • 可选
  • 1000
  • 高(毫米)
  • └ weight
  • Number
  • 可选
  • 1000000
  • 重量(毫克)
  • └ retail_price
  • Number
  • 可选
  • 20007
  • 零售价,单位:分,如:20007,表示:20元7分
  • └ hazardous
  • Number
  • 可选
  • 0
  • 是否危险品,1=是,0=否
  • └ fragile
  • Number
  • 可选
  • 0
  • 是否易碎品,1=是,0=否
  • └ liquid
  • Number
  • 可选
  • 0
  • 是否液体,1=是,0=否
  • └ precious
  • Number
  • 可选
  • 0
  • 是否贵重品,1=是,0=否
  • └ storage_environment
  • String
  • 可选
  • NORMAL
  • 存储条件。NORMAL: 常温 COOL: 阴凉 5°C-12°C FRESHNESS:保鲜 0°C-4°C REEFER:冷藏 -18°C-0°C THERMOSTATIC:恒温 18°C-25°C FROZEN:冷冻 <-18°C COOL_AND_DRY:阴凉干燥 5°C-25°C,相对湿度65%以下
  • └ remark
  • String
  • 可选
  • xxx
  • 备注
  • └ extend_props
  • String
  • 可选
  • {"common.xxx":"xxxx"}
  • 非必填(如果是基础扩展字段,字段名称加上前缀common.;如果是行业扩展字段,字段名称加上前缀industry.)
  • purchase_prices
  • PurchasePrice []
  • 可选
  • 采购价格
  • └ price
  • Number
  • 可选
  • 20007
  • 采购价,单位:分
  • └ currency
  • String
  • 可选
  • CNY
  • 币种,USD-美元,CNY-人民币,RUB-卢布,JPY-日元,EUR-欧元,GBP-英镑,HKD-港币,NZD-新西兰元,SGD-新加坡元,AUD-澳元,KRW-韩元,THB-泰铢
  • └ supplier_name
  • String
  • 可选
  • xxx
  • 供应商名称
  • └ currency
  • String
  • 可选
  • CNY
  • 币种,USD-美元,CNY-人民币,RUB-卢布,JPY-日元,EUR-欧元,GBP-英镑,HKD-港币,NZD-新西兰元,SGD-新加坡元,AUD-澳元,KRW-韩元,THB-泰铢
  • └ need_notify_warehouse
  • Number
  • 必须
  • 1
  • 是否需要下发仓。0表示否,1表示是
  • └ warehouse_sc_item_code
  • String
  • 可选
  • xxx
  • 仓库货品编码
  • └ request_time
  • Number
  • 必须
  • 1639205668000
  • 业务请求时间
  • └ request_id
  • String
  • 必须
  • xxx
  • 业务请求ID,用于幂等

响应参数

名称 类型 示例值 描述
batch_create_scitem_response BatchCreateScItemResponse 返回结构体
  • data
  • BatchCreateScItemResult
  • 业务处理结果
  • └ result
  • String
  • 1
  • 0=全部失败,1=全部成功,2=部分成功
  • detail
  • DetailItem []
  • 结果明细
  • └ success
  • Boolean
  • true
  • 成功或者失败
  • └ sc_item_code
  • String
  • xxx
  • 货品商家编码
  • └ code
  • String
  • xxx
  • 返回信息码
  • └ message
  • String
  • xxx
  • 返回信息
  • └ sc_item_id
  • String
  • xxx
  • 翱象货品ID
  • └ sc_item_bar_code
  • String
  • xxx
  • 货品商家条码
  • └ success
  • Boolean
  • true
  • 成功或者失败
  • └ message
  • String
  • xxx
  • 返回信息
  • └ code
  • String
  • xxx
  • 返回信息码

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaDchainAoxiangScitemBatchCreateRequest req = new AlibabaDchainAoxiangScitemBatchCreateRequest();
AlibabaDchainAoxiangScitemBatchCreateRequest.BatchCreateScItemRequest obj1 = new AlibabaDchainAoxiangScitemBatchCreateRequest.BatchCreateScItemRequest();
List<AlibabaDchainAoxiangScitemBatchCreateRequest.ScItem> list3 = new ArrayList<AlibabaDchainAoxiangScitemBatchCreateRequest.ScItem>();
AlibabaDchainAoxiangScitemBatchCreateRequest.ScItem obj4 = new AlibabaDchainAoxiangScitemBatchCreateRequest.ScItem();
list3.add(obj4);
obj4.setScItemName("xxx");
obj4.setScItemCode("xxx");
obj4.setBarCode("xxx");
obj4.setIndustry("NORMAL");
obj4.setOwnerCode("xxx");
obj4.setWarehouseCode("xxx");
obj4.setBrandName("xxx");
obj4.setCategoryName("xxx");
obj4.setPicPath("xxx");
obj4.setLength(1000L);
obj4.setWidth(1000L);
obj4.setHeight(1000L);
obj4.setWeight(1000000L);
obj4.setRetailPrice(20007L);
obj4.setHazardous(0L);
obj4.setFragile(0L);
obj4.setLiquid(0L);
obj4.setPrecious(0L);
obj4.setStorageEnvironment("NORMAL");
obj4.setRemark("xxx");
obj4.setExtendProps("{\"common.xxx\":\"xxxx\"}");
List<AlibabaDchainAoxiangScitemBatchCreateRequest.PurchasePrice> list7 = new ArrayList<AlibabaDchainAoxiangScitemBatchCreateRequest.PurchasePrice>();
AlibabaDchainAoxiangScitemBatchCreateRequest.PurchasePrice obj8 = new AlibabaDchainAoxiangScitemBatchCreateRequest.PurchasePrice();
list7.add(obj8);
obj8.setPrice(20007L);
obj8.setCurrency("CNY");
obj8.setSupplierName("xxx");
list5.setPurchasePrices(list7);
obj4.setCurrency("CNY");
obj4.setNeedNotifyWarehouse(1L);
obj4.setWarehouseScItemCode("xxx");
obj1.setScItems(list3);
obj1.setRequestTime(1639205668000L);
obj1.setRequestId("xxx");
req.setBatchCreateScitemRequest(obj1);
AlibabaDchainAoxiangScitemBatchCreateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_dchain_aoxiang_scitem_batch_create_response>
    <batch_create_scitem_response>
        <data>
            <result>1</result>
            <detail>
                <detail_item>
                    <success>true</success>
                    <sc_item_code>xxx</sc_item_code>
                    <code>xxx</code>
                    <message>xxx</message>
                    <sc_item_id>xxx</sc_item_id>
                    <sc_item_bar_code>xxx</sc_item_bar_code>
                </detail_item>
            </detail>
        </data>
        <success>true</success>
        <message>xxx</message>
        <code>xxx</code>
    </batch_create_scitem_response>
</alibaba_dchain_aoxiang_scitem_batch_create_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

返回
顶部