【单券-全场-折扣券】API请求示例

更新时间:2025.12.02

 

curl
Java
Go

 

1## 1. 单券-全场-折扣券 (SINGLE_ALL_DISCOUNT)
2
3```bash
4curl -X POST \
5  https://api.mch.weixin.qq.com/brand/marketing/product-coupon/product-coupons \
6  -H "Authorization: WECHATPAY-BRAND-SHA256-RSA2048 brand_id=\"XXXX\"..." \
7  -H "Accept: application/json" \
8  -H "Wechatpay-Serial: PUB_KEY_ID_XXXX" \
9  -H "Content-Type: application/json" \
10  -d '{
11    "out_request_no": "SINGLE_ALL_DISCOUNT_20250120_001", # 必填,创建请求单号
12    "scope": "ALL", # 必填,优惠范围
13    "type": "DISCOUNT", # 必填,券类型
14    "usage_mode": "SINGLE", # 必填,使用模式
15    
16    "single_usage_info": { # 当usage_mode=SINGLE且scope=ALL时必填,单券模式信息(仅全场券在此设置优惠规则)
17      "discount_coupon": { # 当type=DISCOUNT且scope=ALL时必填,折扣券规则
18        "threshold": 10000, # 当type=DISCOUNT且scope=ALL时必填,门槛金额,单位:分
19        "percent_off": 20 # 当type=DISCOUNT且scope=ALL时必填,折扣百分比
20      }
21    },
22    
23    "display_info": { # 必填,展示信息
24      "name": "全场满100立打8折", # 必填,商品券名称
25      "image_url": "https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx", # 必填,商品图片
26      "background_url": "https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx", # 必填,背景图
27      "detail_image_url_list": [ # 选填,详情图列表
28        "https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx"
29      ]
30    },
31    
32    "out_product_no": "Product_1234567890", # 选填,外部商品ID
33    
34    "stock": { # 必填,批次信息
35      "remark": "8月工作日有效批次", # 选填,备注
36      "coupon_code_mode": "UPLOAD", # 必填,券Code分配模式
37      
38      "stock_send_rule": { # 必填,发放规则
39        "max_count": 10000000, # 必填,总发放次数上限
40        "max_count_per_day": 100000, # 选填,每日发放上限
41        "max_count_per_user": 1 # 必填,每用户领取上限
42      },
43      
44      "single_usage_rule": { # 当usage_mode=SINGLE时必填,单券使用规则
45        "coupon_available_period": { # 必填,券可核销时间
46          "available_begin_time": "2025-08-01T00:00:00+08:00", # 必填,开始时间,时间格式:2015-05-20T13:29:35+08:00表示北京时间2015年5月20日 13点29分35秒
47          "available_end_time": "2025-08-31T23:59:59+08:00", # 必填,结束时间
48          "available_days": 30, # 选填,生效后N天有效
49          "wait_days_after_receive": 0, # 选填,领取后N天生效
50          "weekly_available_period": { # 选填,每周可用时间
51            "day_list": ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY"] # 当配置weekly_available_period时必填,可用星期
52          },
53          "irregular_available_period_list": [ # 选填,无规律可用时间段
54            {
55              "begin_time": "2025-08-15T00:00:00+08:00", # 当配置irregular_available_period_list时必填,开始时间,时间格式:2015-05-20T13:29:35+08:00表示北京时间2015年5月20日 13点29分35秒
56              "end_time": "2025-08-15T23:59:59+08:00" # 当配置irregular_available_period_list时必填,结束时间
57            }
58          ]
59        }
60      },
61      
62      "usage_rule_display_info": { # 必填,使用规则展示信息
63        "coupon_usage_method_list": ["OFFLINE", "MINI_PROGRAM", "APP", "PAYMENT_CODE"], # 必填,使用方式,OFFLINE=线下滴码核销,MINI_PROGRAM=线上小程序核销,APP=APP核销,PAYMENT_CODE=微信支付付款码核销
64        "mini_program_appid": "wx1234567890", # 当coupon_usage_method_list包含MINI_PROGRAM时必填,小程序AppID
65        "mini_program_path": "/pages/index/product", # 当coupon_usage_method_list包含MINI_PROGRAM时必填,小程序路径
66        "app_path": "pages/index/product", # 当coupon_usage_method_list包含APP时必填,APP路径
67        "usage_description": "工作日可用", # 必填,使用说明
68        "coupon_available_store_info": { # 选填,可用门店信息
69          "description": "所有门店可用,可使用小程序查看门店列表", # 当配置coupon_available_store_info时必填,门店描述
70          "mini_program_appid": "wx1234567890", # 选填,小程序AppID
71          "mini_program_path": "/pages/index/store-list" # 选填,小程序路径
72        }
73      },
74      
75      "coupon_display_info": { # 必填,用户券展示信息
76        "code_display_mode": "QRCODE", # 必填,Code展示模式
77        "background_color": "Color010", # 选填,背景颜色
78        "entrance_mini_program": { # 选填,小程序入口
79          "appid": "wx1234567890", # 当配置entrance_mini_program时必填,小程序AppID
80          "path": "/pages/index/product", # 当配置entrance_mini_program时必填,跳转路径
81          "entrance_wording": "欢迎选购", # 当配置entrance_mini_program时必填,入口文案
82          "guidance_wording": "获取更多优惠" # 当配置entrance_mini_program时必填,引导文案
83        },
84        "entrance_official_account": { # 选填,公众号入口
85          "appid": "wx1234567890" # 当配置entrance_official_account时必填,公众号AppID
86        },
87        "entrance_finder": { # 选填,视频号入口
88          "finder_id": "gh_12345678", # 当配置entrance_finder时必填,视频号ID
89          "finder_video_id": "UDFsdf24df34dD456Hdf34", # 当配置entrance_finder时必填,视频号视频ID
90          "finder_video_cover_image_url": "https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx" # 当配置entrance_finder时必填,视频封面图
91        }
92      },
93      
94      "store_scope": "NONE", # 必填,可用门店范围
95      
96      "notify_config": { # 必填,事件通知配置
97        "notify_appid": "wx4fd12345678" # 必填,通知AppID
98      }
99    }
100  }'
101```

 

 

 

 

元宝AI
反馈
目录
置顶