添加商品券批次组

更新时间:2025.11.27

品牌方可以通过该接口为已有的「多次优惠」商品券添加更多批次组,每个批次组创建时会批量创建多个商品券批次。同一个商品券的多个批次组可以实现品牌方多样化的投放需求。

前置条件:已创建商品券且商品券的 usage_mode 为 PROGRESSIVE_BUNDLE

频率限制:20/s

接口说明

支持商户:【品牌商户】

请求方式:【POST】/brand/marketing/product-coupon/product-coupons/{product_coupon_id}/stock-bundles

请求域名:【主域名】https://api.mch.weixin.qq.com 使用该域名将访问就近的接入点

     【备域名】https://api2.mch.weixin.qq.com 使用该域名将访问异地的接入点 ,指引点击查看

请求参数

Header  HTTP头参数

 Authorization  必填 string

请参考签名认证生成认证信息


 Accept  必填 string

请设置为application/json


 Content-Type  必填 string

请设置为application/json


 Wechatpay-Serial  必填 string

【微信支付公钥ID】  请传入brand_id对应的微信支付公钥ID,接口将会校验两者的关联关系,参考微信支付公钥产品简介及使用说明获取微信支付公钥ID和相关的介绍。以下两种场景将使用到微信支付公钥: 1、接收到接口的返回内容,需要使用微信支付公钥进行验签; 2、调用含有敏感信息参数(如姓名、身份证号码)的接口时,需要使用微信支付公钥加密敏感信息后再传输参数,加密指引请参考微信支付公钥加密敏感信息指引


path  路径参数

 product_coupon_id  必填   string

【商品券ID】 商品券的唯一标识,创建商品券时由微信支付生成


body  包体参数

 out_request_no  必填   string(40)

【创建请求单号】 品牌创建批次请求流水号,品牌侧需保持唯一性,可使用 数字、大小写字母、下划线_、短横线- 组成,长度在6-40个字符之间


 stock_bundle  必填   object

【批次组】 为商品券创建的批次组详情

属性

请求示例

curl
Java
Go

POST

1curl -X POST \
2  https://api.mch.weixin.qq.com/brand/marketing/product-coupon/product-coupons/200000001/stock-bundles \
3  -H "Authorization: WECHATPAY-BRAND-SHA256-RSA2048 brand_id=\"XXXX\",..." \
4  -H "Accept: application/json" \
5  -H "Wechatpay-Serial: PUB_KEY_ID_XXXX"  \
6  -H "Content-Type: application/json" \
7  -d '{
8    "out_request_no" : "34657_20250101_123456",
9    "stock_bundle" : {
10      "remark" : "满减券",
11      "coupon_code_mode" : "UPLOAD",
12      "stock_send_rule" : {
13        "max_count" : 10000000,
14        "max_count_per_day" : 10000,
15        "max_count_per_user" : 1
16      },
17      "progressive_bundle_usage_rule" : {
18        "coupon_available_period" : {
19          "available_begin_time" : "2025-01-01T00:00:00+08:00",
20          "available_end_time" : "2025-10-01T00:00:00+08:00",
21          "available_days" : 10,
22          "wait_days_after_receive" : 1,
23          "weekly_available_period" : {
24            "day_list" : [
25              "MONDAY"
26            ],
27            "day_period_list" : [
28              {
29                "begin_time" : 60,
30                "end_time" : 86399
31              }
32            ]
33          },
34          "irregular_available_period_list" : [
35            {
36              "begin_time" : "2025-01-01T00:00:00+08:00",
37              "end_time" : "2025-10-01T00:00:00+08:00"
38            }
39          ]
40        },
41        "normal_coupon_list" : [
42          {
43            "threshold" : 10000,
44            "discount_amount" : 100
45          }
46        ],
47        "discount_coupon_list" : [
48          {
49            "threshold" : 10000,
50            "percent_off" : 30
51          }
52        ],
53        "exchange_coupon_list" : [
54          {
55            "threshold" : 10000,
56            "exchange_price" : 100
57          }
58        ]
59      },
60      "usage_rule_display_info" : {
61        "coupon_usage_method_list" : [
62          "MINI_PROGRAM"
63        ],
64        "mini_program_appid" : "wx1234567890",
65        "mini_program_path" : "/pages/index/product",
66        "app_path" : "https://www.example.com/jump-to-app",
67        "usage_description" : "全场可用",
68        "coupon_available_store_info" : {
69          "description" : "可在上海市区的所有门店使用,详细列表参考小程序内信息为准",
70          "mini_program_appid" : "wx1234567890",
71          "mini_program_path" : "/pages/index/store-list"
72        }
73      },
74      "coupon_display_info" : {
75        "code_display_mode" : "QRCODE",
76        "background_color" : "Color010",
77        "entrance_mini_program" : {
78          "appid" : "wx1234567890",
79          "path" : "/pages/index/product",
80          "entrance_wording" : "欢迎选购",
81          "guidance_wording" : "获取更多优惠"
82        },
83        "entrance_official_account" : {
84          "appid" : "wx1234567890"
85        },
86        "entrance_finder" : {
87          "finder_id" : "gh_12345678",
88          "finder_video_id" : "UDFsdf24df34dD456Hdf34",
89          "finder_video_cover_image_url" : "https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx"
90        }
91      },
92      "notify_config" : {
93        "notify_appid" : "wx4fd12345678"
94      },
95      "store_scope" : "SPECIFIC"
96    }
97  }'
98

应答参数

200 OK

 stock_bundle_id  必填   string(40)

【批次组ID】 商品券批次组的唯一标识,由微信支付生成


 stock_list  必填   array[object]

【批次列表】 批次组内批次列表

属性

应答示例

200 OK

1{
2  "stock_bundle_id" : "123456789",
3  "stock_list" : [
4    {
5      "product_coupon_id" : "200000001",
6      "stock_id" : "123456789",
7      "remark" : "满减券",
8      "coupon_code_mode" : "UPLOAD",
9      "coupon_code_count_info" : {
10        "total_count" : 10000,
11        "available_count" : 999
12      },
13      "stock_send_rule" : {
14        "max_count" : 10000000,
15        "max_count_per_day" : 10000,
16        "max_count_per_user" : 1
17      },
18      "progressive_bundle_usage_rule" : {
19        "coupon_available_period" : {
20          "available_begin_time" : "2025-01-01T00:00:00+08:00",
21          "available_end_time" : "2025-10-01T00:00:00+08:00",
22          "available_days" : 10,
23          "wait_days_after_receive" : 1,
24          "weekly_available_period" : {
25            "day_list" : [
26              "MONDAY"
27            ],
28            "day_period_list" : [
29              {
30                "begin_time" : 60,
31                "end_time" : 86399
32              }
33            ]
34          },
35          "irregular_available_period_list" : [
36            {
37              "begin_time" : "2025-01-01T00:00:00+08:00",
38              "end_time" : "2025-10-01T00:00:00+08:00"
39            }
40          ]
41        },
42        "normal_coupon" : {
43          "threshold" : 10000,
44          "discount_amount" : 100
45        },
46        "discount_coupon" : {
47          "threshold" : 10000,
48          "percent_off" : 30
49        },
50        "exchange_coupon" : {
51          "threshold" : 10000,
52          "exchange_price" : 100
53        }
54      },
55      "stock_bundle_info" : {
56        "stock_bundle_id" : "123456789",
57        "stock_bundle_index" : 0
58      },
59      "usage_rule_display_info" : {
60        "coupon_usage_method_list" : [
61          "MINI_PROGRAM"
62        ],
63        "mini_program_appid" : "wx1234567890",
64        "mini_program_path" : "/pages/index/product",
65        "app_path" : "https://www.example.com/jump-to-app",
66        "usage_description" : "全场可用",
67        "coupon_available_store_info" : {
68          "description" : "可在上海市区的所有门店使用,详细列表参考小程序内信息为准",
69          "mini_program_appid" : "wx1234567890",
70          "mini_program_path" : "/pages/index/store-list"
71        }
72      },
73      "coupon_display_info" : {
74        "code_display_mode" : "QRCODE",
75        "background_color" : "Color010",
76        "entrance_mini_program" : {
77          "appid" : "wx1234567890",
78          "path" : "/pages/index/product",
79          "entrance_wording" : "欢迎选购",
80          "guidance_wording" : "获取更多优惠"
81        },
82        "entrance_official_account" : {
83          "appid" : "wx1234567890"
84        },
85        "entrance_finder" : {
86          "finder_id" : "gh_12345678",
87          "finder_video_id" : "UDFsdf24df34dD456Hdf34",
88          "finder_video_cover_image_url" : "https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx"
89        }
90      },
91      "notify_config" : {
92        "notify_appid" : "wx4fd12345678"
93      },
94      "store_scope" : "SPECIFIC",
95      "sent_count_info" : {
96        "total_count" : 100,
97        "today_count" : 10
98      },
99      "state" : "SENDING",
100      "deactivate_request_no" : "1002600620019090123143254436",
101      "deactivate_time" : "2025-01-01T00:00+08:00",
102      "deactivate_reason" : "批次信息有误,重新创建"
103    }
104  ]
105}
106

 

错误码

以下是本接口返回的错误码列表。详细错误码规则,请参考微信支付接口规则-错误码和错误提示

状态码

错误码

描述

解决方案

400

PARAM_ERROR

参数错误

请根据错误提示正确传入参数

400

INVALID_REQUEST

HTTP 请求不符合微信支付 APIv3 接口规则

请参阅 接口规则

401

SIGN_ERROR

验证不通过

请参阅 签名常见问题

500

SYSTEM_ERROR

系统异常,请稍后重试

请稍后重试

 

元宝AI
反馈
目录
置顶