到位代金券领取接口

一.获取代金券列表

1.请求地址
method:GET
正式:http://www.daoway.cn/daoway/rest/third/coupons
测试:http://test.daoway.cn/daoway/rest/third/coupons

2.请求参数

字段 类型 必须 说明
channel string 渠道号,由到位分配
city string 城市
start int 分页,默认0
size int 分页,默认20

3.返回说明

正确返回:
{
    "status": "ok",
    "data":  [
        {
            "id": "2535fab6777a46c2b1a6d1bac4e06268",
            "name": "到位会员10元专享礼券", //代金券名称
            "type": "daoway", //代金券类型
            "bill": 10, //代金券金额
            "minBill": 150, //最低消费金额
            "note": "订单满150元可使用",
            "serviceTitle": null, //适用店铺
        },
        {
            "id": "5b799fb42dd84c19933f5fcb0c33f4ed",
            "name": "恭喜发财 20元代金券",
            "type": "shangjia",
            "bill": 20,
            "minBill": 350,
            "note": "订单满360元可使用",
            "serviceTitle": "恭喜发财",
        }
    ]
}

错误返回:
{
    "status": "error",
    "msg": "" //错误信息
}

二.领取代金券

1.请求地址
method:POST
正式:http://www.daoway.cn/daoway/rest/third/coupon_receive
测试:http://test.daoway.cn/daoway/rest/third/coupon_receive

2.请求参数

字段 类型 必须 说明
channel string 渠道号,由到位分配
phone string 用手机号
sign string 签名
coupon_id string 代金券id
签名加密方式:
String channel = "gxfc";//渠道号
String phone = "18588888888";//手机号
String secret = "d1586eff9ff2423cb10c501ba09e44d2";//密钥
String param = "channel="+channel+"&phone="+phone+"&secret=" + secret;
String sign = DigestUtils.md5Hex(param.toString().getBytes("UTF-8"));
//DigestUtils的包路径为org.apache.commons.codec.digest.DigestUtils 

把channel,phone,secret 3个参数拼接且顺序不能乱,MD5加密后的值即为sign

3.返回说明

正确返回:
{
    "status": "ok"
}

错误返回:
{
    "status": "error",
    "msg": "" //错误信息
}