按 SKU 规格更新一个商品下一个或多个 SKU 的市场价和优惠价。
8.1 请求
PATCH /openapi/products/{spuId}/prices
{
"skus": [
{
"specification": "500mL/瓶",
"marketPrice": 45.00,
"discountPrice": 35.50
},
{
"specification": "2.5L/瓶",
"marketPrice": 155.00,
"discountPrice": 125.00
}
]
}
8.2 成功响应
HTTP 状态码:200 OK
{
"code": "SUCCESS",
"message": "商品价格更新成功",
"data": {
"spuId": "spu-100001",
"productCode": "P-100001",
"updatedCount": 2,
"skus": [
{
"specification": "500mL/瓶",
"marketPrice": 45.00,
"discountPrice": 35.50
},
{
"specification": "2.5L/瓶",
"marketPrice": 155.00,
"discountPrice": 125.00
}
]
}
}
8.3 业务规则
- 使用“当前供应商 +
spuId”定位商品。 - 使用商品下的
specification精确定位 SKU。 - 规格在同一个商品下必须唯一。
- 请求内的 SKU 规格不能重复。
- 优惠价不得高于市场价。
- 任意规格不存在或价格不合法时,整个价格更新请求失败,不执行部分更新。
- 价格变低,直接上架,价格变高,自动下架,等待平台审核审核通过后自动上架。
作者:吴群杰 创建时间:2026-10-10 16:17
最后编辑:吴群杰 更新时间:2026-10-10 17:37
最后编辑:吴群杰 更新时间:2026-10-10 17:37