# Merchant confirmed a correction to the lottery incident

In order to prevent the introduction of coupons when they are not connected to the ability to collect coupons, causing problems in which the coupons cannot be collected, the correction of the voucher collection event needs to be confirmed before being connected.

This API must be called to turn on the voucher function before any other API, such as creating vouchers, can be called.

# Be careful

In order to prevent a correction conflict that results in a voucher receipt error, the final correction address is the address at which the correction was confirmed at the latest.

# Dxplaination of Interface Call Request

http请求方式:POST
https://api.weixin.qq.com/shop/coupon/confirm?access_token=xxxxxxxxx

# Example of request parameters

{
}

# Examples of back-up

{
  "errcode": 0
}

# Dispatching the request logic

WeChat After receiving the API request, it will actively call back the receipt event of the merchant's fixed information, and the merchant needs to return the results shown below to confirm, otherwise it can not call the other API.

# Example of callback request parameters

Depending on the data format (json or xml) set by the merchant, take xml as 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>

# Example of a callback callback

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

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

# Dxplaination of callback request parameters

参数 type Introductions
ToUserName string Merchant Weixin Mini Program Name
FromUserName string WeChat OpenID for teams (fixed value)
CreateTime number Event time, Unix timestamp, in seconds
MsgType string Message type, fixed as event
Event string Event type, this interface is fixed to open_product_receive_coupon
out_coupon_id string Business side coupon ID, business confirmation fixed as test_coupon
request_id string Request unique ID, the merchant confirms fixed as test_coupon_request_id

# Dxplaination of callback callback parameters

参数 type Introductions
ret_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 as test_coupon
request_id string Request unique ID, the merchant confirms fixed as test_coupon_request_id