开发指南 官网
API 2.0 > 7.4 优惠券相关操作 > 7.4.6 筛选用户可用优惠券

7.4.6 筛选用户可用优惠券

开启令牌和权限后可调用。签名方式请查看开发指南
场景描述:通过商品标识码筛选用户可用优惠券

请求地址

请求方式 版本信息 请求地址
POST V2 http://openapi.zvcms.com/api/v2

公共参数

参数 参数类型 是否必填 默认值 描述
OpenId string 密钥Id
GrantCode string 授权code
Token string 签名,参考《数字签名sign》
Timestamp string 当前时间戳
Nonce string 随机正整数
Action string user.user-use-coupon 接口方法
Params array 业务参数

请求参数

参数 参数类型 是否必填 默认值 描述
multi_mark string 门店编码
user_id bigint 用户id
trade_marks array
 ├0 array
  ├num int 商品实体数量
  ├trade_mark string 商品实体标识
  ├price money(元) 商品实体价格
discount_price money(元) 订单折扣金额
type_cate int 1堂食,3外卖
user_code string 会员码, user_id和user_code必传一个, user_id和user_code同时存在取user_id值

响应参数

参数 参数类型 描述
status int 请求成功或失败
code int 成功/错误编码
message string 成功/错误描述
data array
 ├0 array
  ├id int 用户优惠券id 可用于优惠券核销
  ├user_id int 用户id 383933091455959041
  ├coupon_id bigint 优惠券id
  ├start_at int 开始时间
  ├end_at int 结束时间
  ├status int 使用状态'状态 \r\n0-未使用 \r\n1-已使用',
  ├coupon array
   ├id bigint 优惠券模板id【可用于发券,一个券模板id可发放不同数量的券】
   ├type int 优惠券所属平台 1微信 2 口碑',
   ├title string 优惠券名称 【优惠券信息主要看 coupon 数组里的券信息】
   ├total int 优惠券总数量 0-不限制',
   ├number int 已领取的数量
   ├used int 已使用的数量
   ├amount string 优惠券金额/折扣
   ├coupon_type int 优惠形式 \r\n0-指定金额 \r\n1-折扣券'
   ├min_amount_use int 最低使用金额, 0 -不限制
   ├ number_of_user int 每人限领多少张 0-不限制
   ├goods_range_type int 可使用的商品\r\n0-所有商品 \r\n1-指定商品
   ├expire_type int 有效期类型\r\n0-固定日期 \r\n1-领到券当日开始N天内生效 \r\n2-领到券次日开始N天内生效
   ├start_at int 开始时间
   ├end_at int 结束时间
   ├expire_days int N天内生效的N
   ├desc string 使用说明
   ├status Int 状态,是否可用,1可用,0不可用
   ├show_page int 是否显示在商品详情页
   ├scene_type int 适用场景 \r\n1-外卖 \r\n2-堂食 \r\n3-外卖+堂食 \r\n4-买单 \r\n5-外卖+买单 \r\n6-堂食+买单 \r\n7-通用
   ├only_coupon int 是否只享受优惠券优惠: 0 不是 1是
   ├use_per_person_per_day int 每人每天使用次数: 默认值 0 代表不限制
   ├is_receive int 是否可领用: 1 可领用 0 不可领用
   ├ is_use_time_range int 是否使用 时间段: 0 不使用 1使用
   ├category int 0、现金券/折扣券 2、限制数量免单券 3、erp兑换券(线下用) 4、买M送N券 5、商品券 6、免运费/配送费券 7、免排队券 8、停车券
   ├max_num int 免单最高金额的几件商品
   ├min_num int 免单最低金额的几件商品
   ├min_num_use int 订单满几件商品可用 min_amount_use和min_num_use同时满足表示不限制
   ├multi_range_type int 适用门店\r\n0-所有门店 \r\n1-指定门店可用 \r\n2-指定门店不可用
   ├shop_ids int 指定的门店ID,json格式
   ├ explain_text int 优惠券说明
   ├second_max_num int 买M送N券 - 次高金额的几件商品
   ├goods_range_num int 买M送N券 - 购买数量
   ├coupon_label String 券标签
   ├scene_type_desc String 类型说明
   ├coupon_title String 优惠券标题
   ├coupon_amount string 优惠说明
   ├all_coupon_amount string 优惠金额
  ├couponId String 券核销码

请求示例

{
    "OpenId": "6dc05b4ac175cf316d226252b05cf685",
    "GrantCode": "782c281f62",
    "Timestamp": "1547186244",
    "Nonce": "658965",
    "Token": "0%2B%2B3c6hthjwAml4ABAXOYF4Q6UY%3D",
    "Action": "user.user-use-coupon",
    "Params": {
        "multi_mark": "aEtGbNNVQ3m1YStlySDB0Q",
        "user_id": "383933091455959041",
        "trade_marks": [
            {
                "num": "2",
                "trade_mark": "201909280011111",
                "price": "1"
            }
        ],
        "discount_price": "0",
        "type_cate": "1",
        "user_code": ""
    }
} 

响应示例

{
    "status": "true",
    "code": "0",
    "message": "说明",
    "data": [
        {
            "id": "",
            "user_id": "383933091455959041",
            "coupon_id": "390913441022877696",
            "start_at": "1571068800",
            "end_at": "1572796799",
            "status": "0",
            "coupon": {
                "id": "952",
                "type": "",
                "title": "奈雪联调专用现金券",
                "total": "",
                "number": "",
                "used": "",
                "amount": "",
                "coupon_type": "",
                "min_amount_use": "",
                " number_of_user": "",
                "goods_range_type": "",
                "expire_type": "",
                "start_at": "",
                "end_at": "",
                "expire_days": "",
                "desc": "",
                "status": "",
                "show_page": "",
                "scene_type": "",
                "only_coupon": "",
                "use_per_person_per_day": "",
                "is_receive": "",
                " is_use_time_range": "",
                "category": "",
                "max_num": "",
                "min_num": "",
                "min_num_use": "",
                "multi_range_type": "",
                "shop_ids": "",
                " explain_text": "",
                "second_max_num": "",
                "goods_range_num": "",
                "coupon_label": "",
                "scene_type_desc": "",
                "coupon_title": "",
                "coupon_amount": "",
                "all_coupon_amount": ""
            },
            "couponId": "405537296400027648"
        }
    ]
}

异常示例

{
    "status": true,
    "code": "异常编码,根据不同的业务返回编码",
    "message": "异常说明:查询的信息不存在"
}

错误码

{
    "status": false,
    "code": "系统错误编码:详见全局返回编码",
    "message": "系统错误说明"
}

免费升级

营销功能、插件持续每月更新开发升级

免费专业培训

每月建站、微信营销、电商等互联网增值培训

7×24小时服务支持

400电话、QQ、微信、在线等多渠道售后支持

 

安徽智迈科技股份有限公司 版权所有 Copyright 2009-2018 皖公网安备 34019202000074号 增值电信业务经营许可证:皖B2-20170075