1. 商品创建
1.1.1. 基本信息
Path: /v1/spu/create
Method: POST
接口描述:
1.1.2. 请求参数
Headers
参数名称 | 参数值 | 是否必须 | 示例 | 备注 |
---|---|---|---|---|
Content-Type | application/json | 是 | application/json | json传参 |
Body
名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
---|---|---|---|---|---|
type | string | 必须 | 商品类型:1成本商品,2预付商品 | ||
name | string | 必须 | 商品名称,最大长度不能超过40 | ||
album | string [] | 必须 | 商品相册,数量最少一张,最多20张 |
item 类型: string |
|
├─ | 非必须 | ||||
video | string | 非必须 | 商品视频连接 | ||
posterType | string | 必须 | 海报样式,0用户上传,1默认样式 | ||
poster | string | 非必须 | 海报样式是用户上传时,需传此参数 海报宽高为750*1174 | ||
description | string | 必须 | 图文描述 | ||
showPrice | string | 必须 | 展示价格,不能小于0 | ||
marketPrice | string | 必须 | 市场价格,不能小于0 | ||
sellSTime | string | 必须 | 销售开始时间 | ||
sellETime | string | 必须 | 销售结束时间 | ||
payerNumberBase | string | 非必须 | 付款人数基数,不能小于0,对外展示为payerNumber+payerNumberBase | ||
effectTimeType | string | 非必须 | type=2时需传此参数,有效期类型,0长久有效,1购买后n天有效,2指定日期前有效 | ||
effectTimeParam | string | 非必须 | type=2时需传此参数,effectTimeType=1或2时需传此参数 ,effectTimeType=2时需传日期格式如:2021-9-30 | ||
limitStores | string [] | 非必须 | type=2时需传此参数,可用门店ID数组,不选择默认全部门店可用 |
item 类型: string |
|
├─ | 非必须 | ||||
usageNotice | string | 非必须 | type=2时需传此参数,使用须知 | ||
spuGroupData | string [] | 非必须 | 所属商品分组 |
item 类型: string |
|
├─ | 非必须 | ||||
skuList | object | 必须 | 商品sku售卖信息列表 | ||
├─ 0#0_1#0 | object | 非必须 | 0#0_1#0 第一个规格的第一个属性值+第二个规格的第一个属性值,即颜色:星光色+版本:128G | ||
├─ id | string | 非必须 | 传0 | ||
├─ price | string | 非必须 | 商品sku价格,价格必须大于0 | ||
├─ deduct | string | 非必须 | 预付商品的抵扣金额 可不传 | ||
├─ 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 | 非必须 | |||
├─ deduct | 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 | 非必须 | |||
├─ deduct | string | 非必须 | |||
├─ stock | string | 非必须 | |||
├─ commission | string | 非必须 | |||
├─ marketPrice | string | 非必须 | |||
├─ buyLimitPer | string | 非必须 | |||
├─ proxyStandPrice | string | 非必须 | |||
├─ 0#1_1#0 | object | 非必须 | |||
├─ id | string | 非必须 | |||
├─ price | string | 非必须 | |||
├─ deduct | string | 非必须 | |||
├─ stock | string | 非必须 | |||
├─ commission | string | 非必须 | |||
├─ marketPrice | string | 非必须 | |||
├─ buyLimitPer | string | 非必须 | |||
├─ proxyStandPrice | string | 非必须 | |||
├─ 0#1_1#1 | object | 非必须 | |||
├─ id | string | 非必须 | |||
├─ price | string | 非必须 | |||
├─ deduct | string | 非必须 | |||
├─ stock | string | 非必须 | |||
├─ commission | string | 非必须 | |||
├─ marketPrice | string | 非必须 | |||
├─ buyLimitPer | string | 非必须 | |||
├─ proxyStandPrice | string | 非必须 | |||
├─ 0#1_1#2 | object | 非必须 | |||
├─ id | string | 非必须 | |||
├─ price | string | 非必须 | |||
├─ deduct | string | 非必须 | |||
├─ stock | string | 非必须 | |||
├─ commission | string | 非必须 | |||
├─ marketPrice | string | 非必须 | |||
├─ buyLimitPer | string | 非必须 | |||
├─ proxyStandPrice | string | 非必须 | |||
├─ 0#2_1#0 | object | 非必须 | |||
├─ id | string | 非必须 | |||
├─ price | string | 非必须 | |||
├─ deduct | string | 非必须 | |||
├─ stock | string | 非必须 | |||
├─ commission | string | 非必须 | |||
├─ marketPrice | string | 非必须 | |||
├─ buyLimitPer | string | 非必须 | |||
├─ proxyStandPrice | string | 非必须 | |||
├─ 0#2_1#1 | object | 非必须 | |||
├─ id | string | 非必须 | |||
├─ price | string | 非必须 | |||
├─ deduct | string | 非必须 | |||
├─ stock | string | 非必须 | |||
├─ commission | string | 非必须 | |||
├─ marketPrice | string | 非必须 | |||
├─ buyLimitPer | string | 非必须 | |||
├─ proxyStandPrice | string | 非必须 | |||
├─ 0#2_1#2 | object | 非必须 | |||
├─ id | string | 非必须 | |||
├─ price | string | 非必须 | |||
├─ deduct | string | 非必须 | |||
├─ stock | string | 非必须 | |||
├─ commission | string | 非必须 | |||
├─ marketPrice | string | 非必须 | |||
├─ buyLimitPer | string | 非必须 | |||
├─ proxyStandPrice | string | 非必须 | |||
├─ 0#3_1#0 | object | 非必须 | |||
├─ id | string | 非必须 | |||
├─ price | string | 非必须 | |||
├─ deduct | string | 非必须 | |||
├─ stock | string | 非必须 | |||
├─ commission | string | 非必须 | |||
├─ marketPrice | string | 非必须 | |||
├─ buyLimitPer | string | 非必须 | |||
├─ proxyStandPrice | string | 非必须 | |||
├─ 0#3_1#1 | object | 非必须 | |||
├─ id | string | 非必须 | |||
├─ price | string | 非必须 | |||
├─ deduct | string | 非必须 | |||
├─ stock | string | 非必须 | |||
├─ commission | string | 非必须 | |||
├─ marketPrice | string | 非必须 | |||
├─ buyLimitPer | string | 非必须 | |||
├─ proxyStandPrice | string | 非必须 | |||
├─ 0#3_1#2 | object | 非必须 | |||
├─ id | string | 非必须 | |||
├─ price | string | 非必须 | |||
├─ deduct | string | 非必须 | |||
├─ stock | string | 非必须 | |||
├─ commission | string | 非必须 | |||
├─ marketPrice | string | 非必须 | |||
├─ buyLimitPer | string | 非必须 | |||
├─ proxyStandPrice | string | 非必须 | |||
├─ 0#4_1#0 | object | 非必须 | |||
├─ id | string | 非必须 | |||
├─ price | string | 非必须 | |||
├─ deduct | string | 非必须 | |||
├─ stock | string | 非必须 | |||
├─ commission | string | 非必须 | |||
├─ marketPrice | string | 非必须 | |||
├─ buyLimitPer | string | 非必须 | |||
├─ proxyStandPrice | string | 非必须 | |||
├─ 0#4_1#1 | object | 非必须 | |||
├─ id | string | 非必须 | |||
├─ price | string | 非必须 | |||
├─ deduct | string | 非必须 | |||
├─ stock | string | 非必须 | |||
├─ commission | string | 非必须 | |||
├─ marketPrice | string | 非必须 | |||
├─ buyLimitPer | string | 非必须 | |||
├─ proxyStandPrice | string | 非必须 | |||
├─ 0#4_1#2 | object | 非必须 | |||
├─ id | string | 非必须 | |||
├─ price | string | 非必须 | |||
├─ deduct | string | 非必须 | |||
├─ stock | string | 非必须 | |||
├─ commission | string | 非必须 | |||
├─ marketPrice | string | 非必须 | |||
├─ buyLimitPer | string | 非必须 | |||
├─ proxyStandPrice | string | 非必须 | |||
spuAttributes | object [] | 必须 | 商品规格数据数组,商品至少存在一个规格,至多三个规格 |
item 类型: object |
|
├─ id | string | 必须 | 传0 | ||
├─ keyName | string | 必须 | 规格名称,规格名称长度不能大于8 | ||
├─ spuValList | object [] | 必须 | 规格取值数组,至少1个,最多20个 |
item 类型: object |
|
├─ id | string | 必须 | 传0 | ||
├─ val | string | 必须 | 属性值,长度为1至30 | ||
├─ pic | string | 必须 | 属性展示图片,主规格每个值必须配置图片 | ||
├─ major | string | 非必须 | 是否主规格 0否1是 |
1.1.3. 返回数据
名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
---|---|---|---|---|---|
code | number | 非必须 | 状态码:1000成功,非1000数据异常 | ||
message | string | 非必须 | success | ||
content | object | 非必须 | |||
├─ spuId | number | 非必须 | 商品ID |
请求参数示例
{
"type": "1",
"name": "Apple iPhone 13 mini ",
"album": ["https:\/\/tfile.xiaozancloud.com\/public\/agent\/66\/page\/img\/1632297528112_800x800.jpeg", "https:\/\/tfile.xiaozancloud.com\/public\/agent\/66\/page\/img\/1632297536000_800x800.jpeg", "https:\/\/tfile.xiaozancloud.com\/public\/agent\/66\/page\/img\/1632297544026_800x800.jpeg", "https:\/\/tfile.xiaozancloud.com\/public\/agent\/66\/page\/img\/1632297544989_800x800.jpeg", "https:\/\/tfile.xiaozancloud.com\/public\/agent\/66\/page\/img\/1632297557122_800x800.jpeg"],
"video": "",
"posterType": "1",
"poster": "",
"description": "<p>商品描述</p>",
"showPrice": "5199.00",
"marketPrice": "5199.00",
"sellSTime": "2021-09-22 16:02:00",
"sellETime": "2021-12-31 16:02:00",
"payerNumberBase": "88",
"effectTimeType": "0",
"effectTimeParam": "",
"limitStores": ["144", "142"],
"usageNotice": "使用需知须知",
"spuGroupData": ["79", "78"],
"skuList": {
"0#0_1#0": {
"id": "0",
"price": "5199.00",
"deduct": "",
"stock": "100",
"commission": "10",
"marketPrice": "5199.00",
"buyLimitPer": "1",
"proxyStandPrice": "5199.00"
},
"0#0_1#1": {
"id": "0",
"price": "5999.00",
"deduct": "",
"stock": "100",
"commission": "15",
"marketPrice": "5999.00",
"buyLimitPer": "1",
"proxyStandPrice": "5999.00"
},
"0#0_1#2": {
"id": "0",
"price": "7599.00",
"deduct": "",
"stock": "100",
"commission": "20",
"marketPrice": "7599.00",
"buyLimitPer": "1",
"proxyStandPrice": "7599.00"
},
"0#1_1#0": {
"id": "0",
"price": "5199.00",
"deduct": "",
"stock": "100",
"commission": "10",
"marketPrice": "5199.00",
"buyLimitPer": "1",
"proxyStandPrice": "5199.00"
},
"0#1_1#1": {
"id": "0",
"price": "5999.00",
"deduct": "",
"stock": "100",
"commission": "15",
"marketPrice": "5999.00",
"buyLimitPer": "1",
"proxyStandPrice": "5999.00"
},
"0#1_1#2": {
"id": "0",
"price": "7599.00",
"deduct": "",
"stock": "100",
"commission": "20",
"marketPrice": "7599.00",
"buyLimitPer": "1",
"proxyStandPrice": "7599.00"
},
"0#2_1#0": {
"id": "0",
"price": "5199.00",
"deduct": "",
"stock": "100",
"commission": "10",
"marketPrice": "5199.00",
"buyLimitPer": "1",
"proxyStandPrice": "5199.00"
},
"0#2_1#1": {
"id": "0",
"price": "5999.00",
"deduct": "",
"stock": "100",
"commission": "15",
"marketPrice": "5999.00",
"buyLimitPer": "1",
"proxyStandPrice": "5999.00"
},
"0#2_1#2": {
"id": "0",
"price": "7599.00",
"deduct": "",
"stock": "100",
"commission": "20",
"marketPrice": "7599.00",
"buyLimitPer": "1",
"proxyStandPrice": "7599.00"
},
"0#3_1#0": {
"id": "0",
"price": "5199.00",
"deduct": "",
"stock": "100",
"commission": "10",
"marketPrice": "5199.00",
"buyLimitPer": "1",
"proxyStandPrice": "5199.00"
},
"0#3_1#1": {
"id": "0",
"price": "5999.00",
"deduct": "",
"stock": "100",
"commission": "15",
"marketPrice": "5999.00",
"buyLimitPer": "1",
"proxyStandPrice": "5999.00"
},
"0#3_1#2": {
"id": "0",
"price": "7599.00",
"deduct": "",
"stock": "100",
"commission": "20",
"marketPrice": "7599.00",
"buyLimitPer": "1",
"proxyStandPrice": "7599.00"
},
"0#4_1#0": {
"id": "0",
"price": "5199.00",
"deduct": "",
"stock": "99",
"commission": "10",
"marketPrice": "5199.00",
"buyLimitPer": "1",
"proxyStandPrice": "5199.00"
},
"0#4_1#1": {
"id": "0",
"price": "5999.00",
"deduct": "",
"stock": "99",
"commission": "15",
"marketPrice": "5999.00",
"buyLimitPer": "1",
"proxyStandPrice": "5999.00"
},
"0#4_1#2": {
"id": "0",
"price": "7599.00",
"deduct": "",
"stock": "99",
"commission": "20",
"marketPrice": "7599.00",
"buyLimitPer": "1",
"proxyStandPrice": "7599.00"
}
},
"spuAttributes": [{
"id": "0",
"keyName": "颜色",
"spuValList": [{
"id": "0",
"val": "星光色",
"pic": "https:\/\/tfile.xiaozancloud.com\/public\/agent\/66\/page\/img\/1632297590251_800x800.jpeg"
}, {
"id": "0",
"val": "午夜色",
"pic": "https:\/\/tfile.xiaozancloud.com\/public\/agent\/66\/page\/img\/1632297592385_800x800.jpeg"
}, {
"id": "0",
"val": "粉色",
"pic": "https:\/\/tfile.xiaozancloud.com\/public\/agent\/66\/page\/img\/1632297601859_800x800.jpeg"
}, {
"id": "0",
"val": "蓝色",
"pic": "https:\/\/tfile.xiaozancloud.com\/public\/agent\/66\/page\/img\/1632297606423_800x800.jpeg"
}, {
"id": "0",
"val": "红色",
"pic": "https:\/\/tfile.xiaozancloud.com\/public\/agent\/66\/page\/img\/1632297610428_800x800.jpeg"
}],
"major": "1"
}, {
"id": "0",
"keyName": "版本",
"spuValList": [{
"id": "0",
"val": "128G",
"pic": ""
}, {
"id": "0",
"val": "256G",
"pic": ""
}, {
"id": "0",
"val": "512G",
"pic": ""
}]
}]
}
返回示例
{
"code": 1000,
"message": "保存成功",
"content": {
"spuId": 7032
}
}
#@sfsd