查询商品券批次列表

更新时间:2025.11.07

服务商可以通过该接口分页查询某个商品券的批次列表。可以传入 stock_bundle_id 来查询某个批次组内的批次列表。

前置条件:已创建商品券

频率限制:20/s

接口说明

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

请求方式:【GET】/v3/marketing/partner/product-coupon/product-coupons/{product_coupon_id}/stocks

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

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

请求参数

Header  HTTP头参数

 Authorization  必填 string

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


 Accept  必填 string

请设置为application/json


path  路径参数

 product_coupon_id  必填   string

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


query  查询参数

 state  选填   string

【批次状态】 不填默认查询所有状态的批次

可选取值

  • AUDITING:  审批中

  • SENDING:  发放中

  • PAUSED:  已暂停

  • STOPPED:  已停止,当前已到达结束时间

  • DEACTIVATED:  已失效,品牌方主动调用失效接口使批次失效


 page_size  选填   integer

【分页大小】 单次拉取的数据条数上限,不填默认为20,最大值50


 page_token  选填   string

【分页Token】 分页查询时,需要传入上一次调用返回的 next_page_token,首次调用不填


 brand_id  必填   string

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


 stock_bundle_id  选填   string

【批次组ID】 商品券批次组的唯一标识,【创建商品券(多次优惠)】或【添加商品券批次组】时由微信支付生成。

请求示例

curl
Java
Go

GET

查询商品券下已失效的批次列表

1curl -X GET \
2  https://api.mch.weixin.qq.com/v3/marketing/partner/product-coupon/product-coupons/1000000013/stocks?state=DEACTIVATED&page_size=10&brand_id=120344 \
3  -H "Authorization: WECHATPAY2-SHA256-RSA2048 mchid=\"1900000001\",..." \
4  -H "Accept: application/json" 
5

查询商品券下某个批次组内的批次

1curl -X GET \
2  https://api.mch.weixin.qq.com/v3/marketing/partner/product-coupon/product-coupons/1000000014/stocks?page_size=20&brand_id=120344&stock_bundle_id=712315129419284901 \
3  -H "Authorization: WECHATPAY2-SHA256-RSA2048 mchid=\"1900000001\",..." \
4  -H "Accept: application/json" 
5

应答参数

200 OK

 total_count  必填   integer

【总个数】 符合查询条件的批次总数,当且仅当 page_token 为空时提供


 stock_list  选填   array[object]

【批次列表】 符合查询条件的批次列表

属性

 next_page_token  选填   string(100)

【下一页Token】 分页查询时,如果还有更多数据,会返回下一页的Token,请在下一次查询时设置在 page_token 中;如果已无更多数据,则不返回此字段。

应答示例

200 OK

查询商品券下已失效的批次列表

1{
2  "total_count" : 1,
3  "stock_list" : [
4    {
5      "product_coupon_id" : "1000000013",
6      "stock_id" : "1000000013001",
7      "remark" : "8月工作日有效批次",
8      "coupon_code_mode" : "UPLOAD",
9      "coupon_code_count_info" : {
10        "total_count" : 0,
11        "available_count" : 0
12      },
13      "stock_send_rule" : {
14        "max_count" : 10000000,
15        "max_count_per_user" : 1
16      },
17      "single_usage_rule" : {
18        "coupon_available_period" : {
19          "available_begin_time" : "2025-08-01T00:00:00+08:00",
20          "available_end_time" : "2025-08-31T23:59:59+08:00",
21          "available_days" : 30,
22          "weekly_available_period" : {
23            "day_list" : [
24              "MONDAY",
25              "TUESDAY",
26              "WEDNESDAY",
27              "THURSDAY",
28              "FRIDAY"
29            ]
30          }
31        }
32      },
33      "usage_rule_display_info" : {
34        "coupon_usage_method_list" : [
35          "OFFLINE",
36          "MINI_PROGRAM",
37          "PAYMENT_CODE"
38        ],
39        "mini_program_appid" : "wx1234567890",
40        "mini_program_path" : "/pages/index/product",
41        "usage_description" : "工作日可用",
42        "coupon_available_store_info" : {
43          "description" : "所有门店可用,可使用小程序查看门店列表",
44          "mini_program_appid" : "wx1234567890",
45          "mini_program_path" : "/pages/index/store-list"
46        }
47      },
48      "coupon_display_info" : {
49        "code_display_mode" : "QRCODE",
50        "background_color" : "Color010",
51        "entrance_mini_program" : {
52          "appid" : "wx1234567890",
53          "path" : "/pages/index/product",
54          "entrance_wording" : "欢迎选购",
55          "guidance_wording" : "获取更多优惠"
56        },
57        "entrance_official_account" : {
58          "appid" : "wx1234567890"
59        },
60        "entrance_finder" : {
61          "finder_id" : "gh_12345678",
62          "finder_video_id" : "UDFsdf24df34dD456Hdf34",
63          "finder_video_cover_image_url" : "https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx"
64        }
65      },
66      "notify_config" : {
67        "notify_appid" : "wx4fd12345678"
68      },
69      "store_scope" : "ALL",
70      "sent_count_info" : {
71        "total_count" : 0,
72        "today_count" : 0
73      },
74      "state" : "DEACTIVATED",
75      "deactivate_request_no" : "de_34657_20250101_123456",
76      "deactivate_reason" : "批次信息有误,重新创建",
77      "deactivate_time" : "2025-09-01T00:00:00+08:00",
78      "brand_id" : "120344"
79    }
80  ]
81}
82

查询商品券下某个批次组内的批次

1{
2  "total_count" : 3,
3  "stock_list" : [
4    {
5      "product_coupon_id" : "1000000014",
6      "stock_id" : "1000000014001",
7      "remark" : "8月工作日有效批次",
8      "coupon_code_mode" : "UPLOAD",
9      "coupon_code_count_info" : {
10        "total_count" : 0,
11        "available_count" : 0
12      },
13      "stock_send_rule" : {
14        "max_count" : 10000000,
15        "max_count_per_user" : 1
16      },
17      "progressive_bundle_usage_rule" : {
18        "coupon_available_period" : {
19          "available_begin_time" : "2025-08-01T00:00:00+08:00",
20          "available_end_time" : "2025-08-31T23:59:59+08:00",
21          "available_days" : 30,
22          "weekly_available_period" : {
23            "day_list" : [
24              "MONDAY",
25              "TUESDAY",
26              "WEDNESDAY",
27              "THURSDAY",
28              "FRIDAY"
29            ]
30          }
31        },
32        "discount_coupon" : {
33          "threshold" : 10000,
34          "percent_off" : 50
35        }
36      },
37      "stock_bundle_info" : {
38        "stock_bundle_id" : "712315129419284901",
39        "stock_bundle_index" : 0
40      },
41      "usage_rule_display_info" : {
42        "coupon_usage_method_list" : [
43          "OFFLINE",
44          "MINI_PROGRAM",
45          "PAYMENT_CODE"
46        ],
47        "mini_program_appid" : "wx1234567890",
48        "mini_program_path" : "/pages/index/product",
49        "usage_description" : "工作日可用",
50        "coupon_available_store_info" : {
51          "description" : "所有门店可用,可使用小程序查看门店列表",
52          "mini_program_appid" : "wx1234567890",
53          "mini_program_path" : "/pages/index/store-list"
54        }
55      },
56      "coupon_display_info" : {
57        "code_display_mode" : "QRCODE",
58        "background_color" : "Color010",
59        "entrance_mini_program" : {
60          "appid" : "wx1234567890",
61          "path" : "/pages/index/product",
62          "entrance_wording" : "欢迎选购",
63          "guidance_wording" : "获取更多优惠"
64        },
65        "entrance_official_account" : {
66          "appid" : "wx1234567890"
67        },
68        "entrance_finder" : {
69          "finder_id" : "gh_12345678",
70          "finder_video_id" : "UDFsdf24df34dD456Hdf34",
71          "finder_video_cover_image_url" : "https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx"
72        }
73      },
74      "notify_config" : {
75        "notify_appid" : "wx4fd12345678"
76      },
77      "store_scope" : "NONE",
78      "sent_count_info" : {
79        "total_count" : 0,
80        "today_count" : 0
81      },
82      "state" : "SENDING",
83      "brand_id" : "120344"
84    },
85    {
86      "product_coupon_id" : "1000000014",
87      "stock_id" : "1000000014002",
88      "remark" : "8月工作日有效批次",
89      "coupon_code_mode" : "UPLOAD",
90      "coupon_code_count_info" : {
91        "total_count" : 0,
92        "available_count" : 0
93      },
94      "stock_send_rule" : {
95        "max_count" : 10000000,
96        "max_count_per_user" : 1
97      },
98      "progressive_bundle_usage_rule" : {
99        "coupon_available_period" : {
100          "available_begin_time" : "2025-08-01T00:00:00+08:00",
101          "available_end_time" : "2025-08-31T23:59:59+08:00",
102          "available_days" : 30,
103          "weekly_available_period" : {
104            "day_list" : [
105              "MONDAY",
106              "TUESDAY",
107              "WEDNESDAY",
108              "THURSDAY",
109              "FRIDAY"
110            ]
111          }
112        },
113        "discount_coupon" : {
114          "threshold" : 10000,
115          "percent_off" : 20
116        }
117      },
118      "stock_bundle_info" : {
119        "stock_bundle_id" : "712315129419284901",
120        "stock_bundle_index" : 1
121      },
122      "usage_rule_display_info" : {
123        "coupon_usage_method_list" : [
124          "OFFLINE",
125          "MINI_PROGRAM",
126          "PAYMENT_CODE"
127        ],
128        "mini_program_appid" : "wx1234567890",
129        "mini_program_path" : "/pages/index/product",
130        "usage_description" : "工作日可用",
131        "coupon_available_store_info" : {
132          "description" : "所有门店可用,可使用小程序查看门店列表",
133          "mini_program_appid" : "wx1234567890",
134          "mini_program_path" : "/pages/index/store-list"
135        }
136      },
137      "coupon_display_info" : {
138        "code_display_mode" : "QRCODE",
139        "background_color" : "Color010",
140        "entrance_mini_program" : {
141          "appid" : "wx1234567890",
142          "path" : "/pages/index/product",
143          "entrance_wording" : "欢迎选购",
144          "guidance_wording" : "获取更多优惠"
145        },
146        "entrance_official_account" : {
147          "appid" : "wx1234567890"
148        },
149        "entrance_finder" : {
150          "finder_id" : "gh_12345678",
151          "finder_video_id" : "UDFsdf24df34dD456Hdf34",
152          "finder_video_cover_image_url" : "https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx"
153        }
154      },
155      "notify_config" : {
156        "notify_appid" : "wx4fd12345678"
157      },
158      "store_scope" : "NONE",
159      "sent_count_info" : {
160        "total_count" : 0,
161        "today_count" : 0
162      },
163      "state" : "SENDING",
164      "brand_id" : "120344"
165    },
166    {
167      "product_coupon_id" : "1000000014",
168      "stock_id" : "1000000014003",
169      "remark" : "8月工作日有效批次",
170      "coupon_code_mode" : "UPLOAD",
171      "coupon_code_count_info" : {
172        "total_count" : 0,
173        "available_count" : 0
174      },
175      "stock_send_rule" : {
176        "max_count" : 10000000,
177        "max_count_per_user" : 1
178      },
179      "progressive_bundle_usage_rule" : {
180        "coupon_available_period" : {
181          "available_begin_time" : "2025-08-01T00:00:00+08:00",
182          "available_end_time" : "2025-08-31T23:59:59+08:00",
183          "available_days" : 30,
184          "weekly_available_period" : {
185            "day_list" : [
186              "MONDAY",
187              "TUESDAY",
188              "WEDNESDAY",
189              "THURSDAY",
190              "FRIDAY"
191            ]
192          }
193        },
194        "discount_coupon" : {
195          "threshold" : 10000,
196          "percent_off" : 30
197        }
198      },
199      "stock_bundle_info" : {
200        "stock_bundle_id" : "712315129419284901",
201        "stock_bundle_index" : 2
202      },
203      "usage_rule_display_info" : {
204        "coupon_usage_method_list" : [
205          "OFFLINE",
206          "MINI_PROGRAM",
207          "PAYMENT_CODE"
208        ],
209        "mini_program_appid" : "wx1234567890",
210        "mini_program_path" : "/pages/index/product",
211        "usage_description" : "工作日可用",
212        "coupon_available_store_info" : {
213          "description" : "所有门店可用,可使用小程序查看门店列表",
214          "mini_program_appid" : "wx1234567890",
215          "mini_program_path" : "/pages/index/store-list"
216        }
217      },
218      "coupon_display_info" : {
219        "code_display_mode" : "QRCODE",
220        "background_color" : "Color010",
221        "entrance_mini_program" : {
222          "appid" : "wx1234567890",
223          "path" : "/pages/index/product",
224          "entrance_wording" : "欢迎选购",
225          "guidance_wording" : "获取更多优惠"
226        },
227        "entrance_official_account" : {
228          "appid" : "wx1234567890"
229        },
230        "entrance_finder" : {
231          "finder_id" : "gh_12345678",
232          "finder_video_id" : "UDFsdf24df34dD456Hdf34",
233          "finder_video_cover_image_url" : "https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx"
234        }
235      },
236      "notify_config" : {
237        "notify_appid" : "wx4fd12345678"
238      },
239      "store_scope" : "NONE",
240      "sent_count_info" : {
241        "total_count" : 0,
242        "today_count" : 0
243      },
244      "state" : "SENDING",
245      "brand_id" : "120344"
246    }
247  ]
248}
249

 

错误码

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

状态码

错误码

描述

解决方案

400

PARAM_ERROR

参数错误

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

400

INVALID_REQUEST

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

请参阅 接口规则

401

SIGN_ERROR

验证不通过

请参阅 签名常见问题

500

SYSTEM_ERROR

系统异常,请稍后重试

请稍后重试

404

NOT_FOUND

未找到 product_coupon_id 对应的商品券

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

429

RATELIMIT_EXCEEDED

请求超过接口频率限制

请稍后使用原参数重试

 

元宝AI
反馈
目录
置顶