您所在位置: 首页 > > gome.goods.product.add
  •  gome.goods.product.add添加产品的基本信息

    • 系统级输入参数
    • 应用级输入参数
    • 请求示例
    • 返回结果参数
    • 返回示例
    • API工具
    • 名称 类型 必须 描述
      $app String 应用的app_key
      $method String API接口名称
      $sign String 签名
      $token String 采用OAuth授权方式为必填参数
      $v String API协议版本,可选值:1.0.0
    • 名称 类型 必须 示例值 描述
      goods String 情况一:如果templateId输入的是0,1,2,3,goods还是按照原来的要求来填写如:outId~P901,color~红色,sell_price~99,goods_version~3.5,goods_tax~0.13,stock~100,tmp_bar_code~131313,image~http://www.cdntaobao.com/1.jpg||http://www.cdntaobao.com/2.jpg,pros~cpjtSpec_property_3=大卡||cpjtSpec_property_2=2*2cm;outId~P902,color~蓝色,sell_price~876,goods_version~2.5,stock~200,tmp_bar_code~231511,image~http://www.cdntaobao.com/3.jpg||http://www.cdntaobao.com/4.jpg,pros~T31_58=8-40个||S8_85=30升及以上。 情况二:如果templateId输入的是4,即销售属性,需要按照下面规范来填写:outId~bht220,goodsProp~c80c62c4448d:H||8ac55c9d2cf8:蓝色,sell_price~100,goods_tax~0.13,stock~100,image~http://img3.gomeprelive.net.cn/image/bbcimg/production_image/nimg/201604/28/17/18/332369474a5918844b_800.jpg||http://img3.gomeprelive.net.cn/image/bbcimg/production_image/nimg/201604/28/17/18/332369474a5918844b_800.jpg||http://img3.gomeprelive.net.cn/image/bbcimg/production_image/nimg/201604/28/17/18/332369474a5918844b_800.jpg||http://img3.gomeprelive.net.cn/image/bbcimg/production_image/nimg/201604/28/17/18/332369474a5918844b_800.jpg||http://img3.gomeprelive.net.cn/image/bbcimg/production_image/nimg/201604/28/17/18/332369474a5918844b_800.jpg; 其中goodsProp为销售属性标识,c80c62c4448d:H分别为销售属性id和值,对于多个id和值的情况,用||分开。 商品信息(如果tmpBarCode[条形码]输入项不为空,条形码限制为不超过18位字符,只能为数字)
      catalogId String cat18000340 商城分类ID,商品三级分类ID
      shopCtgyId String 292056;222085;130188 店铺分类ID,多个按分号分隔。
      brandId String 19106 商品品牌ID
      productName String _ 商品名称
      description String 这是一件商品 商品描述
      unit String 计量单位
      packingList String _ 包装清单
      saleService String _ 售后服务
      templateId String 3 模板id(和goods中的颜色尺码相关联,只能输入0或1或2或3或4;templateId为0时代表无颜色无版本,为1时代表有颜色无版本,为2时代表无颜色有版本,为3时代表有颜色有版本,为4时代表销售属性)
      props String fuZhuangSpec_property_1=鳄鱼,fuZhuangSpec_property_2=A948273,fuZhuangSpec_property_3=2012 数据来自于gome.goods.itemProps.get根据子类目id获得子类目属性信息;属性串(格式为key=value,多个属性用英文逗号隔开,属性值长度不超过150个字符,例如:fuZhuangSpec_property_1=鳄鱼,fuZhuangSpec_property_2=A948273,fuZhuangSpec_property_3=2012),如果属性值value是复选,多个值之间用“#@#”分隔,例如:fuZhuangSpec_property_5=400ml以下@#50升-80升#@#50升以上
      gift String 降 价 促 销 广告语
      keyWord String 液晶电视,电视,创维液晶电视 搜索关健词,长度限制128个字符,以英文逗号分隔
      propTempletId String fuZhuangSpec 商品模板ID
      freightTempletId String _ 运费模板ID(非必输,不填默认去店铺的默认运费模板)
      mobileDescription String _ 手机简介内容
    • Java


      GmosClient client = new DefaultGmosClient(url, appKey, secret);
      GomeGoodsProductAddRequest request = new GomeGoodsProductAddRequest();
        //详细参数信息请参考API详情页面。
        request.setGoods("情况一:如果templateId输入的是0,1,2,3,goods还是按照原来的要求来填写如:outId~P901,color~红色,sell_price~99,goods_version~3.5,goods_tax~0.13,stock~100,tmp_bar_code~131313,image~http://www.cdntaobao.com/1.jpg||http://www.cdntaobao.com/2.jpg,pros~cpjtSpec_property_3=大卡||cpjtSpec_property_2=2*2cm;outId~P902,color~蓝色,sell_price~876,goods_version~2.5,stock~200,tmp_bar_code~231511,image~http://www.cdntaobao.com/3.jpg||http://www.cdntaobao.com/4.jpg,pros~T31_58=8-40个||S8_85=30升及以上。 情况二:如果templateId输入的是4,即销售属性,需要按照下面规范来填写:outId~bht220,goodsProp~c80c62c4448d:H||8ac55c9d2cf8:蓝色,sell_price~100,goods_tax~0.13,stock~100,image~http://img3.gomeprelive.net.cn/image/bbcimg/production_image/nimg/201604/28/17/18/332369474a5918844b_800.jpg||http://img3.gomeprelive.net.cn/image/bbcimg/production_image/nimg/201604/28/17/18/332369474a5918844b_800.jpg||http://img3.gomeprelive.net.cn/image/bbcimg/production_image/nimg/201604/28/17/18/332369474a5918844b_800.jpg||http://img3.gomeprelive.net.cn/image/bbcimg/production_image/nimg/201604/28/17/18/332369474a5918844b_800.jpg||http://img3.gomeprelive.net.cn/image/bbcimg/production_image/nimg/201604/28/17/18/332369474a5918844b_800.jpg; 其中goodsProp为销售属性标识,c80c62c4448d:H分别为销售属性id和值,对于多个id和值的情况,用||分开。");
        request.setCatalogId("cat18000340");
        request.setShopCtgyId("292056;222085;130188");
        request.setBrandId("19106");
        request.setProductName("_");
        request.setDescription("这是一件商品");
        request.setUnit("件");
        request.setPackingList("_");
        request.setSaleService("_");
        request.setTemplateId("3");
        request.setProps("fuZhuangSpec_property_1=鳄鱼,fuZhuangSpec_property_2=A948273,fuZhuangSpec_property_3=2012");
        request.setGift("降 价 促 销");
        request.setKeyWord("液晶电视,电视,创维液晶电视");
        request.setPropTempletId("fuZhuangSpec");
        request.setFreightTempletId("_");
        request.setMobileDescription("_");
      GomeGoodsProductAddResponse response = client.execute(request);
      System.out.println(response.getBody());


      PHP


      $client = new GmosClient;
        $client -> appkey = $appkey;
        $client -> secretKey = $secret;
        $request = new GomeGoodsProductAddRequest;
        //详细参数信息请参考API详情页面。
        $request -> setGoods("情况一:如果templateId输入的是0,1,2,3,goods还是按照原来的要求来填写如:outId~P901,color~红色,sell_price~99,goods_version~3.5,goods_tax~0.13,stock~100,tmp_bar_code~131313,image~http://www.cdntaobao.com/1.jpg||http://www.cdntaobao.com/2.jpg,pros~cpjtSpec_property_3=大卡||cpjtSpec_property_2=2*2cm;outId~P902,color~蓝色,sell_price~876,goods_version~2.5,stock~200,tmp_bar_code~231511,image~http://www.cdntaobao.com/3.jpg||http://www.cdntaobao.com/4.jpg,pros~T31_58=8-40个||S8_85=30升及以上。 情况二:如果templateId输入的是4,即销售属性,需要按照下面规范来填写:outId~bht220,goodsProp~c80c62c4448d:H||8ac55c9d2cf8:蓝色,sell_price~100,goods_tax~0.13,stock~100,image~http://img3.gomeprelive.net.cn/image/bbcimg/production_image/nimg/201604/28/17/18/332369474a5918844b_800.jpg||http://img3.gomeprelive.net.cn/image/bbcimg/production_image/nimg/201604/28/17/18/332369474a5918844b_800.jpg||http://img3.gomeprelive.net.cn/image/bbcimg/production_image/nimg/201604/28/17/18/332369474a5918844b_800.jpg||http://img3.gomeprelive.net.cn/image/bbcimg/production_image/nimg/201604/28/17/18/332369474a5918844b_800.jpg||http://img3.gomeprelive.net.cn/image/bbcimg/production_image/nimg/201604/28/17/18/332369474a5918844b_800.jpg; 其中goodsProp为销售属性标识,c80c62c4448d:H分别为销售属性id和值,对于多个id和值的情况,用||分开。");
        $request -> setCatalogId("cat18000340");
        $request -> setShopCtgyId("292056;222085;130188");
        $request -> setBrandId("19106");
        $request -> setProductName("_");
        $request -> setDescription("这是一件商品");
        $request -> setUnit("件");
        $request -> setPackingList("_");
        $request -> setSaleService("_");
        $request -> setTemplateId("3");
        $request -> setProps("fuZhuangSpec_property_1=鳄鱼,fuZhuangSpec_property_2=A948273,fuZhuangSpec_property_3=2012");
        $request -> setGift("降 价 促 销");
        $request -> setKeyWord("液晶电视,电视,创维液晶电视");
        $request -> setPropTempletId("fuZhuangSpec");
        $request -> setFreightTempletId("_");
        $request -> setMobileDescription("_");
      $response = $client -> execute($request);
      


      Python


      #详细参数信息请参考API详情页面。
      request = new GomeGoodsProductAddRequest(url, port, "情况一:如果templateId输入的是0,1,2,3,goods还是按照原来的要求来填写如:outId~P901,color~红色,sell_price~99,goods_version~3.5,goods_tax~0.13,stock~100,tmp_bar_code~131313,image~http://www.cdntaobao.com/1.jpg||http://www.cdntaobao.com/2.jpg,pros~cpjtSpec_property_3=大卡||cpjtSpec_property_2=2*2cm;outId~P902,color~蓝色,sell_price~876,goods_version~2.5,stock~200,tmp_bar_code~231511,image~http://www.cdntaobao.com/3.jpg||http://www.cdntaobao.com/4.jpg,pros~T31_58=8-40个||S8_85=30升及以上。 情况二:如果templateId输入的是4,即销售属性,需要按照下面规范来填写:outId~bht220,goodsProp~c80c62c4448d:H||8ac55c9d2cf8:蓝色,sell_price~100,goods_tax~0.13,stock~100,image~http://img3.gomeprelive.net.cn/image/bbcimg/production_image/nimg/201604/28/17/18/332369474a5918844b_800.jpg||http://img3.gomeprelive.net.cn/image/bbcimg/production_image/nimg/201604/28/17/18/332369474a5918844b_800.jpg||http://img3.gomeprelive.net.cn/image/bbcimg/production_image/nimg/201604/28/17/18/332369474a5918844b_800.jpg||http://img3.gomeprelive.net.cn/image/bbcimg/production_image/nimg/201604/28/17/18/332369474a5918844b_800.jpg||http://img3.gomeprelive.net.cn/image/bbcimg/production_image/nimg/201604/28/17/18/332369474a5918844b_800.jpg; 其中goodsProp为销售属性标识,c80c62c4448d:H分别为销售属性id和值,对于多个id和值的情况,用||分开。", "cat18000340", "292056;222085;130188", "19106", "_", "这是一件商品", "件", "_", "_", "3", "fuZhuangSpec_property_1=鳄鱼,fuZhuangSpec_property_2=A948273,fuZhuangSpec_property_3=2012", "降 价 促 销", "液晶电视,电视,创维液晶电视", "fuZhuangSpec", "_", "_")
      try:
        response = request.getResponse()
        print(response)
      except Exception, e:
        print(e)