# Merchant confirmed callback coupon event

In order to prevent the issue that coupons cannot be collected when coupons are not accessed, the callback event should be confirmed before accessing.

You must call this API before you can call other APIs such as creating coupons.

# Be careful

In order to prevent callback conflicts, causing coupons to receive error, so the final callback address, to the latest confirmation callback coupon event address shall prevail.

# Interface call request specification

Http request method: POST
https://api.weixin.qq.com/shop/coupon/confirm?access_token=xxxxxxxxx

# Request Parameter Sample

{
}

# Return Package Example

{
	"errcode": 0
}

# Callback request logic

After receiving the API request, WeChat will actively callback the coupon event of the merchant's fixed information. The merchant needs to return the result shown below to confirm, otherwise the other API of the coupon cannot be called.

# Callback request parameter example

Depending on the data format (json or xml) set by the merchant, xml is an example

<xml>
    <ToUserName>gh_abcdefg</ToUserName> 
    <FromUserName>oABCD</FromUserName> 
    <CreateTime>1627747200</CreateTime>
    <MsgType>event</MsgType> 
    <Event>open_product_receive_coupon</Event>
    <out_coupon_id>test_coupon</out_coupon_id>
    <request_id>test_coupon_request_id</request_id>
</xml>

# Callback Back Sample

Depending on the data format (json or xml) set by the merchant, xml is an example

<xml> 
  <out_user_coupon_id>test_coupon_user_coupon_id</out_user_coupon_id>  
  <request_id>test_coupon_request_id</request_id>  
  <right_code>0</right_code>  
  <out_coupon_id>test_coupon</out_coupon_id> 
</xml>

# Callback request parameter explaination

parameter type Introductions
ToUserName string Merchant applet name
FromUserName string WeChat team OpenID(Fixed value)
CreateTime number Event time, Unix timestamp, in seconds
MsgType string Message type, fixed to event
Event string Event type, this interface is fixed to open_product_receive_coupon
out_coupon_id string Merchant side coupon ID, merchant confirmation fixed test_coupon
request_id string Request unique ID, merchant confirmation fixed to test_coupon_request_id

# Callback return parameter specification

parameter type Introductions
right_code number 0: Success
out_user_coupon_id string Merchant side user coupon ID, merchant confirmation fixed as test_coupon_user_coupon_id
out_coupon_id string Merchant side coupon ID, merchant confirmation fixed test_coupon
request_id string Request unique ID, merchant confirmation fixed to test_coupon_request_id