Skip to content
关注公众号,获取新课通知

更新商品规格


接口URL

http://ceshi13.dishait.cn/admin/goods/updateskus/:id

请求方式

POST

Content-Type

json

请求Header参数

参数名示例值参数类型是否必填参数描述
token2f...5eText用户token

路径变量

参数名示例值参数描述
id60商品ID

请求Body参数

json5
{
    "sku_type": 1,
    "sku_value": {
        "oprice": 20,
        "pprice": 30,
        "cprice": 20,
        "weight": 10,
        "volume": 20
    },
    "goodsSkus": [
        {
            "skus": [
                {
                    "goods_skus_card_id": "134",
                    "name": "颜色",
                    "order": 50,
                    "value": "黄色",
                    "id": "296",
                    "text": "黄色"
                },
                // ...
            ],
            "image": "",
            "pprice": 0,
            "oprice": 0,
            "cprice": 0,
            "stock": 0,
            "volume": 0,
            "weight": 0,
            "code": "",
            "goods_id": 26
        },
        // ...
    ]
}
参数名示例值参数类型参数描述
sku_type1Number规格类型:0单规格1多规格
sku_value{ "oprice": 20, "pprice": 30, "cprice": 20, "weight": 10, "volume": 20 }Object单规格属性(sku_type=0时必填)
goodsSkus[ { "skus": [ { "goods_skus_card_id": "134", "name": "颜色", "order": 50, "value": "黄色", "id": "296", "text": "黄色" } ], "image": "", "pprice": 0, "oprice": 0, "cprice": 0, "stock": 0, "volume": 0, "weight": 0, "code": "", "goods_id": 26 } ]Array多规格属性(sku_type=1时必填):具体参考课程

成功响应示例

json5
{
    "msg": "ok",
    "data": 2
}