指定券状态查询用户商品券列表

更新时间:2025.09.02

品牌方可以通过本接口查询已经发放给用户的特定状态的商品券

前置条件:已经给用户发券成功

接口说明

支持商户:【品牌商户】

请求方式:【GET】/brand/marketing/product-coupon/users/{openid}/coupons

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

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

请求参数

Header  HTTP头参数

 Authorization  必填 string

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


 Accept  必填 string

请设置为application/json


 Wechatpay-Serial  必填 string

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


path  路径参数

 openid  必填   string

【用户OpenID】 OpenID信息,用户在AppID下的唯一标识,获取方式参考OpenID


query  查询参数

 product_coupon_id  选填   string

【商品券ID】 商品券的唯一标识,创建商品券时由微信支付生成。查询指定商品券下的用户商品券列表,不传入时查询范围扩大至品牌下的所有商品券


 stock_id  选填   string

【批次ID】 商品券批次的唯一标识,商品券批次创建时由微信支付生成(可使用创建商品券添加商品券批次创建)。查询指定商品券批次下的用户商品券列表。


 appid  必填   string

【公众账号AppID】 请传入与当前调用接口品牌ID有绑定关系的AppID,如何绑定请参考品牌经营平台指引,支持小程序AppID与公众号AppID


 coupon_state  选填   string

【用户商品券状态】 查询指定状态的用户商品券

可选取值

  • CONFIRMING:  待确认,用户商品券发放需要品牌方调用确认发放用户商品券接口后才能生效

  • PENDING:  已发放待生效,用户商品券已发放成功但尚未到达可用开始时间

  • EFFECTIVE:  已生效,用户商品券已成功发放且到达可用开始时间

  • USED:  已核销,用户商品券已核销

  • EXPIRED:  已过期,用户商品券已超过有效期,不再可用

  • DELETED:  已删除,用户主动删除该券

  • DEACTIVATED:  已失效,品牌方主动调用失效用户商品券接口使用户商品券失效


 page_size  选填   integer

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


 page_token  选填   string

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

请求示例

GET

1curl -X GET \
2  https://api.mch.weixin.qq.com/brand/marketing/product-coupon/users/oh-394z-6CGkNoJrsDLTTUKiAnp4/coupons?product_coupon_id=1002323&stock_id=100232301&appid=wx233544546545989&coupon_state=USED&page_size=20&page_token=MTIzMjUK \
3  -H "Authorization: WECHATPAY-BRAND-SHA256-RSA2048 brand_id=\"XXXX\",..." \
4  -H "Accept: application/json" \
5  -H "Wechatpay-Serial: PUB_KEY_ID_XXXX"  
6

应答参数

200 OK

 total_count  必填   integer

【总个数】 满足条件的数据总条数,当且仅当 page_token 为空时提供。


 user_coupon_list  选填   array[object]

【用户商品券列表】 指定状态的用户商品券列表信息

属性

 next_page_token  选填   string(100)

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

应答示例

200 OK

1{
2  "total_count" : 20,
3  "user_coupon_list" : [
4    {
5      "coupon_code" : "123446565767",
6      "coupon_state" : "USED",
7      "valid_begin_time" : "2025-01-01T00:00+08:00",
8      "valid_end_time" : "2025-01-30T23:59:59+08:00",
9      "receive_time" : "2025-01-01T09:10:00+08:00",
10      "send_request_no" : "MCHSEND202003101234",
11      "send_channel" : "API",
12      "confirm_request_no" : "MCHCONFIRM202003101234",
13      "confirm_time" : "2025-01-20T13:29:35+08:00",
14      "deactivate_request_no" : "1002600620019090123143254436",
15      "deactivate_time" : "2025-01-20T13:29:35+08:00",
16      "deactivate_reason" : "商品已下线",
17      "single_usage_detail" : {
18        "use_request_no" : "MCHUSE202003101234",
19        "use_time" : "2025-07-20T13:29:35+08:00",
20        "associated_order_info" : {
21          "transaction_id" : "4200000000123456789123456789",
22          "out_trade_no" : "trade_no_20250724123456",
23          "mchid" : "1234567890",
24          "sub_mchid" : "1234567890"
25        },
26        "return_request_no" : "MCHRETURN202003101234",
27        "return_time" : "2025-07-20T14:29:35+08:00"
28      },
29      "sequential_usage_detail" : {
30        "total_count" : 10,
31        "used_count" : 3,
32        "detail_item_list" : [
33          {
34            "detail_state" : "USED",
35            "valid_begin_time" : "2025-07-24T00:00+08:00",
36            "valid_end_time" : "2025-07-30T23:59:59+08:00",
37            "use_request_no" : "MCHUSE202003101234",
38            "use_time" : "2025-07-20T13:29:35+08:00",
39            "associated_order_info" : {
40              "transaction_id" : "4200000000123456789123456789",
41              "out_trade_no" : "trade_no_20250724123456",
42              "mchid" : "1234567890",
43              "sub_mchid" : "1234567890"
44            },
45            "return_request_no" : "MCHRETURN202003101234",
46            "return_time" : "2025-07-20T14:29:35+08:00",
47            "delete_time" : "2025-07-20T14:29:35+08:00"
48          }
49        ]
50      },
51      "product_coupon" : {
52        "product_coupon_id" : "1002323",
53        "scope" : "ALL",
54        "type" : "NORMAL",
55        "usage_mode" : "SEQUENTIAL",
56        "single_usage_info" : {
57          "normal_coupon" : {
58            "threshold" : 10000,
59            "discount_amount" : 100
60          },
61          "discount_coupon" : {
62            "threshold" : 10000,
63            "percent_off" : 30
64          }
65        },
66        "sequential_usage_info" : {
67          "type" : "EQUAL",
68          "count" : 10,
69          "available_days" : 10,
70          "interval_days" : 1
71        },
72        "display_info" : {
73          "name" : "全场满100可减10元",
74          "image_url" : "https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx",
75          "background_url" : "https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx",
76          "detail_image_url_list" : [
77            "https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx"
78          ],
79          "original_price" : 10000,
80          "combo_package_list" : [
81            {
82              "name" : "咖啡2选1",
83              "pick_count" : 3,
84              "choice_list" : [
85                {
86                  "name" : "美式",
87                  "price" : 10000,
88                  "count" : 2,
89                  "image_url" : "https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx",
90                  "mini_program_appid" : "wx4fd12345678",
91                  "mini_program_path" : "/pages/index/index"
92                }
93              ]
94            }
95          ]
96        },
97        "out_product_no" : "Product_1234567890",
98        "state" : "AUDITING",
99        "deactivate_request_no" : "1002600620019090123143254436",
100        "deactivate_time" : "2025-06-20T13:29:35+08:00",
101        "deactivate_reason" : "商品已下架"
102      },
103      "stock" : {
104        "product_coupon_id" : "200000001",
105        "stock_id" : "123456789",
106        "remark" : "满减券",
107        "coupon_code_mode" : "UPLOAD",
108        "coupon_code_count_info" : {
109          "total_count" : 10000,
110          "available_count" : 999
111        },
112        "stock_send_rule" : {
113          "max_count" : 10000000,
114          "max_count_per_day" : 10000,
115          "max_count_per_user" : 1
116        },
117        "single_usage_rule" : {
118          "coupon_available_period" : {
119            "available_begin_time" : "2025-01-01T00:00:00+08:00",
120            "available_end_time" : "2025-10-01T00:00:00+08:00",
121            "available_days" : 10,
122            "wait_days_after_receive" : 1,
123            "weekly_available_period" : {
124              "day_list" : [
125                "MONDAY"
126              ],
127              "day_period_list" : [
128                {
129                  "begin_time" : 60,
130                  "end_time" : 86399
131                }
132              ]
133            },
134            "irregular_available_period_list" : [
135              {
136                "begin_time" : "2025-01-01T00:00:00+08:00",
137                "end_time" : "2025-10-01T00:00:00+08:00"
138              }
139            ]
140          },
141          "normal_coupon" : {
142            "threshold" : 10000,
143            "discount_amount" : 100
144          },
145          "discount_coupon" : {
146            "threshold" : 10000,
147            "percent_off" : 30
148          },
149          "exchange_coupon" : {
150            "threshold" : 10000,
151            "exchange_price" : 100
152          }
153        },
154        "sequential_usage_rule" : {
155          "coupon_available_period" : {
156            "available_begin_time" : "2025-01-01T00:00:00+08:00",
157            "available_end_time" : "2025-10-01T00:00:00+08:00",
158            "wait_days_after_receive" : 1,
159            "weekly_available_period" : {
160              "day_list" : [
161                "MONDAY"
162              ],
163              "day_period_list" : [
164                {
165                  "begin_time" : 60,
166                  "end_time" : 86399
167                }
168              ]
169            },
170            "irregular_available_period_list" : [
171              {
172                "begin_time" : "2025-01-01T00:00:00+08:00",
173                "end_time" : "2025-10-01T00:00:00+08:00"
174              }
175            ]
176          },
177          "normal_coupon_list" : [
178            {
179              "threshold" : 10000,
180              "discount_amount" : 100
181            }
182          ],
183          "discount_coupon_list" : [
184            {
185              "threshold" : 10000,
186              "percent_off" : 30
187            }
188          ],
189          "exchange_coupon_list" : [
190            {
191              "threshold" : 10000,
192              "exchange_price" : 100
193            }
194          ],
195          "special_first" : false
196        },
197        "usage_rule_display_info" : {
198          "coupon_usage_method_list" : [
199            "MINI_PROGRAM"
200          ],
201          "mini_program_appid" : "wx1234567890",
202          "mini_program_path" : "/pages/index/product",
203          "app_path" : "https://www.example.com/jump-to-app",
204          "usage_description" : "全场可用",
205          "coupon_available_store_info" : {
206            "description" : "可在上海市区的所有门店使用,详细列表参考小程序内信息为准",
207            "mini_program_appid" : "wx1234567890",
208            "mini_program_path" : "/pages/index/store-list"
209          }
210        },
211        "coupon_display_info" : {
212          "code_display_mode" : "QRCODE",
213          "background_color" : "Color010",
214          "entrance_mini_program" : {
215            "appid" : "wx1234567890",
216            "path" : "/pages/index/product",
217            "entrance_wording" : "欢迎选购",
218            "guidance_wording" : "获取更多优惠"
219          },
220          "entrance_official_account" : {
221            "appid" : "wx1234567890"
222          },
223          "entrance_finder" : {
224            "finder_id" : "gh_12345678",
225            "finder_video_id" : "UDFsdf24df34dD456Hdf34",
226            "finder_video_cover_image_url" : "https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx"
227          }
228        },
229        "notify_config" : {
230          "notify_appid" : "wx4fd12345678"
231        },
232        "store_scope" : "SPECIFIC",
233        "sent_count_info" : {
234          "total_count" : 100,
235          "today_count" : 10
236        },
237        "state" : "SENDING",
238        "deactivate_request_no" : "1002600620019090123143254436",
239        "deactivate_time" : "2025-01-01T00:00+08:00",
240        "deactivate_reason" : "批次信息有误,重新创建"
241      },
242      "attach" : "example_attach",
243      "channel_custom_info" : "example_channel_custom_info"
244    }
245  ],
246  "next_page_token" : "MTIzNDUK"
247}
248

 

错误码

公共错误码

状态码

错误码

描述

解决方案

400

PARAM_ERROR

参数错误

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

400

INVALID_REQUEST

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

请参阅 接口规则

401

SIGN_ERROR

验证不通过

请参阅 签名常见问题

500

SYSTEM_ERROR

系统异常,请稍后重试

请稍后重试

业务错误码

状态码

错误码

描述

解决方案

400

INVALID_REQUEST

传入参数不符合业务规则

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

403

NO_AUTH

缺少业务相关权限

请确认已开通商品券权限

404

NOT_FOUND

未找到 product_coupon_id 对应的商品券

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

404

NOT_FOUND

未找到 stock_id 对应的商品券批次

请确认 stock_id 存在且属于当前商品券

429

RATELIMIT_EXCEEDED

请求超过接口频率限制

请稍后使用原参数重试