优惠券数据

接口说明

二维火提供优惠券数据接口,第三方系统可通过此接口对接优惠券数据

二维火商户和第三方系统商户进行id匹配;

接口定义

请求URL:

http://{servename}/router(二维火提供查询)

1、获取优惠券列表信息

method="dfire.shop.query.promotion"

传递参数为:

字段说明 字段名 类型 可空(Y/N) 举例
店铺Id entityId String N 连锁或门店ID
品牌Id plateEntityId String N  

传递form表单参数实例:

appKey:cdc08577b61942442aa89390dacb25ad
timestamp:1476255107097
sign:DF0719FCD2B0CE188307595BB39F5DE9488DD57E
v:1.0
method:dfire.shop.query.promotion
entityId:99927548
plateEntityId:99927571

返回参数为:

字段说明 字段名 类型 可空(Y/N) 默认值
优惠券信息 PromotionVo Object N  
[PromotionVo]店铺结构
字段说明 字段名 类型 可空(Y/N) 备注
优惠券ID id String N  
店铺ID entityId String N  
品牌Id plateEntityId String N  
优惠券标题 title String N  
开始时间 startTime String N  
结束时间 endTime Long N  
适用门店 chainStoreIds Long N  
第三方优惠券Id thirdPromotionId String N  

返回参数 实例:


{

"success": true,

"model": [

{

"id": "00084611eDearhM2QAL9dJkkivhGBz",

"entityId": "00084611",

"plateEntityId": "00084611",

"title": "优惠券11元全场现金券",

"startTime": 1496246400000,

"endTime": 1498752000000,

"chainStoreIds": [

"00026863"

],

"thirdPromotionId": "4"

}

],

"totalRecord": 0

}


2、发放优惠券

method="dfire.shop.deliver.promotion"

传递参数为:

字段说明 字段名 类型 可空(Y/N) 举例
店铺Id entityId String N 连锁或门店ID
品牌Id plateEntityId String N 如单店则传单店的entityID
优惠券Id promotionId String N  
公众号appid appid String N  
openid openid String N  
手机号码 mobile String N  
卡券code thirdDeliverCode String N  

传递form表单参数实例:

appKey:cdc08577b61942442aa89390dacb25ad
timestamp:1476255107097
sign:DF0719FCD2B0CE188307595BB39F5DE9488DD57E
v:1.0
method:dfire.shop.deliver.promotion
entityId:99927548
plateEntityId:99927571
promotionId:1001
appid:wxa*********27822
openid:o3Pm6uD6KVk
mobile:150********
thirdDeliverCode:
 1

返回参数为:

字段说明 字段名 类型 可空(Y/N) 默认值
领取主键id promotionCustomerId String N  
用户id customerregisterId String N  
优惠券券id promotionId String N  
优惠名称 name String N  
开始时间 starttime Long N  
结束时间 endtime Long N  
是否能继续领 canDeliver boolean N  
领券时间 delivertime Long N  
领取是否成功 deliverSuccess boolean N  
卡券code thirdDeliverCode String N  

返回参数 实例:


{

"success": true,

"model": {

"promotionCustomerId": "00104454ey0HjkV9QmX8btuT9X3VlW",

"customerregisterId": "22863e1cca9d4811b845c73ecd0912cd",

"promotionId": "0010445469WUq4BDQZvbO1bDWMAx0a",

"name": "折扣券1.0折",

"starttime": 1498141243097,

"endtime": 1498752000000,

"canDeliver": true,

"delivertime": 1498141243097,

"deliverSuccess": true,

"thirdDeliverCode": "16"

}, "totalRecord": 0

}


3、查询用户优惠券

method="dfire.shop.customer.query.promotion"

传递参数为:

字段说明 字段名 类型 可空(Y/N) 举例
店铺Id entityId String N 连锁或门店ID
品牌Id plateEntityId String N 如单店则传单店的entityID
appid appid String N 公众号APPID
openid openid String N 微信openid
查询日期 currDate String N 20170601

传递form表单参数实例:

appKey:cdc08577b61942442aa89390dacb25ad
timestamp:1476255107097
sign:DF0719FCD2B0CE188307595BB39F5DE9488DD57E
v:1.0
method:dfire.shop.customer.query.promotion
entityId:99927548
plateEntityId:99927571
appid:wxa*********27822
openid:o3Pm6uD6KVk
currDate:20170601

返回参数为:

字段说明 字段名 类型 可空(Y/N) 默认值
连锁Id brandEntityId String N  
品牌Id plateEntityId String N  
店铺Id entityId String N  
openid openid String N  
APPId appid String N  
卡券code thirdDeliverCode String N  
状态 status int N 1、已使用,2、已转增

返回参数 实例:

{
  "success": true,

  "model": [
    {
      "entityId": "99929155",

      "openid": "oUA7t************wjhJ0",

      "thirdDeliverCode": "9170616980313735",

      "status": 1,

      "appid": "wxee**********0c",

      "plateEntityId": "99927571",

      "brandEntityId": "99927548",

      "promotionCustomerId": "999275713cR530yekwbaBSaTVRrVCO",

      "customerRegisterId": "285c122f62784f3b9ba060c9459e9dcf"

    }
  ],
  "totalRecord": 0
}

4、保存优惠券信息

method="dfire.shop.save.promotion"

传递参数为:

字段说明 字段名 类型 可空(Y/N) 说明
优惠券类型 promotionType String Y 不传默认是1:优惠券活动, 传5:菜品券(单品券)
appid appid String N  
优惠券Id promotionId String N  
卡券类型 cardType String N 默认值:GENERAL_COUPON
店铺Id entityId String N 单店或连锁ID
品牌Id plateEntityId String N  
优惠名称 title String N  
开始时间 startTime String N  
结束时间 endTime String N  
折扣模块 modeList String N {"modeType":"1","discount":90}或者{"modeType":"2","saveMoney":90}或者{"modeType":"4","saleMoney":28} 注意:PromotionType5+ModeType2 = 菜品现金券,PromotionType5+ModeType1 = 菜品折扣券,PromotionType5+ModeType4 = 菜品特价券(菜品减至券)
使用规则 ruleList String N  
发行数量 totalNum String N  
动态时间(天) dynamicDate String Y 顾客领券后多少天内有效
使用范围 useRangeTypes String Y 0 堂食 ,1 外卖
[modeList]折扣模块

折扣券

字段说明 字段名 类型 可空(Y/N) 备注
类型 modeType String N 1:折扣券
折扣 discount String N 百分制,例90

代金券

字段说明 字段名 类型 可空(Y/N) 备注
类型 modeType String N 2:代金券
金额 saveMoney String N 单位:分,100的整数

菜品特价券(promotionType=5)

字段说明 字段名 类型 可空(Y/N) 备注
类型 modeType String N 4:特价券
金额 saleMoney String N 单位:分,100的整数
[ruleList]使用规则
字段说明 字段名 类型 可空(Y/N) 备注
不能使用的日期 canNotUseDate String Y 2017.06.22-2017.06.23,2017.06.26-2017.06.26
有效日期 canUseDate String Y 2017.06.25-2017.06.25,2017.06.27-2017.06.30
每周有效日 canUseDateInWeek String Y 1,2,3,4,5; 从星期天开始
有效时间段 canUseTime String Y 00:00-11:00,14:00-17:00,22:00-23:59
连锁适用门店 chainSuitShopRule String Y 99612548,99658450
最低消费金额(分) minPayMoney int Y 1000
每人最多可领数量 perPersonCanGetCouponMaxNum int Y 默认100
每人每天可领数量 perPersonPerDayCanGetCouponNum int Y 默认100
菜品ID menuIds String Y promotionType=5菜品券必传,格式:1,2,3

传递form表单参数实例:

appKey:cdc08577b61942442aa89390dacb25ad
timestamp:1476255107097
sign:DF0719FCD2B0CE188307595BB39F5DE9488DD57E
v:1.0
method:dfire.shop.save.promotion
appid:wx************822
promotionId:1001
cardType:GENERAL_COUPON
entityId:99927548
plateEntityId:99927571
title:9折优惠券
startTime:20170601
endTime:201706030
modeList:{"modeType":"1","discount":90}
ruleList:{"canNotUseDate":"","canUseDate":"","canUseDateInWeek":"","canUseTime":"","chainSuitShopRule":"00026863","minPayMoney":0,"perPersonCanGetCouponMaxNum":10,"perPersonPerDayCanGetCouponNum":0}
totalNum:100
dynamicDate:
useRangeTypes:

返回参数为:

字段说明 字段名 类型 可空(Y/N) 默认值
Id 优惠券Id String N  

返回参数 实例:

{
  "success": true,

  "model": [
    {
      "285c122f62784f3b9ba060c9459e9dcf"
    }
  ],
  "totalRecord": 0
}

5、第三方优惠券核销

method="dfire.shop.verify.promotion"

传递参数为:

字段说明 字段名 类型 可空(Y/N) 举例
店铺Id entityId String N  
品牌Id plateEntityId String N  
优惠券Id promotionId String N  
appid appid String N  
openid openid String N  
手机号码 mobile String Y  
卡券code thirdDeliverCode String N  
订单Id orderId String N  
订单日期 orderDate String N  
实付金额 needFee String N 单位:分
优惠金额 savedFee String N 单位:分

传递form表单参数实例:

appKey:cdc08577b61942442aa89390dacb25ad
timestamp:1476255107097
sign:DF0719FCD2B0CE188307595BB39F5DE9488DD57E
v:1.0
method:dfire.shop.verify.promotion
entityId:99927548
plateEntityId:99927571
promotionId:1001
appid:wxa*********822
openid:o3Pm*********G1bXqLc
mobile:150*********
thirdDeliverCode:
 100101
orderId:20170601001
orderDate:20170601
needFee:1000
savedFee:100

返回参数为:

字段说明 字段名 类型 可空(Y/N) 默认值
操作状态   Boolean N  

返回参数 实例:

{
  "success": true,

  "model": [
    {
      true
    }
  ],
  "totalRecord": 0
}

6、删除优惠券

method="dfire.shop.delete.promotion"

传递参数为:

字段说明 字段名 类型 可空(Y/N) 举例
店铺Id entityId String N  
品牌Id plateEntityId String N  
优惠券Id promotionId String N  

传递form表单参数实例:

appKey:cdc08577b61942442aa89390dacb25ad
timestamp:1476255107097
sign:DF0719FCD2B0CE188307595BB39F5DE9488DD57E
v:1.0
method:dfire.shop.delete.promotion
entityId:99927548
plateEntityId:99927571
promotionId:1001

返回参数为:

字段说明 字段名 类型 可空(Y/N) 默认值
操作状态   Boolean N  

返回参数 实例:

{
  "success": true,

  "model": [
    {
      true
    }
  ],
  "totalRecord": 0
}

7、转增优惠券

method="dfire.shop.delete.promotion"

传递参数为:

字段说明 字段名 类型 可空(Y/N) 举例
店铺Id entityId String N  
品牌Id plateEntityId String N  
优惠券Id promotionId String N  
appid appid String N  
原openid fromOpenid String N  
现openid toOpenid String N  
手机号码 mobile String N  
卡券code thirdDeliverCode String N  

传递form表单参数实例:

appKey:cdc08577b61942442aa89390dacb25ad
timestamp:1476255107097
sign:DF0719FCD2B0CE188307595BB39F5DE9488DD57E
v:1.0
method:dfire.shop.verify.promotion
entityId:99927548
plateEntityId:99927571
promotionId:1001
appid:wxa5**********27822
fromOpenid:o3Pm6uD6KVk
toOpenid:o3Pm6uDS7vjSa
mobile:150******
thirdDeliverCode:
 100101

返回参数为:

字段说明 字段名 类型 可空(Y/N) 默认值
操作状态   Boolean N  

返回参数 实例:

{
  "success": true,

  "model": [
    {
      true
    }
  ],
  "totalRecord": 0
}

8、删除用户优惠券

method="dfire.shop.delete.customer.promotion"

传递参数为:

字段说明 字段名 类型 可空(Y/N) 举例
店铺Id entityId String N  
品牌Id plateEntityId String N  
优惠券Id promotionId String N  
appid appid String N  
openid openid String N  
手机号码 mobile String N  
卡券code thirdDeliverCode String N  

传递form表单参数实例:

appKey:cdc08577b61942442aa89390dacb25ad
timestamp:1476255107097
sign:DF0719FCD2B0CE188307595BB39F5DE9488DD57E
v:1.0
method:dfire.shop.verify.promotion
entityId:99927548
plateEntityId:99927571
promotionId:1001
appid:wxa5**********27822
openid:o3Pm6uD6KVk
mobile:150******
thirdDeliverCode:
 100101

返回参数为:

字段说明 字段名 类型 可空(Y/N) 默认值
操作状态   Boolean N  

返回参数 实例:

{
  "success": true,

  "model": [
    {
      true
    }
  ],
  "totalRecord": 0
}

9、核销优惠券消息推送(POST)


传递参数为:

字段说明 字段名 类型 可空(Y/N) 默认值
方法名 method String N dfire.shop.promotion.change.push
用户key appKey String N  
时间戳 timestamp String N  
签名数字 sign String N  
版本号 v String N  
店铺Id entityId String N  
优惠券id promotionId String N  
用户Id openid String N  
卡券code thirdDeliverCode String N  
连锁Id brandEntityId String N  
品牌Id plateEntityId String N  

传递form表单参数实例:

appKey:cdc08577b61942442aa89390dacb25ad
timestamp:1476255107097
sign:DF0719FCD2B0CE188307595BB39F5DE9488DD57E
v:1.0
method:dfire.shop.verify.promotion
entityId:99927548
plateEntityId:99927571
promotionId:1001
openid:o3Pm6uD6KVk
thirdDeliverCode:
 100101
brandEntityId:99927548
plateEntityId:99927571

返回参数为:

字段说明 字段名 类型 可空(Y/N) 默认值
操作状态   Boolean N  

返回参数 实例:


{

"success": true,

"resultCode": "000",

"message": "操作成功!"

}