修改商品券批次组发放预算

更新时间:2025.11.27

品牌方可以通过本接口批量修改商品券批次组内所有批次的投放预算。

:本接口每次调用只能调整一个维度的投放预算,如果你需要调整多个维度的预算,请多次调用本接口。

前置条件

  1. 已创建 usage_mode 为 PROGRESSIVE_BUNDLE 的商品券对应的批次组

  2. 批次组内批次未失效或过期

频率限制:20/s

接口说明

支持商户:【品牌商户】

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

请求域名:【主域名】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】 商品券的唯一标识,创建商品券时由微信支付生成


 stock_bundle_id  必填   string

【批次组ID】 商品券批次组的唯一标识,由微信支付生成,本接口会同步修改批次组内所有批次的对应预算信息。请确保该批次组属于 product_coupon_id 对应的商品券


body  包体参数

 out_request_no  必填   string(40)

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


 update_mode  必填   string

【更新模式】 本接口每次只支持更新一种限额,请选择对应的模式,并传入对应的字段。如果你需要调整多个维度的限制,请使用不同的模式多次调用本接口

可选取值

  • MAX_COUNT:  更新批次发放次数总上限

  • MAX_COUNT_PER_DAY:  更新批次每日发放次数上限


 current_max_count  选填   integer

【当前批次发放次数总上限】 当前批次发放次数总上限,调用本接口前,请先通过【查询商品券批次详情API】获取。当且仅当 update_mode 为 MAX_COUNT 时必传,其他模式下不应填写


 target_max_count  选填   integer

【目标批次发放次数总上限】 将批次发放次数总上限更新为本值,允许小于当前批次发放次数总上限,但是不得小于当前已发放总次数。当且仅当 update_mode 为 MAX_COUNT 时必传,其他模式下不应填写


 current_max_count_per_day  选填   integer

【当前批次每日发放次数上限】 当前批次每日发放次数上限,调用本接口前,请先通过【查询商品券批次详情API】获取。当且仅当 update_mode 为 MAX_COUNT_PER_DAY 时必传,其他模式下不应填写


 target_max_count_per_day  选填   integer

【目标批次每日发放次数上限】 将批次每日发放次数上限更新为本值,允许小于当前批次每日发放次数上限。当且仅当 update_mode 为 MAX_COUNT_PER_DAY 时必传,其他模式下不应填写

请求示例

curl
Java
Go

POST

1curl -X POST \
2  https://api.mch.weixin.qq.com/brand/marketing/product-coupon/product-coupons/200000001/stock-bundles/123456789/update-budget \
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" : "BUDGET1212512514",
9    "update_mode" : "MAX_COUNT",
10    "current_max_count" : 1,
11    "target_max_count" : 1,
12    "current_max_count_per_day" : 1,
13    "target_max_count_per_day" : 1
14  }'
15

应答参数

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
反馈
目录
置顶