查询商品券批次列表
更新时间:2025.08.28品牌方可以通过该接口分页查询某个商品券的批次列表。可以传入 stock_bundle_id 来查询某个批次组内的批次列表。
前置条件:已创建商品券
频率限制:20/s
接口说明
支持商户:【品牌商户】
请求方式:【GET】/brand/marketing/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
Wechatpay-Serial 必填 string
【微信支付公钥ID】 请传入brand_id对应的微信支付公钥ID,接口将会校验两者的关联关系,参考微信支付公钥产品简介及使用说明获取微信支付公钥ID和相关的介绍。以下两种场景将使用到微信支付公钥: 1、接收到接口的返回内容,需要使用微信支付公钥进行验签; 2、调用含有敏感信息参数(如姓名、身份证号码)的接口时,需要使用微信支付公钥加密敏感信息后再传输参数,加密指引请参考微信支付公钥加密敏感信息指引。
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,首次调用不填
stock_bundle_id 选填 string
【批次组ID】 商品券批次组的唯一标识,【创建商品券(多次优惠)】或【添加商品券批次组】时由微信支付生成。
请求示例
GET
查询商品券下已失效的批次列表
1curl -X GET \ 2 https://api.mch.weixin.qq.com/brand/marketing/product-coupon/product-coupons/1000000013/stocks?state=DEACTIVATED&page_size=10 \ 3 -H "Authorization: WECHATPAY-BRAND-SHA256-RSA2048 brand_id=\"XXXX\",..." \ 4 -H "Accept: application/json" \ 5 -H "Wechatpay-Serial: PUB_KEY_ID_XXXX" 6
查询商品券下某个批次组内的批次
1curl -X GET \ 2 https://api.mch.weixin.qq.com/brand/marketing/product-coupon/product-coupons/1000000014/stocks?page_size=20&stock_bundle_id=712315129419284901 \ 3 -H "Authorization: WECHATPAY-BRAND-SHA256-RSA2048 brand_id=\"XXXX\",..." \ 4 -H "Accept: application/json" \ 5 -H "Wechatpay-Serial: PUB_KEY_ID_XXXX" 6
需配合微信支付工具库 WXPayUtility 使用,请参考Java
1package com.java.demo; 2 3import com.java.utils.WXPayBrandUtility; // 引用微信支付工具库,参考:https://pay.weixin.qq.com/doc/brand/4015826861 4 5import com.google.gson.annotations.SerializedName; 6import com.google.gson.annotations.Expose; 7import okhttp3.MediaType; 8import okhttp3.OkHttpClient; 9import okhttp3.Request; 10import okhttp3.RequestBody; 11import okhttp3.Response; 12 13import java.io.IOException; 14import java.io.UncheckedIOException; 15import java.security.PrivateKey; 16import java.security.PublicKey; 17import java.util.ArrayList; 18import java.util.HashMap; 19import java.util.List; 20import java.util.Map; 21 22/** 23 * 查询商品券批次列表 24 */ 25public class ListStocks { 26 private static String HOST = "https://api.mch.weixin.qq.com"; 27 private static String METHOD = "GET"; 28 private static String PATH = "/brand/marketing/product-coupon/product-coupons/{product_coupon_id}/stocks"; 29 30 public static void main(String[] args) { 31 // TODO: 请准备商户开发必要参数,参考:https://pay.weixin.qq.com/doc/brand/4015415289 32 ListStocks client = new ListStocks( 33 "xxxxxxxx", // 品牌ID,是由微信支付系统生成并分配给每个品牌方的唯一标识符,品牌ID获取方式参考 https://pay.weixin.qq.com/doc/brand/4015415289 34 "1DDE55AD98Exxxxxxxxxx", // 品牌API证书序列号,如何获取请参考 https://pay.weixin.qq.com/doc/brand/4015407570 35 "/path/to/apiclient_key.pem", // 品牌API证书私钥文件路径,本地文件路径 36 "PUB_KEY_ID_xxxxxxxxxxxxx", // 微信支付公钥ID,如何获取请参考 https://pay.weixin.qq.com/doc/brand/4015453439 37 "/path/to/wxp_pub.pem" // 微信支付公钥文件路径,本地文件路径 38 ); 39 40 ListStocksRequest request = new ListStocksRequest(); 41 request.productCouponId = "1000000013"; 42 request.pageSize = 10L; 43 request.state = StockState.DEACTIVATED; 44 try { 45 ListStocksResponse response = client.run(request); 46 // TODO: 请求成功,继续业务逻辑 47 System.out.println(response); 48 } catch (WXPayBrandUtility.ApiException e) { 49 // TODO: 请求失败,根据状态码执行不同的逻辑 50 e.printStackTrace(); 51 } 52 } 53 54 public ListStocksResponse run(ListStocksRequest request) { 55 String uri = PATH; 56 uri = uri.replace("{product_coupon_id}", WXPayBrandUtility.urlEncode(request.productCouponId)); 57 Map<String, Object> args = new HashMap<>(); 58 args.put("state", request.state); 59 args.put("page_size", request.pageSize); 60 args.put("page_token", request.pageToken); 61 args.put("stock_bundle_id", request.stockBundleId); 62 String queryString = WXPayBrandUtility.urlEncode(args); 63 if (!queryString.isEmpty()) { 64 uri = uri + "?" + queryString; 65 } 66 67 Request.Builder reqBuilder = new Request.Builder().url(HOST + uri); 68 reqBuilder.addHeader("Accept", "application/json"); 69 reqBuilder.addHeader("Wechatpay-Serial", wechatPayPublicKeyId); 70 reqBuilder.addHeader("Authorization", WXPayBrandUtility.buildAuthorization(brand_id, certificateSerialNo, privateKey, METHOD, uri, null)); 71 reqBuilder.method(METHOD, null); 72 Request httpRequest = reqBuilder.build(); 73 74 // 发送HTTP请求 75 OkHttpClient client = new OkHttpClient.Builder().build(); 76 try (Response httpResponse = client.newCall(httpRequest).execute()) { 77 String respBody = WXPayBrandUtility.extractBody(httpResponse); 78 if (httpResponse.code() >= 200 && httpResponse.code() < 300) { 79 // 2XX 成功,验证应答签名 80 WXPayBrandUtility.validateResponse(this.wechatPayPublicKeyId, this.wechatPayPublicKey, 81 httpResponse.headers(), respBody); 82 83 // 从HTTP应答报文构建返回数据 84 return WXPayBrandUtility.fromJson(respBody, ListStocksResponse.class); 85 } else { 86 throw new WXPayBrandUtility.ApiException(httpResponse.code(), respBody, httpResponse.headers()); 87 } 88 } catch (IOException e) { 89 throw new UncheckedIOException("Sending request to " + uri + " failed.", e); 90 } 91 } 92 93 private final String brand_id; 94 private final String certificateSerialNo; 95 private final PrivateKey privateKey; 96 private final String wechatPayPublicKeyId; 97 private final PublicKey wechatPayPublicKey; 98 99 public ListStocks(String brand_id, String certificateSerialNo, String privateKeyFilePath, String wechatPayPublicKeyId, String wechatPayPublicKeyFilePath) { 100 this.brand_id = brand_id; 101 this.certificateSerialNo = certificateSerialNo; 102 this.privateKey = WXPayBrandUtility.loadPrivateKeyFromPath(privateKeyFilePath); 103 this.wechatPayPublicKeyId = wechatPayPublicKeyId; 104 this.wechatPayPublicKey = WXPayBrandUtility.loadPublicKeyFromPath(wechatPayPublicKeyFilePath); 105 } 106 107 public static class ListStocksRequest { 108 @SerializedName("product_coupon_id") 109 @Expose(serialize = false) 110 public String productCouponId; 111 112 @SerializedName("page_size") 113 @Expose(serialize = false) 114 public Long pageSize; 115 116 @SerializedName("page_token") 117 @Expose(serialize = false) 118 public String pageToken; 119 120 @SerializedName("stock_bundle_id") 121 @Expose(serialize = false) 122 public String stockBundleId; 123 124 @SerializedName("state") 125 @Expose(serialize = false) 126 public StockState state; 127 } 128 129 public static class ListStocksResponse { 130 @SerializedName("total_count") 131 public Long totalCount; 132 133 @SerializedName("stock_list") 134 public List<StockEntity> stockList; 135 136 @SerializedName("next_page_token") 137 public String nextPageToken; 138 } 139 140 public enum StockState { 141 @SerializedName("AUDITING") 142 AUDITING, 143 @SerializedName("SENDING") 144 SENDING, 145 @SerializedName("PAUSED") 146 PAUSED, 147 @SerializedName("STOPPED") 148 STOPPED, 149 @SerializedName("DEACTIVATED") 150 DEACTIVATED 151 } 152 153 public static class StockEntity { 154 @SerializedName("product_coupon_id") 155 public String productCouponId; 156 157 @SerializedName("stock_id") 158 public String stockId; 159 160 @SerializedName("remark") 161 public String remark; 162 163 @SerializedName("coupon_code_mode") 164 public CouponCodeMode couponCodeMode; 165 166 @SerializedName("coupon_code_count_info") 167 public CouponCodeCountInfo couponCodeCountInfo; 168 169 @SerializedName("stock_send_rule") 170 public StockSendRule stockSendRule; 171 172 @SerializedName("single_usage_rule") 173 public SingleUsageRule singleUsageRule; 174 175 @SerializedName("progressive_bundle_usage_rule") 176 public StockUsageRule progressiveBundleUsageRule; 177 178 @SerializedName("stock_bundle_info") 179 public StockBundleInfo stockBundleInfo; 180 181 @SerializedName("usage_rule_display_info") 182 public UsageRuleDisplayInfo usageRuleDisplayInfo; 183 184 @SerializedName("coupon_display_info") 185 public CouponDisplayInfo couponDisplayInfo; 186 187 @SerializedName("notify_config") 188 public NotifyConfig notifyConfig; 189 190 @SerializedName("store_scope") 191 public StockStoreScope storeScope; 192 193 @SerializedName("sent_count_info") 194 public StockSentCountInfo sentCountInfo; 195 196 @SerializedName("state") 197 public StockState state; 198 199 @SerializedName("deactivate_request_no") 200 public String deactivateRequestNo; 201 202 @SerializedName("deactivate_time") 203 public String deactivateTime; 204 205 @SerializedName("deactivate_reason") 206 public String deactivateReason; 207 } 208 209 public enum CouponCodeMode { 210 @SerializedName("WECHATPAY") 211 WECHATPAY, 212 @SerializedName("UPLOAD") 213 UPLOAD, 214 @SerializedName("API_ASSIGN") 215 API_ASSIGN 216 } 217 218 public static class CouponCodeCountInfo { 219 @SerializedName("total_count") 220 public Long totalCount; 221 222 @SerializedName("available_count") 223 public Long availableCount; 224 } 225 226 public static class StockSendRule { 227 @SerializedName("max_count") 228 public Long maxCount; 229 230 @SerializedName("max_count_per_day") 231 public Long maxCountPerDay; 232 233 @SerializedName("max_count_per_user") 234 public Long maxCountPerUser; 235 } 236 237 public static class SingleUsageRule { 238 @SerializedName("coupon_available_period") 239 public CouponAvailablePeriod couponAvailablePeriod; 240 241 @SerializedName("normal_coupon") 242 public NormalCouponUsageRule normalCoupon; 243 244 @SerializedName("discount_coupon") 245 public DiscountCouponUsageRule discountCoupon; 246 247 @SerializedName("exchange_coupon") 248 public ExchangeCouponUsageRule exchangeCoupon; 249 } 250 251 public static class StockUsageRule { 252 @SerializedName("coupon_available_period") 253 public CouponAvailablePeriod couponAvailablePeriod; 254 255 @SerializedName("normal_coupon") 256 public NormalCouponUsageRule normalCoupon; 257 258 @SerializedName("discount_coupon") 259 public DiscountCouponUsageRule discountCoupon; 260 261 @SerializedName("exchange_coupon") 262 public ExchangeCouponUsageRule exchangeCoupon; 263 } 264 265 public static class StockBundleInfo { 266 @SerializedName("stock_bundle_id") 267 public String stockBundleId; 268 269 @SerializedName("stock_bundle_index") 270 public Long stockBundleIndex; 271 } 272 273 public static class UsageRuleDisplayInfo { 274 @SerializedName("coupon_usage_method_list") 275 public List<CouponUsageMethod> couponUsageMethodList = new ArrayList<CouponUsageMethod>(); 276 277 @SerializedName("mini_program_appid") 278 public String miniProgramAppid; 279 280 @SerializedName("mini_program_path") 281 public String miniProgramPath; 282 283 @SerializedName("app_path") 284 public String appPath; 285 286 @SerializedName("usage_description") 287 public String usageDescription; 288 289 @SerializedName("coupon_available_store_info") 290 public CouponAvailableStoreInfo couponAvailableStoreInfo; 291 } 292 293 public static class CouponDisplayInfo { 294 @SerializedName("code_display_mode") 295 public CouponCodeDisplayMode codeDisplayMode; 296 297 @SerializedName("background_color") 298 public String backgroundColor; 299 300 @SerializedName("entrance_mini_program") 301 public EntranceMiniProgram entranceMiniProgram; 302 303 @SerializedName("entrance_official_account") 304 public EntranceOfficialAccount entranceOfficialAccount; 305 306 @SerializedName("entrance_finder") 307 public EntranceFinder entranceFinder; 308 } 309 310 public static class NotifyConfig { 311 @SerializedName("notify_appid") 312 public String notifyAppid; 313 } 314 315 public enum StockStoreScope { 316 @SerializedName("NONE") 317 NONE, 318 @SerializedName("ALL") 319 ALL, 320 @SerializedName("SPECIFIC") 321 SPECIFIC 322 } 323 324 public static class StockSentCountInfo { 325 @SerializedName("total_count") 326 public Long totalCount; 327 328 @SerializedName("today_count") 329 public Long todayCount; 330 } 331 332 public static class CouponAvailablePeriod { 333 @SerializedName("available_begin_time") 334 public String availableBeginTime; 335 336 @SerializedName("available_end_time") 337 public String availableEndTime; 338 339 @SerializedName("available_days") 340 public Long availableDays; 341 342 @SerializedName("wait_days_after_receive") 343 public Long waitDaysAfterReceive; 344 345 @SerializedName("weekly_available_period") 346 public FixedWeekPeriod weeklyAvailablePeriod; 347 348 @SerializedName("irregular_available_period_list") 349 public List<TimePeriod> irregularAvailablePeriodList; 350 } 351 352 public static class NormalCouponUsageRule { 353 @SerializedName("threshold") 354 public Long threshold; 355 356 @SerializedName("discount_amount") 357 public Long discountAmount; 358 } 359 360 public static class DiscountCouponUsageRule { 361 @SerializedName("threshold") 362 public Long threshold; 363 364 @SerializedName("percent_off") 365 public Long percentOff; 366 } 367 368 public static class ExchangeCouponUsageRule { 369 @SerializedName("threshold") 370 public Long threshold; 371 372 @SerializedName("exchange_price") 373 public Long exchangePrice; 374 } 375 376 public enum CouponUsageMethod { 377 @SerializedName("OFFLINE") 378 OFFLINE, 379 @SerializedName("MINI_PROGRAM") 380 MINI_PROGRAM, 381 @SerializedName("APP") 382 APP, 383 @SerializedName("PAYMENT_CODE") 384 PAYMENT_CODE 385 } 386 387 public static class CouponAvailableStoreInfo { 388 @SerializedName("description") 389 public String description; 390 391 @SerializedName("mini_program_appid") 392 public String miniProgramAppid; 393 394 @SerializedName("mini_program_path") 395 public String miniProgramPath; 396 } 397 398 public enum CouponCodeDisplayMode { 399 @SerializedName("INVISIBLE") 400 INVISIBLE, 401 @SerializedName("BARCODE") 402 BARCODE, 403 @SerializedName("QRCODE") 404 QRCODE 405 } 406 407 public static class EntranceMiniProgram { 408 @SerializedName("appid") 409 public String appid; 410 411 @SerializedName("path") 412 public String path; 413 414 @SerializedName("entrance_wording") 415 public String entranceWording; 416 417 @SerializedName("guidance_wording") 418 public String guidanceWording; 419 } 420 421 public static class EntranceOfficialAccount { 422 @SerializedName("appid") 423 public String appid; 424 } 425 426 public static class EntranceFinder { 427 @SerializedName("finder_id") 428 public String finderId; 429 430 @SerializedName("finder_video_id") 431 public String finderVideoId; 432 433 @SerializedName("finder_video_cover_image_url") 434 public String finderVideoCoverImageUrl; 435 } 436 437 public static class FixedWeekPeriod { 438 @SerializedName("day_list") 439 public List<WeekEnum> dayList; 440 441 @SerializedName("day_period_list") 442 public List<PeriodOfTheDay> dayPeriodList; 443 } 444 445 public static class TimePeriod { 446 @SerializedName("begin_time") 447 public String beginTime; 448 449 @SerializedName("end_time") 450 public String endTime; 451 } 452 453 public enum WeekEnum { 454 @SerializedName("MONDAY") 455 MONDAY, 456 @SerializedName("TUESDAY") 457 TUESDAY, 458 @SerializedName("WEDNESDAY") 459 WEDNESDAY, 460 @SerializedName("THURSDAY") 461 THURSDAY, 462 @SerializedName("FRIDAY") 463 FRIDAY, 464 @SerializedName("SATURDAY") 465 SATURDAY, 466 @SerializedName("SUNDAY") 467 SUNDAY 468 } 469 470 public static class PeriodOfTheDay { 471 @SerializedName("begin_time") 472 public Long beginTime; 473 474 @SerializedName("end_time") 475 public Long endTime; 476 } 477 478} 479
需配合微信支付工具库 wxpay_utility 使用,请参考Go
1package main 2 3import ( 4 "demo/wxpay_brand_utility" // 引用微信支付工具库,参考 https://pay.weixin.qq.com/doc/brand/4015826866 5 "encoding/json" 6 "fmt" 7 "net/http" 8 "net/url" 9 "strings" 10 "time" 11) 12 13func main() { 14 // TODO: 请准备商户开发必要参数,参考:https://pay.weixin.qq.com/doc/brand/4015415289 15 config, err := wxpay_brand_utility.CreateBrandConfig( 16 "xxxxxxxx", // 品牌ID,是由微信支付系统生成并分配给每个品牌方的唯一标识符,品牌ID获取方式参考 https://pay.weixin.qq.com/doc/brand/4015415289 17 "1DDE55AD98Exxxxxxxxxx", // 品牌API证书序列号,如何获取请参考 https://pay.weixin.qq.com/doc/brand/4015407570 18 "/path/to/apiclient_key.pem", // 品牌API证书私钥文件路径,本地文件路径 19 "PUB_KEY_ID_xxxxxxxxxxxxx", // 微信支付公钥ID,如何获取请参考 https://pay.weixin.qq.com/doc/brand/4015453439 20 "/path/to/wxp_pub.pem", // 微信支付公钥文件路径,本地文件路径 21 ) 22 if err != nil { 23 fmt.Println(err) 24 return 25 } 26 27 request := &ListStocksRequest{ 28 ProductCouponId: wxpay_brand_utility.String("1000000013"), 29 PageSize: wxpay_brand_utility.Int64(10), 30 State: STOCKSTATE_DEACTIVATED.Ptr(), 31 } 32 33 response, err := ListStocks(config, request) 34 if err != nil { 35 fmt.Printf("请求失败: %+v\n", err) 36 // TODO: 请求失败,根据状态码执行不同的处理 37 return 38 } 39 40 // TODO: 请求成功,继续业务逻辑 41 fmt.Printf("请求成功: %+v\n", response) 42} 43 44func ListStocks(config *wxpay_brand_utility.BrandConfig, request *ListStocksRequest) (response *ListStocksResponse, err error) { 45 const ( 46 host = "https://api.mch.weixin.qq.com" 47 method = "GET" 48 path = "/brand/marketing/product-coupon/product-coupons/{product_coupon_id}/stocks" 49 ) 50 51 reqUrl, err := url.Parse(fmt.Sprintf("%s%s", host, path)) 52 if err != nil { 53 return nil, err 54 } 55 reqUrl.Path = strings.Replace(reqUrl.Path, "{product_coupon_id}", url.PathEscape(*request.ProductCouponId), -1) 56 query := reqUrl.Query() 57 if request.State != nil { 58 query.Add("state", fmt.Sprintf("%v", *request.State)) 59 } 60 if request.PageSize != nil { 61 query.Add("page_size", fmt.Sprintf("%v", *request.PageSize)) 62 } 63 if request.PageToken != nil { 64 query.Add("page_token", *request.PageToken) 65 } 66 if request.StockBundleId != nil { 67 query.Add("stock_bundle_id", *request.StockBundleId) 68 } 69 reqUrl.RawQuery = query.Encode() 70 httpRequest, err := http.NewRequest(method, reqUrl.String(), nil) 71 if err != nil { 72 return nil, err 73 } 74 httpRequest.Header.Set("Accept", "application/json") 75 httpRequest.Header.Set("Wechatpay-Serial", config.WechatPayPublicKeyId()) 76 authorization, err := wxpay_brand_utility.BuildAuthorization(config.BrandId(), config.CertificateSerialNo(), config.PrivateKey(), method, reqUrl.RequestURI(), nil) 77 if err != nil { 78 return nil, err 79 } 80 httpRequest.Header.Set("Authorization", authorization) 81 82 client := &http.Client{} 83 httpResponse, err := client.Do(httpRequest) 84 if err != nil { 85 return nil, err 86 } 87 respBody, err := wxpay_brand_utility.ExtractResponseBody(httpResponse) 88 if err != nil { 89 return nil, err 90 } 91 if httpResponse.StatusCode >= 200 && httpResponse.StatusCode < 300 { 92 // 2XX 成功,验证应答签名 93 err = wxpay_brand_utility.ValidateResponse( 94 config.WechatPayPublicKeyId(), 95 config.WechatPayPublicKey(), 96 &httpResponse.Header, 97 respBody, 98 ) 99 if err != nil { 100 return nil, err 101 } 102 response := &ListStocksResponse{} 103 if err := json.Unmarshal(respBody, response); err != nil { 104 return nil, err 105 } 106 107 return response, nil 108 } else { 109 return nil, wxpay_brand_utility.NewApiException( 110 httpResponse.StatusCode, 111 httpResponse.Header, 112 respBody, 113 ) 114 } 115} 116 117type ListStocksRequest struct { 118 ProductCouponId *string `json:"product_coupon_id,omitempty"` 119 PageSize *int64 `json:"page_size,omitempty"` 120 PageToken *string `json:"page_token,omitempty"` 121 StockBundleId *string `json:"stock_bundle_id,omitempty"` 122 State *StockState `json:"state,omitempty"` 123} 124 125func (o *ListStocksRequest) MarshalJSON() ([]byte, error) { 126 type Alias ListStocksRequest 127 a := &struct { 128 ProductCouponId *string `json:"product_coupon_id,omitempty"` 129 PageSize *int64 `json:"page_size,omitempty"` 130 PageToken *string `json:"page_token,omitempty"` 131 StockBundleId *string `json:"stock_bundle_id,omitempty"` 132 State *StockState `json:"state,omitempty"` 133 *Alias 134 }{ 135 // 序列化时移除非 Body 字段 136 ProductCouponId: nil, 137 PageSize: nil, 138 PageToken: nil, 139 StockBundleId: nil, 140 State: nil, 141 Alias: (*Alias)(o), 142 } 143 return json.Marshal(a) 144} 145 146type ListStocksResponse struct { 147 TotalCount *int64 `json:"total_count,omitempty"` 148 StockList []StockEntity `json:"stock_list,omitempty"` 149 NextPageToken *string `json:"next_page_token,omitempty"` 150} 151 152type StockState string 153 154func (e StockState) Ptr() *StockState { 155 return &e 156} 157 158const ( 159 STOCKSTATE_AUDITING StockState = "AUDITING" 160 STOCKSTATE_SENDING StockState = "SENDING" 161 STOCKSTATE_PAUSED StockState = "PAUSED" 162 STOCKSTATE_STOPPED StockState = "STOPPED" 163 STOCKSTATE_DEACTIVATED StockState = "DEACTIVATED" 164) 165 166type StockEntity struct { 167 ProductCouponId *string `json:"product_coupon_id,omitempty"` 168 StockId *string `json:"stock_id,omitempty"` 169 Remark *string `json:"remark,omitempty"` 170 CouponCodeMode *CouponCodeMode `json:"coupon_code_mode,omitempty"` 171 CouponCodeCountInfo *CouponCodeCountInfo `json:"coupon_code_count_info,omitempty"` 172 StockSendRule *StockSendRule `json:"stock_send_rule,omitempty"` 173 SingleUsageRule *SingleUsageRule `json:"single_usage_rule,omitempty"` 174 ProgressiveBundleUsageRule *StockUsageRule `json:"progressive_bundle_usage_rule,omitempty"` 175 StockBundleInfo *StockBundleInfo `json:"stock_bundle_info,omitempty"` 176 UsageRuleDisplayInfo *UsageRuleDisplayInfo `json:"usage_rule_display_info,omitempty"` 177 CouponDisplayInfo *CouponDisplayInfo `json:"coupon_display_info,omitempty"` 178 NotifyConfig *NotifyConfig `json:"notify_config,omitempty"` 179 StoreScope *StockStoreScope `json:"store_scope,omitempty"` 180 SentCountInfo *StockSentCountInfo `json:"sent_count_info,omitempty"` 181 State *StockState `json:"state,omitempty"` 182 DeactivateRequestNo *string `json:"deactivate_request_no,omitempty"` 183 DeactivateTime *time.Time `json:"deactivate_time,omitempty"` 184 DeactivateReason *string `json:"deactivate_reason,omitempty"` 185} 186 187type CouponCodeMode string 188 189func (e CouponCodeMode) Ptr() *CouponCodeMode { 190 return &e 191} 192 193const ( 194 COUPONCODEMODE_WECHATPAY CouponCodeMode = "WECHATPAY" 195 COUPONCODEMODE_UPLOAD CouponCodeMode = "UPLOAD" 196 COUPONCODEMODE_API_ASSIGN CouponCodeMode = "API_ASSIGN" 197) 198 199type CouponCodeCountInfo struct { 200 TotalCount *int64 `json:"total_count,omitempty"` 201 AvailableCount *int64 `json:"available_count,omitempty"` 202} 203 204type StockSendRule struct { 205 MaxCount *int64 `json:"max_count,omitempty"` 206 MaxCountPerDay *int64 `json:"max_count_per_day,omitempty"` 207 MaxCountPerUser *int64 `json:"max_count_per_user,omitempty"` 208} 209 210type SingleUsageRule struct { 211 CouponAvailablePeriod *CouponAvailablePeriod `json:"coupon_available_period,omitempty"` 212 NormalCoupon *NormalCouponUsageRule `json:"normal_coupon,omitempty"` 213 DiscountCoupon *DiscountCouponUsageRule `json:"discount_coupon,omitempty"` 214 ExchangeCoupon *ExchangeCouponUsageRule `json:"exchange_coupon,omitempty"` 215} 216 217type StockUsageRule struct { 218 CouponAvailablePeriod *CouponAvailablePeriod `json:"coupon_available_period,omitempty"` 219 NormalCoupon *NormalCouponUsageRule `json:"normal_coupon,omitempty"` 220 DiscountCoupon *DiscountCouponUsageRule `json:"discount_coupon,omitempty"` 221 ExchangeCoupon *ExchangeCouponUsageRule `json:"exchange_coupon,omitempty"` 222} 223 224type StockBundleInfo struct { 225 StockBundleId *string `json:"stock_bundle_id,omitempty"` 226 StockBundleIndex *int64 `json:"stock_bundle_index,omitempty"` 227} 228 229type UsageRuleDisplayInfo struct { 230 CouponUsageMethodList []CouponUsageMethod `json:"coupon_usage_method_list,omitempty"` 231 MiniProgramAppid *string `json:"mini_program_appid,omitempty"` 232 MiniProgramPath *string `json:"mini_program_path,omitempty"` 233 AppPath *string `json:"app_path,omitempty"` 234 UsageDescription *string `json:"usage_description,omitempty"` 235 CouponAvailableStoreInfo *CouponAvailableStoreInfo `json:"coupon_available_store_info,omitempty"` 236} 237 238type CouponDisplayInfo struct { 239 CodeDisplayMode *CouponCodeDisplayMode `json:"code_display_mode,omitempty"` 240 BackgroundColor *string `json:"background_color,omitempty"` 241 EntranceMiniProgram *EntranceMiniProgram `json:"entrance_mini_program,omitempty"` 242 EntranceOfficialAccount *EntranceOfficialAccount `json:"entrance_official_account,omitempty"` 243 EntranceFinder *EntranceFinder `json:"entrance_finder,omitempty"` 244} 245 246type NotifyConfig struct { 247 NotifyAppid *string `json:"notify_appid,omitempty"` 248} 249 250type StockStoreScope string 251 252func (e StockStoreScope) Ptr() *StockStoreScope { 253 return &e 254} 255 256const ( 257 STOCKSTORESCOPE_NONE StockStoreScope = "NONE" 258 STOCKSTORESCOPE_ALL StockStoreScope = "ALL" 259 STOCKSTORESCOPE_SPECIFIC StockStoreScope = "SPECIFIC" 260) 261 262type StockSentCountInfo struct { 263 TotalCount *int64 `json:"total_count,omitempty"` 264 TodayCount *int64 `json:"today_count,omitempty"` 265} 266 267type CouponAvailablePeriod struct { 268 AvailableBeginTime *string `json:"available_begin_time,omitempty"` 269 AvailableEndTime *string `json:"available_end_time,omitempty"` 270 AvailableDays *int64 `json:"available_days,omitempty"` 271 WaitDaysAfterReceive *int64 `json:"wait_days_after_receive,omitempty"` 272 WeeklyAvailablePeriod *FixedWeekPeriod `json:"weekly_available_period,omitempty"` 273 IrregularAvailablePeriodList []TimePeriod `json:"irregular_available_period_list,omitempty"` 274} 275 276type NormalCouponUsageRule struct { 277 Threshold *int64 `json:"threshold,omitempty"` 278 DiscountAmount *int64 `json:"discount_amount,omitempty"` 279} 280 281type DiscountCouponUsageRule struct { 282 Threshold *int64 `json:"threshold,omitempty"` 283 PercentOff *int64 `json:"percent_off,omitempty"` 284} 285 286type ExchangeCouponUsageRule struct { 287 Threshold *int64 `json:"threshold,omitempty"` 288 ExchangePrice *int64 `json:"exchange_price,omitempty"` 289} 290 291type CouponUsageMethod string 292 293func (e CouponUsageMethod) Ptr() *CouponUsageMethod { 294 return &e 295} 296 297const ( 298 COUPONUSAGEMETHOD_OFFLINE CouponUsageMethod = "OFFLINE" 299 COUPONUSAGEMETHOD_MINI_PROGRAM CouponUsageMethod = "MINI_PROGRAM" 300 COUPONUSAGEMETHOD_APP CouponUsageMethod = "APP" 301 COUPONUSAGEMETHOD_PAYMENT_CODE CouponUsageMethod = "PAYMENT_CODE" 302) 303 304type CouponAvailableStoreInfo struct { 305 Description *string `json:"description,omitempty"` 306 MiniProgramAppid *string `json:"mini_program_appid,omitempty"` 307 MiniProgramPath *string `json:"mini_program_path,omitempty"` 308} 309 310type CouponCodeDisplayMode string 311 312func (e CouponCodeDisplayMode) Ptr() *CouponCodeDisplayMode { 313 return &e 314} 315 316const ( 317 COUPONCODEDISPLAYMODE_INVISIBLE CouponCodeDisplayMode = "INVISIBLE" 318 COUPONCODEDISPLAYMODE_BARCODE CouponCodeDisplayMode = "BARCODE" 319 COUPONCODEDISPLAYMODE_QRCODE CouponCodeDisplayMode = "QRCODE" 320) 321 322type EntranceMiniProgram struct { 323 Appid *string `json:"appid,omitempty"` 324 Path *string `json:"path,omitempty"` 325 EntranceWording *string `json:"entrance_wording,omitempty"` 326 GuidanceWording *string `json:"guidance_wording,omitempty"` 327} 328 329type EntranceOfficialAccount struct { 330 Appid *string `json:"appid,omitempty"` 331} 332 333type EntranceFinder struct { 334 FinderId *string `json:"finder_id,omitempty"` 335 FinderVideoId *string `json:"finder_video_id,omitempty"` 336 FinderVideoCoverImageUrl *string `json:"finder_video_cover_image_url,omitempty"` 337} 338 339type FixedWeekPeriod struct { 340 DayList []WeekEnum `json:"day_list,omitempty"` 341 DayPeriodList []PeriodOfTheDay `json:"day_period_list,omitempty"` 342} 343 344type TimePeriod struct { 345 BeginTime *string `json:"begin_time,omitempty"` 346 EndTime *string `json:"end_time,omitempty"` 347} 348 349type WeekEnum string 350 351func (e WeekEnum) Ptr() *WeekEnum { 352 return &e 353} 354 355const ( 356 WEEKENUM_MONDAY WeekEnum = "MONDAY" 357 WEEKENUM_TUESDAY WeekEnum = "TUESDAY" 358 WEEKENUM_WEDNESDAY WeekEnum = "WEDNESDAY" 359 WEEKENUM_THURSDAY WeekEnum = "THURSDAY" 360 WEEKENUM_FRIDAY WeekEnum = "FRIDAY" 361 WEEKENUM_SATURDAY WeekEnum = "SATURDAY" 362 WEEKENUM_SUNDAY WeekEnum = "SUNDAY" 363) 364 365type PeriodOfTheDay struct { 366 BeginTime *int64 `json:"begin_time,omitempty"` 367 EndTime *int64 `json:"end_time,omitempty"` 368} 369
应答参数
200 OK
total_count 必填 integer
【总个数】 符合查询条件的批次总数,当且仅当 page_token 为空时提供
stock_list 选填 array[object]
【批次列表】 符合查询条件的批次列表
| 属性 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
product_coupon_id 必填 string(40) 【商品券ID】 商品券的唯一标识,由微信支付生成 stock_id 必填 string(40) 【批次ID】 商品券批次的唯一标识,由微信支付生成 remark 选填 string(20) 【备注】 仅配置品牌可见,用于自定义信息 coupon_code_mode 必填 string 【券Code分配模式】 决定发券时用户商品券Code如何产生 可选取值
coupon_code_count_info 选填 object 【品牌方预上传的券Code数量信息】 当且仅当
stock_send_rule 必填 object 【发放规则】 发放规则
single_usage_rule 选填 object 【单券使用规则】 当且仅当
progressive_bundle_usage_rule 选填 object 【多次优惠使用规则】 当且仅当
stock_bundle_info 选填 object 【批次组信息】 批次所在批次组信息,当且仅当
usage_rule_display_info 必填 object 【券使用规则展示信息】 券使用规则展示信息
coupon_display_info 必填 object 【用户商品券展示信息】 用户商品券在卡包中的展示详情,包括引导用户的自定义入口
notify_config 必填 object 【事件通知配置】 发生券相关事件时,微信支付会向品牌方发送通知,需要提供通知相关配置
store_scope 必填 string 【可用门店范围】 控制该批次可以在品牌下哪些门店使用 可选取值
sent_count_info 必填 object 【已发放次数】 本批次已发放次数
state 必填 string 【批次状态】 商品券批次状态 可选取值
deactivate_request_no 选填 string(128) 【失效请求单号】 当且仅当 deactivate_time 选填 string 【失效时间】 当且仅当 deactivate_reason 选填 string(150) 【失效原因】 当且仅当 |
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 } 79 ] 80} 81
查询商品券下某个批次组内的批次
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 }, 84 { 85 "product_coupon_id" : "1000000014", 86 "stock_id" : "1000000014002", 87 "remark" : "8月工作日有效批次", 88 "coupon_code_mode" : "UPLOAD", 89 "coupon_code_count_info" : { 90 "total_count" : 0, 91 "available_count" : 0 92 }, 93 "stock_send_rule" : { 94 "max_count" : 10000000, 95 "max_count_per_user" : 1 96 }, 97 "progressive_bundle_usage_rule" : { 98 "coupon_available_period" : { 99 "available_begin_time" : "2025-08-01T00:00:00+08:00", 100 "available_end_time" : "2025-08-31T23:59:59+08:00", 101 "available_days" : 30, 102 "weekly_available_period" : { 103 "day_list" : [ 104 "MONDAY", 105 "TUESDAY", 106 "WEDNESDAY", 107 "THURSDAY", 108 "FRIDAY" 109 ] 110 } 111 }, 112 "discount_coupon" : { 113 "threshold" : 10000, 114 "percent_off" : 20 115 } 116 }, 117 "stock_bundle_info" : { 118 "stock_bundle_id" : "712315129419284901", 119 "stock_bundle_index" : 1 120 }, 121 "usage_rule_display_info" : { 122 "coupon_usage_method_list" : [ 123 "OFFLINE", 124 "MINI_PROGRAM", 125 "PAYMENT_CODE" 126 ], 127 "mini_program_appid" : "wx1234567890", 128 "mini_program_path" : "/pages/index/product", 129 "usage_description" : "工作日可用", 130 "coupon_available_store_info" : { 131 "description" : "所有门店可用,可使用小程序查看门店列表", 132 "mini_program_appid" : "wx1234567890", 133 "mini_program_path" : "/pages/index/store-list" 134 } 135 }, 136 "coupon_display_info" : { 137 "code_display_mode" : "QRCODE", 138 "background_color" : "Color010", 139 "entrance_mini_program" : { 140 "appid" : "wx1234567890", 141 "path" : "/pages/index/product", 142 "entrance_wording" : "欢迎选购", 143 "guidance_wording" : "获取更多优惠" 144 }, 145 "entrance_official_account" : { 146 "appid" : "wx1234567890" 147 }, 148 "entrance_finder" : { 149 "finder_id" : "gh_12345678", 150 "finder_video_id" : "UDFsdf24df34dD456Hdf34", 151 "finder_video_cover_image_url" : "https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx" 152 } 153 }, 154 "notify_config" : { 155 "notify_appid" : "wx4fd12345678" 156 }, 157 "store_scope" : "NONE", 158 "sent_count_info" : { 159 "total_count" : 0, 160 "today_count" : 0 161 }, 162 "state" : "SENDING" 163 }, 164 { 165 "product_coupon_id" : "1000000014", 166 "stock_id" : "1000000014003", 167 "remark" : "8月工作日有效批次", 168 "coupon_code_mode" : "UPLOAD", 169 "coupon_code_count_info" : { 170 "total_count" : 0, 171 "available_count" : 0 172 }, 173 "stock_send_rule" : { 174 "max_count" : 10000000, 175 "max_count_per_user" : 1 176 }, 177 "progressive_bundle_usage_rule" : { 178 "coupon_available_period" : { 179 "available_begin_time" : "2025-08-01T00:00:00+08:00", 180 "available_end_time" : "2025-08-31T23:59:59+08:00", 181 "available_days" : 30, 182 "weekly_available_period" : { 183 "day_list" : [ 184 "MONDAY", 185 "TUESDAY", 186 "WEDNESDAY", 187 "THURSDAY", 188 "FRIDAY" 189 ] 190 } 191 }, 192 "discount_coupon" : { 193 "threshold" : 10000, 194 "percent_off" : 30 195 } 196 }, 197 "stock_bundle_info" : { 198 "stock_bundle_id" : "712315129419284901", 199 "stock_bundle_index" : 2 200 }, 201 "usage_rule_display_info" : { 202 "coupon_usage_method_list" : [ 203 "OFFLINE", 204 "MINI_PROGRAM", 205 "PAYMENT_CODE" 206 ], 207 "mini_program_appid" : "wx1234567890", 208 "mini_program_path" : "/pages/index/product", 209 "usage_description" : "工作日可用", 210 "coupon_available_store_info" : { 211 "description" : "所有门店可用,可使用小程序查看门店列表", 212 "mini_program_appid" : "wx1234567890", 213 "mini_program_path" : "/pages/index/store-list" 214 } 215 }, 216 "coupon_display_info" : { 217 "code_display_mode" : "QRCODE", 218 "background_color" : "Color010", 219 "entrance_mini_program" : { 220 "appid" : "wx1234567890", 221 "path" : "/pages/index/product", 222 "entrance_wording" : "欢迎选购", 223 "guidance_wording" : "获取更多优惠" 224 }, 225 "entrance_official_account" : { 226 "appid" : "wx1234567890" 227 }, 228 "entrance_finder" : { 229 "finder_id" : "gh_12345678", 230 "finder_video_id" : "UDFsdf24df34dD456Hdf34", 231 "finder_video_cover_image_url" : "https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx" 232 } 233 }, 234 "notify_config" : { 235 "notify_appid" : "wx4fd12345678" 236 }, 237 "store_scope" : "NONE", 238 "sent_count_info" : { 239 "total_count" : 0, 240 "today_count" : 0 241 }, 242 "state" : "SENDING" 243 } 244 ] 245} 246
错误码
以下是本接口返回的错误码列表。详细错误码规则,请参考微信支付接口规则-错误码和错误提示
状态码 | 错误码 | 描述 | 解决方案 |
|---|---|---|---|
400 | PARAM_ERROR | 参数错误 | 请根据错误提示正确传入参数 |
400 | INVALID_REQUEST | HTTP 请求不符合微信支付 APIv3 接口规则 | 请参阅 接口规则 |
401 | SIGN_ERROR | 验证不通过 | 请参阅 签名常见问题 |
500 | SYSTEM_ERROR | 系统异常,请稍后重试 | 请稍后重试 |
400 | INVALID_REQUEST | 单券使用模式的商品券批次,应该在「单券使用规则」中包含对应类型的优惠规则。对于文档中标记不应填写的优惠规则应删除。 | 请在「单券使用规则」中包含对应类型的优惠规则,并删除文档中标记不应填写的优惠规则。 |
400 | INVALID_REQUEST | 多次优惠使用模式的商品券批次,应该在「多次优惠使用规则」中包含对应类型的优惠规则,且数量与多次优惠的优惠次数相等 | 在「多次优惠使用规则」中包含对应类型的优惠规则,且数量与多次优惠的优惠次数相等 |
400 | INVALID_REQUEST | 单品满减券或单品折扣券不应在商品券中设置「满减券使用规则」或「折扣券使用规则」,而是应该在商品券批次中设置 | 请删除商品券中的「满减券使用规则」或「折扣券使用规则」,并在商品券批次中设置对应的优惠规则 |
403 | NO_AUTH | 品牌没有此接口权限 | 品牌没有此接口权限 |
400 | PARAM_ERROR | page_token 不合法,请确认 page_token 来自于上一个列表查询请求的 next_page_token | 请确认 page_token 来自于上一个列表查询请求的 next_page_token,如果是初次查询则不要填写 page_token 参数 |
400 | INVALID_REQUEST | 商品券支持APP核销时,必须提供「APP跳转路径」 | 请提供「APP跳转路径」参数 |
400 | PARAM_ERROR | 分页大小超出限制,请根据接口文档调整到允许的范围 | 请调整分页大小到规定范围 |
400 | INVALID_REQUEST | 商品券支持小程序核销时,必须提供「小程序AppID」 | 请提供「小程序AppID」 |
400 | INVALID_REQUEST | 单品券必须提供商品原价,请补充 | 请补充商品原价 |
400 | INVALID_REQUEST | 商品券支持小程序核销时,必须提供「小程序跳转路径」 | 请提供提供「小程序跳转路径」 |
400 | INVALID_REQUEST | 单品券必须提供商品券套餐组合信息,请补充 | 请提供商品券套餐组合信息 |
400 | PARAM_ERROR | 时间字符串格式错误,请使用 RFC3339 标准格式 | 请使用 RFC3339 标准格式 |
400 | INVALID_REQUEST | 单券模式下,全场折扣券应在商品券中提供折扣券使用规则信息 | 请在商品券中提供「折扣券使用规则信息」 |
400 | INVALID_REQUEST | 单券模式下,全场满减券应在商品券中提供满减券使用规则信息 | 请在商品券中提供「满减券使用规则信息」 |
400 | INVALID_REQUEST | 每周固定可用时间(weekly_available_period)中提供当天可用时间段时(day_period_list),每周可用星期数(day_list)必填 | 请补充 每周可用星期数(day_list) |
400 | INVALID_REQUEST | 单券模式下,全场券需要提供「单券模式信息(single_usage_info)」 | 请提供单券模式信息(single_usage_info) |
400 | INVALID_REQUEST | 多次优惠模式下必须提供「多次优惠模式信息(sequential_usage_info)」 | 请填写 多次优惠模式信息(sequential_usage_info) |
400 | INVALID_REQUEST | 传入的OpenID不合法 | 请使用参数 AppID 对应的的OpenID |


