Skip to content

批量新建商品

批量新建商品

接口

/product/batchsku/details 拉取批量新建商品

Method: GET

请求:
    spu_ids List M spu_id的列表
响应:
    code: 0
    msg: ok
    data:[
      {
      'spu_id': 'xxxxx',
      'sku_name': 'xxxx' 规格名称,
      'cagtegory_1_name': 'xxxx', 一级分类名字
      'cateogory_2_name': 'xxxx', 二级分类名字
      'pinlei_name': 'xxxx',品类名字
      'spu_name': 'xxxx', spu名字
      'sale_price': INT, 销售价格
      'std_unit_name': 'xxx', 标准规格单位
      'sale_unit_name': 'xxx', 销售规格单位
      'ratio': FLOAT 转化率
      'sale_num_least': INT 最小下单数
      'state': INT 销售状态
      'is_weigh': INT 是否称重
      'stock_type': 1, 2, 3  1代表不设置库存, 2代表自定义库存, 3代表限制库存
      'stock': -99999 代表不限制库存
      'suppliers': [{supplier_id: name}, ...] 供应商列表
      'pur_specs': [{'pur_spec_id': 'xxx', 'std_unit_name': 'xxxx', 'pur_unit_name': 'xxx'}, ...] 采购规格
       }

      ...
    ]

/station/product/batchsku/create 批量新建保存商品

Method: POST
请求:
  skus: [{
        spu_id M 商品对应的spuid
        name M 规格名字
        sale_price M 销售单价
        ratio M 转化率
        sale_unit_name M 销售单位
        sale_num_least M 最小下单数
        is_weigh M INT 0 或 1 , 0表述不称重
        state M INT 0 或 1
        stock_type: 1, 2, 3  1代表不设置库存, 2代表自定义库存, 3代表限制库存
        stock: -99999 代表不限制库存
        supplier_id O 供应商id
        pur_spec_id O 采购规格id
       }
      ...
      ]
  salemenu_id M  str 销售单id
响应:
    code: 0
    msg: ok
    data: NULL

  • 创建逻辑:供应商id可以为空, 如果没有绑定采购规格,则系统自动创建采购规格。

/merchandise/get_tree 返回这个group下的所有公共spu和站点私有spu

Method: GET
请求:
    无
响应:
    code: 0
    msg: ok
    data: {
    [{
      name: 'xxxx',
      category_1_id: 'xxx',
      chtree: [
      {name: 'xxx',
      category_2_id: 'xxxx',
      chtree: [{name: 'xxx', pinlei_id: 'xxx', chtress: [{name: 'xxx', spu_id: 'xxxx'}, ....]}, ....]}]
      }, ...
      ]
    }