promotion.md 6.96 KB

#用户优惠券接口

接口列表

接口名称 接口描述
app.promotion.queryCoupon 查询优惠券的列表信息
app.promotion.queryBirthCoupon 查询生日券列表 发送生日券
app.promotion.getCoupon 用户领券

接口描述

1、查询优惠券的列表信息(app.promotion.queryCoupon)

请求参数

Param Name Param Type Required Param Value Desc
method String true app.promotion.queryCoupon 请求方法
couponType int true 4 券类型 1 A券 2 B券 3 公开券4 生日券5 免邮券

响应内容

2、查询生日券列表(app.promotion.queryBirthCoupon)

请求参数

Param Name Param Type Required Param Value Desc
method String true app.promotion.queryBirthCoupon 请求方法
couponType int true 4 券类型 1 A券 2 B券 3 公开券4 生日券5 免邮券
uid int true 7893817 用户ID

响应内容

{
    "alg": "SALT_MD5",
    "code": 200,
    "data": [
        {
            "couponAmount": 50,
            "couponCode": "",
            "couponName": "12月生日券-满199减50",
            "endTime": "2017-01-31 09:45:40",
            "id": 2030,
            "startTime": "2013-12-01 00:00:00",
            "status": 1,
            "useLimit": "199",
            "useLimitType": "2"
        },
        {
            "couponAmount": 300,
            "couponCode": "",
            "couponName": "12月生日券-满799减300",
            "endTime": "2017-01-31 09:45:40",
            "id": 2033,
            "startTime": "2013-12-01 00:00:00",
            "status": 1,
            "useLimit": "799",
            "useLimitType": "2"
        },
        {
            "couponAmount": 50,
            "couponCode": "",
            "couponName": "1月生日券-满199减50",
            "endTime": "2017-01-31 09:45:40",
            "id": 2035,
            "startTime": "2014-01-01 00:00:00",
            "status": 1,
            "useLimit": "199",
            "useLimitType": "2"
        },
        {
            "couponAmount": 300,
            "couponCode": "",
            "couponName": "1月生日券-满799减300",
            "endTime": "2017-01-31 09:45:40",
            "id": 2038,
            "startTime": "2014-01-01 00:00:00",
            "status": 1,
            "useLimit": "799",
            "useLimitType": "2"
        }
    ],
    "md5": "c957283765172838f577de4228d45a42",
    "message": "请求成功"
}

3、用户领券(app.promotion.getCoupon)

请求参数

Param Name Param Type Required Param Value Desc
method String true app.promotion.getCoupon 请求方法
uid int true 7893817 用户ID
couponId int true 23121 券id

响应内容

成功响应:
{
    "alg": "SALT_MD5",
    "code": 200,
    "data": {
      "123456abcdef"
    },
    "md5": "50d19f5f5098c34607018f144baec14a",
    "message": "操作成功"
}

错误响应:
{
  "code": 402,
  "message": "优惠券不存在"
}

{
  "code": 306,
  "message": "很抱歉!您的用户身份类型不可使用该券"
}

{
  "code": 401,
  "message": "优惠券已经领取"
}

4、查询优惠券中心(app.promotion.queryCouponCenter)

请求参数

Param Name Param Type Required Param Value Desc
method String true app.promotion.queryCouponCenter 请求方法
uid String false 7893817 用户ID
contentCode String true b38b9c4f1c76f89533e9214629b458e4 资源位内容码

响应内容

成功响应:
{
  "alg": "SALT_MD5",
  "code": 200,
  "data": [
    {
      "data": {
        "list": [
          {
            "src": "http://img11.static.yhbimg.com/yhb-img01/2016/04/13/06/019bd2c1581f881c8ea22daf0e39a4a9ab.png?imageView/{mode}/w/{width}/h/{height}",
            "url": []
          },
          {
            "src": "http://img12.static.yhbimg.com/yhb-img01/2016/04/13/06/02576fa876ccfbfe0648b4e2dabb989b6f.png?imageView/{mode}/w/{width}/h/{height}",
            "url": []
          },
          {
            "src": "http://img11.static.yhbimg.com/yhb-img01/2016/04/13/06/01362e8c56fd6ac56ad3852b6a192e5336.png?imageView/{mode}/w/{width}/h/{height}",
            "url": []
          }
        ],
        "speed": "3"
      },
      "template_id": 1111253,
      "template_intro": "轮播banner",
      "template_name": "carousel_banner"
    },
    {
      "data": {
        "couponID": "2516,2376",
        "hasNum": 99999,
        "status": 1,
        "goShopping": "http://item.m.yohobuy.com/product/pro_325933_419711/XiongJiaYouPin619081838990XiongJiaYouPinChuangYiLanRenTanZhuTuiKuan.html",
        "image": {
          "src": "http://img12.static.yhbimg.com/yhb-img01/2016/01/19/01/02f639de49d79ece0cf86a2f214be781da.jpg?imageView/{mode}/w/{width}/h/{height}",
          "url": "http://2percent.yohobuy.com/?gender=2,3\n"
        },
        "isShow": "YES",
        "title": "标题内容"
      },
      "template_id": 1111255,
      "template_name": "getCoupon"
    },
    {
      "data": {
        "couponID": "2516,2376",
        "hasNum": 99999,
        "status": 3,
        "goShopping": "http://item.m.yohobuy.com/product/pro_325933_419711/XiongJiaYouPin619081838990XiongJiaYouPinChuangYiLanRenTanZhuTuiKuan.html",
        "image": {
          "src": "http://img12.static.yhbimg.com/yhb-img01/2016/01/19/01/02f639de49d79ece0cf86a2f214be781da.jpg?imageView/{mode}/w/{width}/h/{height}",
          "url": "http://2percent.yohobuy.com/?gender=2,3\n"
        },
        "isShow": "YES",
        "title": "标题内容"
      },
      "template_id": 1111257,
      "template_name": "getCoupon"
    }
  ],
  "md5": "8febf00780011298f4a0530b6441827b",
  "message": "请求成功"
}

备注:status 1:可领取 2:已抢光 3:已领取

5、用户批量领券(app.promotion.getBatchCoupon)

请求参数

Param Name Param Type Required Param Value Desc
method String true app.promotion.getCoupon 请求方法
uid String true 7893817 用户ID
couponIds int true 23121,45231 券id列表

响应内容

成功响应:
{
    "alg": "SALT_MD5",
    "code": 200,
    "data": {
    },
    "md5": "50d19f5f5098c34607018f144baec14a",
    "message": "操作成功"
}