API Description
When a user enters the red packet page, the user openid is linked to a red packet ticket, and Weixin pushes the event to the URL entered by the developer (log in to the Weixin Official Accounts Platform and set it in the Developer Center). The pushed content includes user openid, red packet campaign ID, red packet ticket, amount, and the time when the red packet is linked to the user.
Note: Linking the user to a red packet does not mean that the user has opened the red packet. A user who enters the red packet page may or may not open the red packet. But the red packet ticket cannot be linked to another user. Upon its expiration, the red packet is returned to the merchant's Tenpay account.
Example of an XML packet
<xml>
<ToUserName><![CDATA[toUser]]></ToUserName>
<FromUserName><![CDATA[fromUser]]></FromUserName>
<CreateTime>1442824314</CreateTime>
<MsgType><![CDATA[event]]></MsgType>
<Event><![CDATA[ShakearoundLotteryBind]]></Event>
<LotteryId><![CDATA[lotteryid]]></LotteryId>
<Ticket><![CDATA[ticket]]></Ticket>
<Money>88</Money>
<BindTime>1442824313</BindTime>
</xml>
Request Parameters
Field | Description |
---|---|
ToUserName | Developer's Weixin ID |
FromUserName | The user (OpenID) linked to the red packet ID. |
CreateTime | Creation time of message (integral) |
MsgType | Message type: event |
Event | Event type: ShakearoundLotteryBind |
LotteryId | Red packet campaign ID |
ticket | Red packet ticket |
money | Red packet amount |
BindTime | Time when the red packet is linked to the user |