添加商品券批次组

更新时间:2025.11.20

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

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

频率限制:20/s

接口说明

支持商户:【普通服务商】

请求方式:【POST】/v3/marketing/partner/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


path  路径参数

 product_coupon_id  必填   string

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


body  包体参数

 out_request_no  必填   string(40)

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


 stock_bundle  必填   object

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

属性

 brand_id  必填   string

【品牌ID】 微信支付为品牌方分配的唯一标识,该品牌应与服务商存在授权关系

请求示例

curl
Java
Go

POST

1curl -X POST \
2  https://api.mch.weixin.qq.com/v3/marketing/partner/product-coupon/product-coupons/200000001/stock-bundles \
3  -H "Authorization: WECHATPAY2-SHA256-RSA2048 mchid=\"1900000001\",..." \
4  -H "Accept: application/json" \
5  -H "Content-Type: application/json" \
6  -d '{
7    "out_request_no" : "34657_20250101_123456",
8    "stock_bundle" : {
9      "remark" : "满减券",
10      "coupon_code_mode" : "UPLOAD",
11      "stock_send_rule" : {
12        "max_count" : 10000000,
13        "max_count_per_day" : 10000,
14        "max_count_per_user" : 1
15      },
16      "progressive_bundle_usage_rule" : {
17        "coupon_available_period" : {
18          "available_begin_time" : "2025-01-01T00:00:00+08:00",
19          "available_end_time" : "2025-10-01T00:00:00+08:00",
20          "available_days" : 10,
21          "wait_days_after_receive" : 1,
22          "weekly_available_period" : {
23            "day_list" : [
24              "MONDAY"
25            ],
26            "day_period_list" : [
27              {
28                "begin_time" : 60,
29                "end_time" : 86399
30              }
31            ]
32          },
33          "irregular_available_period_list" : [
34            {
35              "begin_time" : "2025-01-01T00:00:00+08:00",
36              "end_time" : "2025-10-01T00:00:00+08:00"
37            }
38          ]
39        },
40        "normal_coupon_list" : [
41          {
42            "threshold" : 10000,
43            "discount_amount" : 100
44          }
45        ],
46        "discount_coupon_list" : [
47          {
48            "threshold" : 10000,
49            "percent_off" : 30
50          }
51        ],
52        "exchange_coupon_list" : [
53          {
54            "threshold" : 10000,
55            "exchange_price" : 100
56          }
57        ]
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    },
96    "brand_id" : "120344"
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      "brand_id" : "120344"
104    }
105  ]
106}
107

 

错误码

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

状态码

错误码

描述

解决方案

400

PARAM_ERROR

参数错误

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

400

INVALID_REQUEST

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

请参阅 接口规则

401

SIGN_ERROR

验证不通过

请参阅 签名常见问题

500

SYSTEM_ERROR

系统异常,请稍后重试

请稍后重试

400

INVALID_REQUEST

传入参数不符合业务规则

请参考文档中对每个字段的要求以及组合要求,确认请求参数是否满足

400

ALREADY_EXISTS

商品券批次组已存在

确认 out_request_no 字段是否重复使用,确保不同请求的 out_request_no 唯一

404

NOT_FOUND

未找到 product_coupon_id 对应的商品券

请确认 product_coupon_id 存在且属于当前品牌

429

RATELIMIT_EXCEEDED

请求超过接口频率限制

请稍后使用原参数重试

 

元宝AI
反馈
目录
置顶