# 领取优惠券通知

本文档描述服务器端接收的消息或事件,详细说明参见消息推送

事件英文名:channels_ec_coupon_receive

# 接口说明

微信小店会通过该接口向商户发送领取优惠券的通知。

相关 API 接口:

# 1. 消息参数

# 请求体 Request Payload

参数名类型说明
ToUserNamestring小店UserName
FromUserNamestring领券用户的OpenID
CreateTimenumber事件时间,Unix时间戳。即格林威治时间1970年01月01日00时00分00秒(北京时间1970年01月01日08时00分00秒)起至现在的总秒数
MsgTypestring消息类型,固定为 event
Eventstring事件类型,本接口固定为 channels_ec_coupon_receive
receive_infoobject事件主体

# Body.receive_info Object Payload

事件主体

参数名类型说明
coupon_idstring优惠券ID
user_coupon_idstring用户优惠券ID
receive_timestring领券时间

# 2. 消息返回

# 返回体 Response Payload

回复 success 或空字符串(无需加密)

# 3. 注意事项

  • 回调url设置和消息推送规则需参考消息推送文档 ,如果设置的回调url无法访问,商户将无法收微信小店发送的通知;

# 4. 代码示例

请求示例

{
    "ToUserName": "gh_*",
    "FromUserName": "OpenID",
    "CreateTime": 1662480000,
    "MsgType": "event",
    "Event": "channels_ec_coupon_receive",
    "receive_info": {
        "coupon_id": "19126",
        "user_coupon_id": "29730",
        "receive_time": "1662480000"
    }
}

返回示例

success