---
url: "https://pay.weixin.qq.com/doc/v3/merchant/4012534633-curl.md"
title: "创建代金券批次-请求示例-curl"
doc_id: 4012534633
example_lang: "curl"
---

## curl


> POST

```
curl -X POST \
  https://api.mch.weixin.qq.com/v3/marketing/favor/coupon-stocks \
  -H "Authorization: WECHATPAY2-SHA256-RSA2048 mchid=\"1900000001\",..." \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "stock_name" : "微信支付代金券批次",
    "comment" : "零售批次",
    "belong_merchant" : "98568865",
    "available_begin_time" : "2015-05-20T13:29:35.120+08:00",
    "available_end_time" : "2015-05-20T13:29:35.120+08:00",
    "stock_use_rule" : {
      "max_coupons" : 100,
      "max_amount" : 5000,
      "max_amount_by_day" : 400,
      "max_coupons_per_user" : 3,
      "natural_person_limit" : false,
      "prevent_api_abuse" : false
    },
    "pattern_info" : {
      "description" : "微信支付营销代金券",
      "merchant_logo" : "CDN地址",
      "merchant_name" : "微信支付",
      "background_color" : "COLOR010",
      "coupon_image" : "https://qpic.cn/xxx",
      "jump_target" : "PAYMENT_CODE",
      "mini_program_appid" : "wx23232232323",
      "mini_program_path" : "/path/index/index"
    },
    "coupon_use_rule" : {
      "coupon_available_time" : {
        "fix_available_time" : {
          "available_week_day" : [
            1
          ],
          "begin_time" : 0,
          "end_time" : 3600
        },
        "second_day_available" : false,
        "available_time_after_receive" : 7
      },
      "fixed_normal_coupon" : {
        "coupon_amount" : 100,
        "transaction_minimum" : 100
      },
      "goods_tag" : [
        "123321"
      ],
      "trade_type" : [
        "MICROAPP"
      ],
      "combine_use" : false,
      "available_items" : [
        "123321"
      ],
      "unavailable_items" : [
        "789987"
      ],
      "available_merchants" : [
        "9856000"
      ],
      "limit_card" : {
        "name" : "精粹白金",
        "bin" : [
          "62542688"
        ]
      }
    },
    "no_cash" : false,
    "stock_type" : "NORMAL",
    "out_request_no" : "example_out_request_no",
    "ext_info" : "{'exinfo1':'1234','exinfo2':'3456'}"
  }'

```
