1.1. 商品sku添加/修改/删除
1.1.1. 基本信息
Path: /v1/spu/skuSet
Method: POST
接口描述:
1.1.2. 请求参数
Headers
参数名称 | 参数值 | 是否必须 | 示例 | 备注 |
---|---|---|---|---|
Content-Type | application/json | 是 |
Body
名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
---|---|---|---|---|---|
spuId | string | 必须 | 商品spuId | ||
showPrice | string | 必须 | 展示价格 | ||
marketPrice | string | 必须 | 市场价格 | ||
skuList | object | 必须 | 商品sku列表 | ||
├─ 0#0_1#0 | object | 非必须 | 0#0_1#0 第一个规格的第一个属性值+第二个规格的第一个属性值,即颜色:星光色+版本:128G | ||
├─ id | string | 非必须 | 传0 | ||
├─ price | string | 非必须 | 商品sku价格,价格必须大于0 | ||
├─ stock | string | 非必须 | sku库存,库存必须为大于等于0 | ||
├─ commission | string | 非必须 | sku佣金,佣金必须大于等于0 | ||
├─ marketPrice | string | 非必须 | sku市场价,市场价格必须大于0 | ||
├─ buyLimitPer | string | 非必须 | sku购买限制 0表示不限制购买 | ||
├─ proxyStandPrice | string | 非必须 | sku代理标准价 | ||
├─ 0#0_1#1 | object | 非必须 | 0#0_1#0 第一个规格的第一个属性值+第二个规格的第二个属性值,即颜色:星光色+版本:256GG | ||
├─ id | string | 非必须 | |||
├─ price | string | 非必须 | |||
├─ stock | string | 非必须 | |||
├─ commission | string | 非必须 | |||
├─ marketPrice | string | 非必须 | |||
├─ buyLimitPer | string | 非必须 | |||
├─ proxyStandPrice | string | 非必须 | |||
├─ 0#0_1#2 | object | 非必须 | 0#0_1#0 第一个规格的第一个属性值+第二个规格的第三个属性值,即颜色:星光色+版本:512GGG | ||
├─ id | string | 非必须 | |||
├─ price | string | 非必须 | |||
├─ stock | string | 非必须 | |||
├─ commission | string | 非必须 | |||
├─ marketPrice | string | 非必须 | |||
├─ buyLimitPer | string | 非必须 | |||
├─ proxyStandPrice | string | 非必须 | |||
├─ 0#1_1#0 | object | 非必须 | |||
├─ id | string | 非必须 | |||
├─ price | string | 非必须 | |||
├─ stock | string | 非必须 | |||
├─ commission | string | 非必须 | |||
├─ marketPrice | string | 非必须 | |||
├─ buyLimitPer | string | 非必须 | |||
├─ proxyStandPrice | string | 非必须 | |||
├─ 0#1_1#1 | object | 非必须 | |||
├─ id | string | 非必须 | |||
├─ price | string | 非必须 | |||
├─ stock | string | 非必须 | |||
├─ commission | string | 非必须 | |||
├─ marketPrice | string | 非必须 | |||
├─ buyLimitPer | string | 非必须 | |||
├─ proxyStandPrice | string | 非必须 | |||
├─ 0#1_1#2 | object | 非必须 | |||
├─ id | string | 非必须 | |||
├─ price | string | 非必须 | |||
├─ stock | string | 非必须 | |||
├─ commission | string | 非必须 | |||
├─ marketPrice | string | 非必须 | |||
├─ buyLimitPer | string | 非必须 | |||
├─ proxyStandPrice | string | 非必须 | |||
├─ 0#2_1#0 | object | 非必须 | |||
├─ id | string | 非必须 | |||
├─ price | string | 非必须 | |||
├─ stock | string | 非必须 | |||
├─ commission | string | 非必须 | |||
├─ marketPrice | string | 非必须 | |||
├─ buyLimitPer | string | 非必须 | |||
├─ proxyStandPrice | string | 非必须 | |||
├─ 0#2_1#1 | object | 非必须 | |||
├─ id | string | 非必须 | |||
├─ price | string | 非必须 | |||
├─ stock | string | 非必须 | |||
├─ commission | string | 非必须 | |||
├─ marketPrice | string | 非必须 | |||
├─ buyLimitPer | string | 非必须 | |||
├─ proxyStandPrice | string | 非必须 | |||
├─ 0#2_1#2 | object | 非必须 | |||
├─ id | string | 非必须 | |||
├─ price | string | 非必须 | |||
├─ stock | string | 非必须 | |||
├─ commission | string | 非必须 | |||
├─ marketPrice | string | 非必须 | |||
├─ buyLimitPer | string | 非必须 | |||
├─ proxyStandPrice | string | 非必须 | |||
├─ 0#3_1#0 | object | 非必须 | |||
├─ id | string | 非必须 | |||
├─ price | string | 非必须 | |||
├─ stock | string | 非必须 | |||
├─ commission | string | 非必须 | |||
├─ marketPrice | string | 非必须 | |||
├─ buyLimitPer | string | 非必须 | |||
├─ proxyStandPrice | string | 非必须 | |||
├─ 0#3_1#1 | object | 非必须 | |||
├─ id | string | 非必须 | |||
├─ price | string | 非必须 | |||
├─ stock | string | 非必须 | |||
├─ commission | string | 非必须 | |||
├─ marketPrice | string | 非必须 | |||
├─ buyLimitPer | string | 非必须 | |||
├─ proxyStandPrice | string | 非必须 | |||
├─ 0#3_1#2 | object | 非必须 | |||
├─ id | string | 非必须 | |||
├─ price | string | 非必须 | |||
├─ stock | string | 非必须 | |||
├─ commission | string | 非必须 | |||
├─ marketPrice | string | 非必须 | |||
├─ buyLimitPer | string | 非必须 | |||
├─ proxyStandPrice | string | 非必须 | |||
├─ 0#4_1#0 | object | 非必须 | |||
├─ id | string | 非必须 | |||
├─ price | string | 非必须 | |||
├─ stock | string | 非必须 | |||
├─ commission | string | 非必须 | |||
├─ marketPrice | string | 非必须 | |||
├─ buyLimitPer | string | 非必须 | |||
├─ proxyStandPrice | string | 非必须 | |||
├─ 0#4_1#1 | object | 非必须 | |||
├─ id | string | 非必须 | |||
├─ price | string | 非必须 | |||
├─ stock | string | 非必须 | |||
├─ commission | string | 非必须 | |||
├─ marketPrice | string | 非必须 | |||
├─ buyLimitPer | string | 非必须 | |||
├─ proxyStandPrice | string | 非必须 | |||
├─ 0#4_1#2 | object | 非必须 | |||
├─ id | string | 非必须 | |||
├─ price | string | 非必须 | |||
├─ stock | string | 非必须 | |||
├─ commission | string | 非必须 | |||
├─ marketPrice | string | 非必须 | |||
├─ buyLimitPer | string | 非必须 | |||
├─ proxyStandPrice | string | 非必须 | |||
spuAttributes | object [] | 必须 | 商品规格数据数组,商品至少存在一个规格,至多三个规格 | item 类型: object | |
├─ id | string | 必须 | spuKeyId,存在则回传,不存在则传0或负数 | ||
├─ keyName | string | 必须 | 规格名称,规格名称长度不能大于8 | ||
├─ spuValList | object [] | 必须 | 规格取值数组,至少1个,最多20个 | item 类型: object | |
├─ id | string | 必须 | spuValId,存在则回传,不存在则传0或传负数 | ||
├─ val | string | 必须 | 属性值,长度为1至30 | ||
├─ pic | string | 必须 | 属性展示图片,主规格每个值必须配置图片 | ||
├─ major | string | 非必须 | 是否主规格 0否1是 |
1.1.3. 返回数据
名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
---|---|---|---|---|---|
code | number | 非必须 | 状态码:1000成功,非1000数据异常 | ||
message | string | 非必须 | success | ||
content | object | 非必须 |
添加sku示例:
{
"spuId": 7032,
"showPrice": "5199",
"marketPrice": "5199",
"skuList": {
"0#0_1#0": {
"id": "8391",
"price": "5199",
"stock": "100",
"commission": "10",
"marketPrice": "5199",
"buyLimitPer": "1",
"proxyStandPrice": "5199"
},
"0#0_1#1": {
"id": "8392",
"price": "5999",
"stock": "100",
"commission": "15",
"marketPrice": "5999",
"buyLimitPer": "1",
"proxyStandPrice": "5999"
},
"0#0_1#2": {
"id": "8393",
"price": "7599",
"stock": "100",
"commission": "20",
"marketPrice": "7599",
"buyLimitPer": "1",
"proxyStandPrice": "7599"
},
"0#0_1#3": {
"id": "-163238789543126080",
"price": "8999",
"stock": "100",
"commission": "30",
"marketPrice": "8999",
"buyLimitPer": "1",
"proxyStandPrice": "8999"
},
"0#1_1#0": {
"id": "8394",
"price": "5199",
"stock": "100",
"commission": "10",
"marketPrice": "5199",
"buyLimitPer": "1",
"proxyStandPrice": "5199"
},
"0#1_1#1": {
"id": "8395",
"price": "5999",
"stock": "100",
"commission": "15",
"marketPrice": "5999",
"buyLimitPer": "1",
"proxyStandPrice": "5999"
},
"0#1_1#2": {
"id": "8396",
"price": "7599",
"stock": "100",
"commission": "20",
"marketPrice": "7599",
"buyLimitPer": "1",
"proxyStandPrice": "7599"
},
"0#1_1#3": {
"id": "-163238791802357980",
"price": "8999",
"stock": "100",
"commission": "30",
"marketPrice": "8999",
"buyLimitPer": "1",
"proxyStandPrice": "8999"
},
"0#2_1#0": {
"id": "8397",
"price": "5199",
"stock": "100",
"commission": "10",
"marketPrice": "5199",
"buyLimitPer": "1",
"proxyStandPrice": "5199"
},
"0#2_1#1": {
"id": "8398",
"price": "5999",
"stock": "100",
"commission": "15",
"marketPrice": "5999",
"buyLimitPer": "1",
"proxyStandPrice": "5999"
},
"0#2_1#2": {
"id": "8399",
"price": "",
"stock": "100",
"commission": "20",
"marketPrice": "7599",
"buyLimitPer": "1",
"proxyStandPrice": "7599"
},
"0#2_1#3": {
"id": "-163238792399388900",
"price": "8999",
"stock": "100",
"commission": "30",
"marketPrice": "8999",
"buyLimitPer": "1",
"proxyStandPrice": "8999"
},
"0#3_1#0": {
"id": "8400",
"price": "5199",
"stock": "100",
"commission": "10",
"marketPrice": "5199",
"buyLimitPer": "1",
"proxyStandPrice": "5199"
},
"0#3_1#1": {
"id": "8401",
"price": "5999",
"stock": "100",
"commission": "15",
"marketPrice": "5999",
"buyLimitPer": "1",
"proxyStandPrice": "5999"
},
"0#3_1#2": {
"id": "8402",
"price": "7599",
"stock": "100",
"commission": "20",
"marketPrice": "7599",
"buyLimitPer": "1",
"proxyStandPrice": "7599"
},
"0#3_1#3": {
"id": "-16323879266669110",
"price": "8999",
"stock": "100",
"commission": "30",
"marketPrice": "8999",
"buyLimitPer": "1",
"proxyStandPrice": "8999"
},
"0#4_1#0": {
"id": "8403",
"price": "5199",
"stock": "99",
"commission": "10",
"marketPrice": "5199",
"buyLimitPer": "1",
"proxyStandPrice": "5199"
},
"0#4_1#1": {
"id": "8404",
"price": "5999",
"stock": "99",
"commission": "15",
"marketPrice": "5999",
"buyLimitPer": "1",
"proxyStandPrice": "5999"
},
"0#4_1#2": {
"id": "8405",
"price": "7599",
"stock": "99",
"commission": "20",
"marketPrice": "7599",
"buyLimitPer": "1",
"proxyStandPrice": "7599"
},
"0#4_1#3": {
"id": "-163238792889215420",
"price": "8999",
"stock": "100",
"commission": "30",
"marketPrice": "8999",
"buyLimitPer": "1",
"proxyStandPrice": "8999"
}
},
"spuAttributes": [{
"id": "6425",
"keyName": "颜色",
"major": "1",
"spuValList": [{
"id": "7855",
"val": "星光色",
"pic": "https:\/\/tfile.xiaozancloud.com\/public\/agent\/66\/page\/img\/1632297590251_800x800.jpeg"
}, {
"id": "7856",
"val": "午夜色",
"pic": "https:\/\/tfile.xiaozancloud.com\/public\/agent\/66\/page\/img\/1632297592385_800x800.jpeg"
}, {
"id": "7857",
"val": "粉色",
"pic": "https:\/\/tfile.xiaozancloud.com\/public\/agent\/66\/page\/img\/1632297601859_800x800.jpeg"
}, {
"id": "7858",
"val": "蓝色",
"pic": "https:\/\/tfile.xiaozancloud.com\/public\/agent\/66\/page\/img\/1632297606423_800x800.jpeg"
}, {
"id": "7859",
"val": "红色",
"pic": "https:\/\/tfile.xiaozancloud.com\/public\/agent\/66\/page\/img\/1632297610428_800x800.jpeg"
}]
}, {
"id": "6426",
"keyName": "版本",
"major": "0",
"spuValList": [{
"id": "7860",
"val": "128G",
"pic": ""
}, {
"id": "7861",
"val": "256G",
"pic": ""
}, {
"id": "7862",
"val": "512G",
"pic": ""
}, {
"id": "-163238788438494080",
"val": "1T",
"pic": ""
}]
}]
}