# Add a coupon

# Instructions for Interface Calls

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

# Example of request parameters

{
  "coupon": {
    "out_coupon_id": "coupon_id_1",
    "type": 101,  
    "promote_type": 4,
    "coupon_info": {
      "name": "示例优惠券",
      "promote_info": {
        "promote_type": 4,  // 视频号
        "finder": {
          "nickname": "视频号昵称"
        }
      },
      "discount_info": {
        "discount_condition": {
          "product_cnt": 2,
          "product_price": 5000,
          "out_product_ids": [
            "product_id_3",
            "product_id_4"
          ],
          "tradein_info": {
            "out_product_id": "product_id_5",
            "price": 10000
          },
          "buyget_info": {
            "buy_out_product_id": "product_id_1",
            "buy_product_cnt": 3,
            "get_out_product_id": "product_id_2",
            "get_product_cnt": 2131241242
          }
        },
        "discount_num": 9800,
        "discount_fee": 6400
      },
      "receive_info": {
        "start_time": 1625451250,
        "end_time": 1625454250,
        "limit_num_one_person": 10,
        "total_num": 100
      },
      "valid_info": {
        "valid_type": 1,  // 1:商品指定时间区间,2:生效天数,3:生效秒数
        "valid_day_num": 10,
        "valid_second": 3600,
        "start_time": 1625451250,
        "end_time": 1625464250
      }
    }
  }
}

# Examples of back-up

{
    "errcode": 0
}

# Dxplaination of request parameters

参数 type Is it compulsory? Introductions
coupon.out_coupon_id string yes Merchant Side Coupon ID
coupon.type number yes Types of coupons
coupon.promote_type number yes Types of Coupon Promotion
coupon.coupon_info.name string yes The name of the coupon
coupon.coupon_info.promote_info.promote_type number yes Types of Coupon Promotion
coupon.coupon_info.promote_info.finder.nickname string yes Promote your WeChat Channels nickname.
coupon.coupon_info.discount_info.discount_condition.product_cnt number no Number of goods required under preferential conditions
coupon.coupon_info.discount_info.discount_condition.product_price number no The amount to be met under the preferential conditions
coupon.coupon_info.discount_info.discount_condition.out_product_ids string array no Designated product merchant side ID, product coupons required, up to 128
coupon.coupon_info.discount_info.discount_condition.tradein_info.out_product_id string no The merchant side ID for the purchase of goods, the coupon is required
coupon.coupon_info.discount_info.discount_condition.tradein_info.price number no The amount to be paid, in units, required for a replacement coupon
coupon.coupon_info.discount_info.discount_condition.buyget_info.buy_out_product_id string no Buy goods merchant side ID, buy coupons required
coupon.coupon_info.discount_info.discount_condition.buyget_info.buy_product_cnt number no To purchase the number of items, you must buy a gift certificate
coupon.coupon_info.discount_info.discount_condition.buyget_info.get_out_product_id string no Complimentary goods merchant side ID, buy coupons required
coupon.coupon_info.discount_info.discount_condition.buyget_info.get_product_cnt number no For the number of items given out, you must buy a voucher
coupon.coupon_info.discount_info.discount_num number no The number of discounts, such as a 5.1 discount, must be filled in 5,100, and the discount coupon must be (no less than 2 discount).
coupon.coupon_info.discount_info.discount_fee number no The amount of the reduction is in units, the direct reduction coupon, the full reduction coupon must be necessary (not more than 200 yuan), and if it is a product coupon, the applicable goods offer must not be less than 2 percent of the original price, and if it's a store full reduction, the price threshold must not be lower than 2 percent.)
coupon.coupon_info.receive_info.start_time number yes Get Start Time (second time stamp)
coupon.coupon_info.receive_info.end_time number yes Collection Closing Time (second time stamp)
coupon.coupon_info.receive_info.limit_num_one_person number yes Individuals limit the number of tickets to be accepted, only to display them, and when the ticket withdrawal occurs, the accessor determines whether or not it has exceeded the quota.
coupon.coupon_info.receive_info.total_num number yes The total issuance, that is, the initial inventory, is only displayed, and the access party determines whether or not it has exceeded the quota when the quotation correction is made.
coupon.coupon_info.valid_info.valid_type number yes Type of period of validity, 1: item specified time range, 2: number of days in effect, 3: number of seconds in effect
coupon.coupon_info.valid_info.valid_day_num number no Number of days in effect, required when the type of period of validity is 2
coupon.coupon_info.valid_info.valid_second number no Number of validity seconds, required if the type of validity is 3
coupon.coupon_info.valid_info.start_time number no Commencement date (second timestamp), which is required when the validity type is 1
coupon.coupon_info.valid_info.end_time number no Effective end time (second timestamp) which is required when the validity type is 1

# Be careful

A coupon can associate up to 128 commodities.

# Enumeration - type

枚举值 describe
1 Product conditions discount coupons
2 Product full coupons reduced
3 Uniform discount coupons for goods
4 Product direct coupons
5 Product exchange coupons
6 Gift vouchers for merchandise purchase
101 Shop conditions Discount vouchers
102 Shops are full of coupons.
103 Uniform store discount coupons
104 Shop direct discount coupons

# Enumeration - promote_type

枚举值 describe
4 Live streaming on WeChat Channels