通过该接口,将商品以及SKU上得条形码信息补全
名称 | 类型 | 是否必须 | 示例值 | 更多限制 | 描述 |
---|---|---|---|---|---|
item_id | Number | 必须 | 123456789 | 被更新商品的ID | |
item_barcode | String | 可选 | 6903244981002 | 商品条形码,如果不用更新,可选择不填 | |
sku_ids | String | 可选 | 12345,54335 | 被更新SKU的ID列表,中间以英文逗号进行分隔。如果没有SKU或者不需要更新SKU的条形码,不需要设置 | |
sku_barcodes | String | 可选 | 6903244981002, 6903244981002 | SKU维度的条形码,和sku_ids字段一一对应,中间以英文逗号分隔 | |
isforce | Boolean | 可选 | true |
|
是否强制保存商品条码。true:强制保存false :需要执行条码库校验 |
src | String | 可选 | update.barcode.src.qianniu | 访问来源,这字段提供给千牛扫码枪用,其他调用方,不需要填写 |
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
item | Item | 商品结构里的num_iid,modified | |
|
1 2 3 4 5 6 7 8 9 10 | TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret); ItemBarcodeUpdateRequest req = new ItemBarcodeUpdateRequest(); req.setItemId(123456789L); req.setItemBarcode( "6903244981002" ); req.setSkuIds( "12345,54335" ); req.setSkuBarcodes( "6903244981002, 6903244981002" ); req.setIsforce( true ); req.setSrc( "update.barcode.src.qianniu" ); ItemBarcodeUpdateResponse rsp = client.execute(req, sessionKey); System.out.println(rsp.getBody()); |
1 2 3 4 5 6 | < item_barcode_update_response > < item > < num_iid >1489161932</ num_iid > < modified >2000-01-01 00:00:00</ modified > </ item > </ item_barcode_update_response > |
1 2 3 4 5 6 | < error_response > < code >50</ code > < msg >Remote service error</ msg > < sub_code >isv.invalid-parameter</ sub_code > < sub_msg >非法参数</ sub_msg > </ error_response > |
错误码 | 错误描述 | 解决方案 |
---|---|---|
isv.item-not-exist:invalid-numIid-or-iid | 商品id,查询不到对应的商品 | 检查商品id,确定商品能查到 |
isv.item-is-delete:invalid-numIid-or-iid | 商品已经被删除 | 被删除商品不能更新 |
isv.invalid-permission:update-item | 被操作商品不属于当前登录用户/达尔文标准商品不允许自行定义条形码 | 确定是当前用户的商品/不用更新此类商品的条码信息 |