您所在位置: 首页 > > 促销API
  • gome.promotion.promotion.create创建促销

  • 简要描述
  • 系统级输入参数
  • 应用级输入参数
  • 请求示例
  • 返回结果参数
  • 返回示例
  • 异常码
  • 系统级异常码
  • API工具
  • 名称 类型 必须 描述
    $app String 应用的app_key
    $method String API接口名称
    $sign String 签名
    $token String 采用OAuth授权方式为必填参数
    $v String API协议版本,可选值:1.0.0
  • 名称 类型 必须 示例值 描述
    relationId String 第三方方案id(终止操作使用)
    promotionName String 方案名称
    promotionDesc String 方案描述
    startTime Date 活动开始时间
    endTime Date 活动结束时间
    promotionType String 活动类型,ZJ直降,PT拼团,TG团购,QG抢购
    orderLimitNumber Integer 每单限购数量
    preHeatDate Integer 预热时间 单位:小时,0:无需预热,1,4,8,24,48
    showChannel Integer 频道展示(抢购) 0展示频道页,1不展示频道页
    shoppingFlow String 显示站点 mainSite:主站
    shippingFee Integer 运费设置 1:同主站2:免运费
    deviceLimit Integer 设备ID参与次数 0:持续到拼团结束 1,4,8,24小时
    userLimit Integer 设用户ID参与次数
    groupPeopleNumber Integer 成团人数
    groupFrequency Integer 开团次数(拼团活动单用户最大可开团次数)
    duration Integer 团抢持续时间 0:持续到拼团结束 1,4,8,24小时
    freeShipping String 是否包邮
    robot String 机器人开团
    promotionGoodsJson String [{"skuNo":"SKU","price":10.0,"quantity":100,"categoryCode3":"商城3级分类","brand":"品牌,可空","increasedSales":0},{"skuNo":"SKU","price":10.0,"quantity":100,"categoryCode3":"商城3级分类","brand":"品牌,可空","increasedSales":0}] 商品信息JSON,其中increasedSales为灌水的数量
  • Java


    GmosClient client = new DefaultGmosClient(url, appKey, secret, token);
    GomePromotionPromotionCreateRequest request = new GomePromotionPromotionCreateRequest();
      //详细参数信息请参考API详情页面。
        request.setRelationId("");
        request.setPromotionName("");
        request.setPromotionDesc("");
        request.setStartTime();
        request.setEndTime();
        request.setPromotionType("");
        request.setOrderLimitNumber();
        request.setPreHeatDate();
        request.setShowChannel();
        request.setShoppingFlow("");
        request.setShippingFee();
        request.setDeviceLimit();
        request.setUserLimit();
        request.setGroupPeopleNumber();
        request.setGroupFrequency();
        request.setDuration();
        request.setFreeShipping("");
        request.setRobot("");
        request.setPromotionGoodsJson("[{"skuNo":"SKU","price":10.0,"quantity":100,"categoryCode3":"商城3级分类","brand":"品牌,可空","increasedSales":0},{"skuNo":"SKU","price":10.0,"quantity":100,"categoryCode3":"商城3级分类","brand":"品牌,可空","increasedSales":0}]");
    GomePromotionPromotionCreateResponse response = client.execute(request);
    System.out.println(response.getBody());


    PHP


    require_once('GmosSdk.php');
    
    $client = new GmosClient;
      $client -> appkey = "";
      $client -> secretKey = "";
      $client -> session = "";
      $client -> gatewayUrl = "";
    
      $request = new GomePromotionPromotionCreateRequest;
      //详细参数信息请参考API详情页面。
        $request -> setRelationId("");
        $request -> setPromotionName("");
        $request -> setPromotionDesc("");
        $request -> setStartTime();
        $request -> setEndTime();
        $request -> setPromotionType("");
        $request -> setOrderLimitNumber();
        $request -> setPreHeatDate();
        $request -> setShowChannel();
        $request -> setShoppingFlow("");
        $request -> setShippingFee();
        $request -> setDeviceLimit();
        $request -> setUserLimit();
        $request -> setGroupPeopleNumber();
        $request -> setGroupFrequency();
        $request -> setDuration();
        $request -> setFreeShipping("");
        $request -> setRobot("");
        $request -> setPromotionGoodsJson("[{"skuNo":"SKU","price":10.0,"quantity":100,"categoryCode3":"商城3级分类","brand":"品牌,可空","increasedSales":0},{"skuNo":"SKU","price":10.0,"quantity":100,"categoryCode3":"商城3级分类","brand":"品牌,可空","increasedSales":0}]");
    $response = $client -> execute($request);


    Net


    IGmosClient client = new DefaultGmosClient(url, appKey, secret, token);
    GomePromotionPromotionCreateRequest request = new GomePromotionPromotionCreateRequest();
    
    request.RelationId="";
    request.PromotionName="";
    request.PromotionDesc="";
    request.StartTime=;
    request.EndTime=;
    request.PromotionType="";
    request.OrderLimitNumber=;
    request.PreHeatDate=;
    request.ShowChannel=;
    request.ShoppingFlow="";
    request.ShippingFee=;
    request.DeviceLimit=;
    request.UserLimit=;
    request.GroupPeopleNumber=;
    request.GroupFrequency=;
    request.Duration=;
    request.FreeShipping="";
    request.Robot="";
    request.PromotionGoodsJson="[{"skuNo":"SKU","price":10.0,"quantity":100,"categoryCode3":"商城3级分类","brand":"品牌,可空","increasedSales":0},{"skuNo":"SKU","price":10.0,"quantity":100,"categoryCode3":"商城3级分类","brand":"品牌,可空","increasedSales":0}]";
    
    GomePromotionPromotionCreateResponse response = client.Execute(request);
  • 错误码 错误消息
  • 错误码 错误消息
    10001 系统错误
    10002 方法调用次数超限
    10003 当前版本的方法不存在,请检查
    10004 缺少版本参数,请指定服务方法的版本号
    10005 该应用在当前IP下禁止访问
    8224 缺少签名参数,请添加签名请求参数
    8999 存在重复的请求,请在90秒之后再请求第二次
    8225 签名无效,请按正确的算法对请求数据进行签名
    9000 字段%s不能为空
    8249 超过上传限制
    8223 无效的appKey,请使用合法的appKey(由服务提供商授予你)
    8239 需要传递accessToken参数
    8222 缺少appKey,请向服务端获取合法的appKey
    20001 令牌已过期