企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
**简要描述:** - 添加商品 **请求URL:** - `/adminapi/goods.goods/add` **请求方式:** - POST **参数:** |参数名 |必选 |类型 |说明 | | ------ | ------ | ------ |------ | |name |是 |string |商品名称 | |code |是 |string |商品编码| |is_express |是 |int |快递配送:1-是;0-否;| |is_selffetch |是 |int |上门自提:1-是;0-否;| |express_type |是 |int |运费类型:1-包邮;2-统一运费;3-运费模板| |express_money |是 |float |运费类型为:2(统一运费)时必传| |express_template_id |是 |int |运费类型为:3(运费模板)时必传| |video_source |是 |string |视频来源:1-视频素材库;2-商品链接| |video_cover |是 |string |视频封面| |video |是 |string |视频链接| |category_id|是|array|商品分类| |supplier_id |是 |int|供应商id| |brand_id |是 |int |品牌id| |unit_id |是 |int |单位id| |image |是 |array | 商品轮播图(数组第一个为商品主图) |stock_warning |是 |int |库存预警| |virtual_sales_num |是 |int |虚拟销量| |sort |是 |int |排序| |status |是 |int |状态:1-销售中;0-仓库中| |content |是|int |富文本| |spec_type |是 |int | 类型 1-单规格商品;2-多规格商品 |spec_value |是 |array | 规格项 |--spec_name |是 |sring | 规格名称 |--spec_list |是 |array | 规格子项列表 |----value |是 |string | 规格值 |spec_value_list |是 |array | 规格项信息 |--ids |是 |int | 规格ids |--spec_value |否 |int | 拼接规格名称 |--image |是 |float | 规格图片 |--sell_price |是 |float | 价格 |--lineation_price |是 |float | 划线价 |--cost_price |是 |float | 成本价 |--stock |是 |int | 库存 |--volume |是 |float | 体积 |--weight |是 |float | 重量 |--bar_code |是 |string | 条形码 **参数示例** ``` { "name":"舒客儿童牙膏换牙儿童牙膏护齿防蛀护龈含氟可吞咽食品级", "code":"122222", "remark":2332, "express_type":1, "express_money":20, "express_template_id":1, "video_source":1, "video_cover":"http://www.likeshop.localhost/uploads/images/background/20201210/6768915899c1f445e43c886ad5e8668a.png", "video":"http://www.likeshop.localhost/uploads/images/background/20201210/6768915899c1f445e43c886ad5e8668a.png", "goods_image":[ "123.png", "12223.png", "122223233.png" ], "category_id":[ 1,2,3 ], "supplier_id":1, "brand_id":2, "stock_warning":100, "virtual_sales_num":200, "sort":20, "status":20, "content":123, "spec_type":2, "spec_value":[ { "spec_name":"选择颜色", "sort":2, "spec_list":[ { "value":"黑巧风暴" }, { "value":"白桃乌龙" } ] }, { "spec_name":"选择版本", "sort":1, "spec_list":[ { "value":"4G" }, { "value":"8G" }, { "value":"12G" } ] } ], "spec_value_list":[ { "ids":"0,0", "spec_value":"黑巧风暴,4G", "image":"", "sell_price":2999, "lineation_price":3299, "cost_price":2000, "stock":1000, "volume":10, "weight":10, "bar_code":202107131607 }, { "ids":"0,1", "spec_value":"黑巧风暴,8G", "image":"", "sell_price":3299, "lineation_price":3599, "cost_price":2200, "stock":1000, "volume":10, "weight":10, "bar_code":202107131607 }, { "ids":"0,2", "spec_value":"黑巧风暴,12G", "image":"", "sell_price":3599, "lineation_price":3799, "cost_price":2400, "stock":1000, "volume":10, "weight":10, "bar_code":202107131607 }, { "ids":"1,0", "spec_value":"白桃乌龙,4G", "image":"", "sell_price":2999, "lineation_price":3299, "cost_price":2000, "stock":1000, "volume":10, "weight":10, "bar_code":202107131607 }, { "ids":"1,1", "spec_value":"白桃乌龙,8G", "image":"", "sell_price":3299, "lineation_price":3599, "cost_price":"2200", "stock":1000, "volume":10, "weight":10, "bar_code":202107131607 }, { "ids":"1,2", "spec_value":"白桃乌龙,12G", "image":"", "sell_price":3599, "lineation_price":3799, "cost_price":2400, "stock":1000, "volume":10, "weight":10, "bar_code":202107131607 } ] } ``` **返回示例** ``` { "code": 1, "show": 0, "msg": "添加成功", "data": [] } ```