编辑商品
1.当商品状态处于”审核待修改“和”审核通过“状态时允许编辑,其他状态不允许编辑
2.商品在”通过“状态时,变更名称、详情和商品主图会触发审核
3.类目变更需要满足当前审核状态为”审核待修改“
4.返回值列举了当前商品编辑后所有有效的SkuId
5.多级规格商品修改时遵循和添加商品一致的规则,保持更新之后的商品规格是完整组合即可
6.若需要对sku规格和规格值进行排序,需指定skuList.skuProps.propSortNum和skuList.skuProps.propValueSortNum的值
1. 请求参数
请求URL:
公共参数
参数名称 | 参数类型 | 是否必须 | 示例值 | 参数描述 |
---|---|---|---|---|
appid | String | 是 | 合作伙伴AppId | |
timestamp | String | 是 | 1657525936 | 当前Unix时间戳,秒 |
seller_nick | String | 是 | 38173182 | 快手的店铺账号,对应蜂巢授权返回seller_nick字段 |
sign | String | 是 |
业务参数
参数名 | 类型 | 必须 | 示例值 | 详情描述 |
---|---|---|---|---|
productData | JSON | 是 | 见示例 | 编辑后的商品数据 |
商品字段productData
下面是编辑商品的示例,productData字段内容,全部字段定义见文档: https://open.kwaixiaodian.com/zone/new/docs/api?name=open.item.edit&version=1
{
"itemId":25002118844443,
"title": "美式复古醋酸缎面豹纹包臀鱼尾裙夏季新款小众高腰抽绳垂感半身裙-update",
"relItemId": 806919644519,
"categoryId": 1609,
"imageUrls": [
"https://p2-ec.ecukwai.com/bs2/image-kwaishop-product/ITEM_IMAGE-2589256601-14be4b6ec86e46bc95c3bef22ae34b99.jpg",
"https://p2-ec.ecukwai.com/bs2/image-kwaishop-product/ITEM_IMAGE-921977914-c9ee5a3af2ba4aedb189fff851d6abc7.jpg",
"https://p2-ec.ecukwai.com/bs2/image-kwaishop-product/ITEM_IMAGE-921977914-ed2e008ee41f4e85938c45dc6f97c3e1.jpg"
],
"skuList": [
{
"relSkuId": 5486984697299,
"skuStock": 100,
"skuStockChangeType":3,
"skuChangeStock": 120,
"skuSalePrice": 3990,
"skuProps": [
{
"propName": "颜色",
"propValueName": "白色",
"imageUrl": "https://p2-ec.ecukwai.com/bs2/image-kwaishop-product/ITEM_IMAGE-2589256601-14be4b6ec86e46bc95c3bef22ae34b99.jpg",
"isMainProp": 1,
"propVersion": 1
}
]
}
],
"itemPropValues": [
{
"propId": 102,
"radioPropValue": {
"propValueId": 2654018,
"propValue": "穆之宜"
},
"sortNum": 22,
"propName": "品牌"
},
{
"propId": 690,
"radioPropValue": {
"propValueId": 50034082,
"propValue": "鱼尾裙"
},
"sortNum": 9,
"propName": "裙型"
},
{
"propId": 3767,
"radioPropValue": {
"propValueId": 16324749,
"propValue": "中裙"
},
"sortNum": 18,
"propName": "裙长"
},
{
"propId": 5544,
"checkBoxPropValuesList": [
{
"propValueId": 16787287,
"propValue": "维纶"
}
],
"sortNum": 21,
"propName": "面料材质"
},
{
"propId": 5551,
"radioPropValue": {
"propValueId": 783740358,
"propValue": "2025年夏季"
},
"sortNum": 12,
"propName": "上市年份季节"
},
{
"propId": 5587,
"radioPropValue": {
"propValueId": 16328187,
"propValue": "中腰"
},
"sortNum": 17,
"propName": "腰型"
}
],
"details": "新款夏季新款小众高腰抽绳垂感半身裙",
"detailImageUrls": [
"https://p4-ec.ecukwai.com/bs2/image-kwaishop-product/ITEM_IMAGE-2589256601-4da1772e9e8f42eeaac34631de1963f4.jpg",
"https://p2-ec.ecukwai.com/bs2/image-kwaishop-product/ITEM_IMAGE-2589256601-14be4b6ec86e46bc95c3bef22ae34b99.jpg",
"https://p2-ec.ecukwai.com/bs2/image-kwaishop-product/ITEM_IMAGE-2589256601-ea6eb959032a42d693ea760563fa0652.jpg"
],
"serviceRule": {
"refundRule": "1",
"promiseDeliveryTime":172800,
"immediatelyOnOfflineFlag": 1,
"servicePromise": {
"brokenRefund": true
}
},
"expressTemplateId": 237081174443
}
相对发布商品,编辑商品时,要指定sku中库存的修改方式,见字段。skuStockChangeType和skuChangeStock。
2. 请求示例代码(Java)
@Test
public void KsItemEdit() throws Exception {
Map<String, Object> data = new HashMap<String, Object>();
data.put("appid", Config.AppId);
Long timestamp = System.currentTimeMillis() / 1000;
data.put("timestamp", timestamp.toString());
data.put("seller_nick", Config.KSSellerNick);
// 产品数据
String productData = "{\n" + " \"itemId\":25002118844443,\n" + " \"title\": \"美式复古醋酸缎面豹纹包臀鱼尾裙半身裙-update\",\n" + " \"relItemId\": 806919644519,\n" + " \"categoryId\": 1609,\n" + " \"imageUrls\": [\n" + " \"https://p2-ec.ecukwai.com/bs2/image-kwaishop-product/ITEM_IMAGE-2589256601-14be4b6ec86e46bc95c3bef22ae34b99.jpg\",\n" + " \"https://p2-ec.ecukwai.com/bs2/image-kwaishop-product/ITEM_IMAGE-921977914-c9ee5a3af2ba4aedb189fff851d6abc7.jpg\",\n" + " \"https://p2-ec.ecukwai.com/bs2/image-kwaishop-product/ITEM_IMAGE-921977914-ed2e008ee41f4e85938c45dc6f97c3e1.jpg\"\n" + " ],\n" + " \"skuList\": [\n" + " {\n" + " \"relSkuId\": 5486984697299,\n" + " \"skuStock\": 100,\n" + " \"skuStockChangeType\":3,\n" + " \"skuChangeStock\": 120,\n" + " \"skuSalePrice\": 3990,\n" + " \"skuProps\": [\n" + " {\n" + " \"propName\": \"颜色\",\n" + " \"propValueName\": \"白色\",\n" + " \"imageUrl\": \"https://p2-ec.ecukwai.com/bs2/image-kwaishop-product/ITEM_IMAGE-2589256601-14be4b6ec86e46bc95c3bef22ae34b99.jpg\",\n" + " \"isMainProp\": 1,\n" + " \"propVersion\": 1\n" + " }\n" + " ]\n" + " }\n" + " ],\n" + " \"itemPropValues\": [\n" + " {\n" + " \"propId\": 102,\n" + " \"radioPropValue\": {\n" + " \"propValueId\": 2654018,\n" + " \"propValue\": \"穆之宜\"\n" + " },\n" + " \"sortNum\": 22,\n" + " \"propName\": \"品牌\"\n" + " },\n" + " {\n" + " \"propId\": 690,\n" + " \"radioPropValue\": {\n" + " \"propValueId\": 50034082,\n" + " \"propValue\": \"鱼尾裙\"\n" + " },\n" + " \"sortNum\": 9,\n" + " \"propName\": \"裙型\"\n" + " },\n" + " {\n" + " \"propId\": 3767,\n" + " \"radioPropValue\": {\n" + " \"propValueId\": 16324749,\n" + " \"propValue\": \"中裙\"\n" + " },\n" + " \"sortNum\": 18,\n" + " \"propName\": \"裙长\"\n" + " },\n" + " {\n" + " \"propId\": 5544,\n" + " \"checkBoxPropValuesList\": [\n" + " {\n" + " \"propValueId\": 16787287,\n" + " \"propValue\": \"维纶\"\n" + " }\n" + " ],\n" + " \"sortNum\": 21,\n" + " \"propName\": \"面料材质\"\n" + " },\n" + " {\n" + " \"propId\": 5551,\n" + " \"radioPropValue\": {\n" + " \"propValueId\": 783740358,\n" + " \"propValue\": \"2025年夏季\"\n" + " },\n" + " \"sortNum\": 12,\n" + " \"propName\": \"上市年份季节\"\n" + " },\n" + " {\n" + " \"propId\": 5587,\n" + " \"radioPropValue\": {\n" + " \"propValueId\": 16328187,\n" + " \"propValue\": \"中腰\"\n" + " },\n" + " \"sortNum\": 17,\n" + " \"propName\": \"腰型\"\n" + " }\n" + " ],\n" + " \"details\": \"新款夏季新款小众高腰抽绳垂感半身裙\",\n" + " \"detailImageUrls\": [\n" + " \"https://p4-ec.ecukwai.com/bs2/image-kwaishop-product/ITEM_IMAGE-2589256601-4da1772e9e8f42eeaac34631de1963f4.jpg\",\n" + " \"https://p2-ec.ecukwai.com/bs2/image-kwaishop-product/ITEM_IMAGE-2589256601-14be4b6ec86e46bc95c3bef22ae34b99.jpg\",\n" + " \"https://p2-ec.ecukwai.com/bs2/image-kwaishop-product/ITEM_IMAGE-2589256601-ea6eb959032a42d693ea760563fa0652.jpg\"\n" + " ],\n" + " \"serviceRule\": {\n" + " \"refundRule\": \"1\",\n" + " \"promiseDeliveryTime\":172800,\n" + " \"immediatelyOnOfflineFlag\": 1,\n" + " \"servicePromise\": {\n" + " \"brokenRefund\": true\n" + " }\n" + " },\n" + " \"expressTemplateId\": 237081174443\n" + "}";
data.put("productData", productData);
data.put("sign", Sign(data,Config.AppSecret));
String resp = doHttpRequest(Config.KsItemEditUrl, data);
System.out.println(resp);
}
3. 返回结果
{
"code": 0,
"message": "ok",
"data": {
"kwaiItemId": 25002118844443,
"relItemId": 806919644520,
"skuIdMapping": [
{
"kwaiSkuId": 160737916990443,
"relSkuId": 5486984697299,
"skuNick": ""
}
]
},
"trace_id": ""
}
4. 返回字段说明
返回 code为0时,说明成功,非0时,说明失败。message中会有失败原因。 其他字段说明见: https://open.kwaixiaodian.com/zone/new/docs/api?name=open.item.edit&version=1
文档更新时间: 2025-08-20 15:11 作者:admin