# 获取券ID对应的详情内容
接口应在服务器端调用,不可在前端(小程序、网页、APP等)直接调用,具体可参考接口调用指南
接口英文名:getpromotecoupondetail
可通过该接口,可获取券ID对应的详情内容
# 1. 调用方式
# HTTPS 调用
POST https://api.weixin.qq.com/channels/ec/promoter/get_coupon_detail?access_token=ACCESS_TOKEN
# 云调用
- 本接口不支持云调用
# 第三方调用
- 本接口不支持第三方平台调用。
# 2. 请求参数
# 查询参数 Query String parameters
参数名 | 类型 | 必填 | 示例 | 说明 |
---|---|---|---|---|
access_token | string | 是 | ACCESS_TOKEN | 接口调用凭证,可使用 access_token |
# 请求体 Request Payload
参数名 | 类型 | 必填 | 示例 | 说明 |
---|---|---|---|---|
coupon_id | string | 是 | COUPON_ID | 券id |
# 3. 返回参数
# 返回体 Response Payload
参数名 | 类型 | 示例 | 说明 |
---|---|---|---|
errcode | number | 0 | 错误码 |
errmsg | string | ok | 错误信息 |
coupon | object | 券信息,推客的绑定参数列表 | |
next_key | string | - | 分页参数,第一页为空,后面请求返回上一次请求返回的 next_key |
has_more | boolean | - | 是否还有更多 |
# Res.coupon Object Payload
券信息,推客的绑定参数列表
参数名 | 类型 | 说明 |
---|---|---|
coupon_id | string | 券的 id |
type | number | 优惠券类型,枚举值详情请参考下文 |
status | number | 优惠券状态 |
create_time | number | 优惠券创建时间 |
update_time | number | 优惠券更新时间 |
coupon_info | object | coupon_info |
stock_info | object | stock_info |
shop_appid | string | 优惠券所属店铺id |
# Res.coupon.coupon_info Object Payload
coupon_info
参数名 | 类型 | 说明 |
---|---|---|
name | string | 优惠券名称 |
discount_info | object | discount_info |
receive_info | object | receive_info |
valid_info | object | valid_info |
ext_info | object | ext_info |
# Res.coupon.coupon_info.discount_info Object Payload
discount_info
参数名 | 类型 | 说明 |
---|---|---|
discount_condition | object | discount_condition |
discount_num | number | 优惠券折扣数 * 1000, 例如 5.1折-> 5100 |
discount_fee | number | 优惠券减少金额, 单位分, 例如0.5元-> 50 |
# Res.coupon.coupon_info.discount_info.discount_condition Object Payload
discount_condition
参数名 | 类型 | 说明 |
---|---|---|
product_cnt | number | 优惠券使用条件, 满 x 件商品可用 |
product_price | number | 优惠券使用条件, 价格满 x 可用,单位分 |
product_ids | array | 优惠券使用条件, 指定商品 id 可用 |
# Res.coupon.coupon_info.receive_info Object Payload
receive_info
参数名 | 类型 | 说明 |
---|---|---|
start_time | number | 优惠券领用开始时间 |
end_time | number | 优惠券领用结束时间 |
limit_num_one_person | number | 单人限领张数 |
total_num | number | 优惠券领用总数 |
# Res.coupon.coupon_info.valid_info Object Payload
valid_info
参数名 | 类型 | 说明 |
---|---|---|
valid_type | number | 优惠券有效期类型,枚举值详情请参考下文 |
valid_day_num | number | 优惠券有效天数,valid_type=2时才有意义 |
start_time | number | 优惠券有效期开始时间,valid_type=1时才有意义 |
end_time | number | 优惠券有效期结束时间,valid_type=1时才有意义 |
# Res.coupon.coupon_info.ext_info Object Payload
ext_info
参数名 | 类型 | 说明 |
---|---|---|
valid_time | number | 优惠券失效时间 |
invalid_time | number | 优惠券有效时间 |
# Res.coupon.stock_info Object Payload
stock_info
参数名 | 类型 | 说明 |
---|---|---|
issued_num | number | 优惠券剩余量 |
receive_num | number | 优惠券领用但未使用量 |
used_num | number | 优惠券已用量 |
# 4. 注意事项
status优惠券状态
枚举值 | 描述 |
---|---|
1 | 未生效,编辑中 |
2 | 生效 |
3 | 已过期 |
4 | 已作废 |
5 | 已经删除 |
type优惠券类型
枚举值 | 描述 |
---|---|
1 | 商品条件折券, discount_condition.product_ids, discount_condition.product_cnt, discount_info.discount_num 必填 |
2 | 商品满减券, discount_condition.product_ids, discount_condition.product_price, discount_info.discount_fee 必填 |
3 | 商品统一折扣券, discount_condition.product_ids, discount_info.discount_num必填 |
4 | 商品直减券, 如果小于可用的商品中的最小价格会提醒(没有商品时超过50w提醒), discount_condition.product_ids, discount_fee 必填 |
101 | 店铺条件折扣券, discount_condition.product_cnt, discount_info.discount_num必填 |
102 | 店铺满减券, discount_condition.product_price, discount_info.discount_fee 必填 |
103 | 店铺统一折扣券, discount_info.discount_num 必填 |
104 | 店铺直减券, 如果小于可用的商品中的最小价格会提醒(没有商品时超过50w提醒), discount_fee 必填 |
content | content |
valid_type优惠券有效期类型
枚举值 | 描述 |
---|---|
1 | 指定时间范围生效 |
2 | 生效天数 |
# 5. 代码示例
请求示例
{
"coupon_id": "COUPON_ID"
}
返回示例
{
"errcode": "0",
"errmsg": "ok",
"coupon": {
"coupon_id": "111111111",
"type": 103,
"status": 5,
"create_time": 1594885385,
"update_time": 1594886327,
"coupon_info": {
"name": "scs",
"discount_info": {
"discount_num": 9900
},
"receive_info": {
"end_time": 1673110742,
"limit_num_one_person": 1,
"start_time": 1673110742,
"total_num": 100
},
"valid_info": {
"valid_type": 1,
"valid_day_num": 0,
"start_time": 1594828800,
"end_time": 1595433600
}
},
"stock_info": {
"issued_num": 95,
"receive_num": 3,
"used_num": 2
}
}
}
# 6. 错误码
以下是本接口的错误码列表,其他错误码可参考 通用错误码
错误码 | 错误描述 | 解决方案 |
---|---|---|
10024000 | 参数错误 |
# 7. 适用范围
本接口暂未明确可调用账号类型,或在业务中根据调用传参自行确定是否可调用,请已实际调用情况为准。