添加及列表查询商品券批次
添加商品券批次
品牌方可以通过该接口为已有的商品券添加更多批次,多个批次可以实现品牌方多样化的投放需求。
请求参数 | 类型 | 描述 |
---|---|---|
product_coupon_id | string | 商品券ID |
json | object | 声明请求的JSON 数据结构 |
brand_id | string | 品牌ID |
out_request_no | string | 创建请求单号 |
stock | object | 批次信息 |
remark | string | 备注 |
coupon_code_mode | string | 券Code分配模式WECHATPAY | UPLOAD | API_ASSIGN 枚举值之一 |
stock_send_rule | object | 发放规则 |
max_count | integer | 发放次数总上限 |
max_count_per_day | integer | 每日发放次数上限 |
max_count_per_user | integer | 每个用户领取次数上限 |
single_usage_rule | object | 单券使用规则 |
coupon_available_period | object | 券可核销时间 |
available_begin_time | string | 开始时间 |
available_end_time | string | 结束时间 |
available_days | integer | 生效后N天内有效 |
wait_days_after_receive | integer | 领取后N天开始生效 |
weekly_available_period | object | 每周固定可用时间 |
day_list | string[] | 每周可用星期数MONDAY | TUESDAY | WEDNESDAY | THURSDAY | FRIDAY | SATURDAY | SUNDAY 枚举值之一 |
day_period_list | object[] | 当天可用时间段 |
begin_time | integer | 当天可用开始时间 |
end_time | integer | 当天可用结束时间 |
irregular_available_period_list | object[] | 无规律的可用时间段 |
begin_time | string | 开始时间 |
end_time | string | 结束时间 |
normal_coupon | object | 满减券使用规则 |
threshold | integer | 门槛金额 |
discount_amount | integer | 固定减免金额 |
discount_coupon | object | 折扣券使用规则 |
threshold | integer | 门槛金额 |
percent_off | integer | 固定减免百分比 |
exchange_coupon | object | 兑换券使用规则 |
threshold | integer | 门槛金额 |
exchange_price | integer | 固定兑换价格 |
sequential_usage_rule | object | 多次优惠使用规则 |
coupon_available_period | object | 券可核销时间 |
available_begin_time | string | 开始时间 |
available_end_time | string | 结束时间 |
wait_days_after_receive | integer | 领取后N天开始生效 |
weekly_available_period | object | 每周固定可用时间 |
day_list | string[] | 每周可用星期数MONDAY | TUESDAY | WEDNESDAY | THURSDAY | FRIDAY | SATURDAY | SUNDAY 枚举值之一 |
day_period_list | object[] | 当天可用时间段 |
begin_time | integer | 当天可用开始时间 |
end_time | integer | 当天可用结束时间 |
irregular_available_period_list | object[] | 无规律的可用时间段 |
begin_time | string | 开始时间 |
end_time | string | 结束时间 |
normal_coupon_list | object[] | 满减券使用规则 |
threshold | integer | 门槛金额 |
discount_amount | integer | 固定减免金额 |
discount_coupon_list | object[] | 折扣券使用规则列表 |
threshold | integer | 门槛金额 |
percent_off | integer | 固定减免百分比 |
exchange_coupon_list | object[] | 兑换券使用规则列表 |
threshold | integer | 门槛金额 |
exchange_price | integer | 固定兑换价格 |
special_first | boolean | 多次优惠是否提供首笔特惠 |
usage_rule_display_info | object | 券使用规则展示信息 |
coupon_usage_method_list | string[] | 券使用方式列表OFFLINE | MINI_PROGRAM | APP | PAYMENT_CODE 枚举值之一 |
mini_program_appid | string | 小程序AppID |
mini_program_path | string | 小程序跳转路径 |
app_path | string | APP跳转路径 |
usage_description | string | 券使用说明 |
coupon_available_store_info | object | 券可用门店信息 |
description | string | 券可用门店描述 |
mini_program_appid | string | 小程序AppID |
mini_program_path | string | 小程序跳转路径 |
coupon_display_info | object | 用户商品券展示信息 |
code_display_mode | string | 用户商品券Code展示模式INVISIBLE | BARCODE | QRCODE 枚举值之一 |
background_color | string | 背景颜色Color010 | Color020 | Color030 | Color040 | Color050 | Color060 | Color070 | Color080 | Color090 | Color100 枚举值之一 |
entrance_mini_program | object | 小程序入口 |
appid | string | 小程序appid |
path | string | 小程序跳转路径 |
entrance_wording | string | 入口文案 |
guidance_wording | string | 引导文案 |
entrance_official_account | object | 公众号入口 |
appid | string | 公众号AppID |
entrance_finder | object | 视频号入口 |
finder_id | string | 视频号ID |
finder_video_id | string | 视频号视频ID |
finder_video_cover_image_url | string | 视频号封面图 |
notify_config | object | 事件通知配置 |
notify_appid | string | 事件通知appid |
store_scope | string | 可用门店范围NONE | ALL | SPECIFIC 枚举值之一 |
php
$instance->v3->marketing->partner->productCoupon->productCoupons->_product_coupon_id_->stocks->postAsync([
'product_coupon_id' => '1000000013',
'json' => [
'brand_id' => '120344',
'out_request_no' => '34657_20250101_123456',
'stock' => [
'remark' => '疯狂星期四项目专用',
'coupon_code_mode' => 'WECHATPAY',
'stock_send_rule' => [
'max_count' => 100000,
'max_count_per_day' => 100000000,
'max_count_per_user' => 5,
],
'single_usage_rule' => [
'coupon_available_period' => [
'available_begin_time' => '2025-08-01T00:00:00+08:00',
'available_end_time' => '2025-08-31T23:59:59+08:00',
'available_days' => 30,
'wait_days_after_receive' => 1,
'weekly_available_period' => [
'day_list' => ['MONDAY'],
'day_period_list' => [[
'begin_time' => 60,
'end_time' => 86399,
],],
],
'irregular_available_period_list' => [[
'begin_time' => '2025-08-01T00:00:00+08:00',
'end_time' => '2025-08-31T23:59:59+08:00',
],],
],
'normal_coupon' => [
'threshold' => 10000,
'discount_amount' => 1,
],
'discount_coupon' => [
'threshold' => 10000,
'percent_off' => 20,
],
'exchange_coupon' => [
'threshold' => 10000,
'exchange_price' => 20,
],
],
'sequential_usage_rule' => [
'coupon_available_period' => [
'available_begin_time' => '2025-08-01T00:00:00+08:00',
'available_end_time' => '2025-08-31T23:59:59+08:00',
'wait_days_after_receive' => 1,
'weekly_available_period' => [
'day_list' => ['MONDAY'],
'day_period_list' => [[
'begin_time' => 60,
'end_time' => 86399,
],],
],
'irregular_available_period_list' => [[
'begin_time' => '2025-08-01T00:00:00+08:00',
'end_time' => '2025-08-31T23:59:59+08:00',
],],
],
'normal_coupon_list' => [[
'threshold' => 10000,
'discount_amount' => 1,
],],
'discount_coupon_list' => [[
'threshold' => 10000,
'percent_off' => 20,
],],
'exchange_coupon_list' => [[
'threshold' => 10000,
'exchange_price' => 20,
],],
'special_first' => true,
],
'usage_rule_display_info' => [
'coupon_usage_method_list' => ['OFFLINE'],
'mini_program_appid' => 'wx1234567890',
'mini_program_path' => '/pages/index/product',
'app_path' => '',
'usage_description' => '工作日可用',
'coupon_available_store_info' => [
'description' => '所有门店可用,可使用小程序查看门店列表',
'mini_program_appid' => 'wx1234567890',
'mini_program_path' => '/pages/index/product',
],
],
'coupon_display_info' => [
'code_display_mode' => 'QRCODE',
'background_color' => 'Color020',
'entrance_mini_program' => [
'appid' => 'wx234545656765876',
'path' => '/path/index/index',
'entrance_wording' => '欢迎选购',
'guidance_wording' => '获取更多优惠',
],
'entrance_official_account' => [
'appid' => 'wx1234567890',
],
'entrance_finder' => [
'finder_id' => 'gh_12345678',
'finder_video_id' => 'UDFsdf24df34dD456Hdf34',
'finder_video_cover_image_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx',
],
],
'notify_config' => [
'notify_appid' => 'wx23232232323',
],
'store_scope' => 'NONE',
],
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/marketing/partner/product-coupon/product-coupons/{product_coupon_id}/stocks')->postAsync([
'product_coupon_id' => '1000000013',
'json' => [
'brand_id' => '120344',
'out_request_no' => '34657_20250101_123456',
'stock' => [
'remark' => '疯狂星期四项目专用',
'coupon_code_mode' => 'WECHATPAY',
'stock_send_rule' => [
'max_count' => 100000,
'max_count_per_day' => 100000000,
'max_count_per_user' => 5,
],
'single_usage_rule' => [
'coupon_available_period' => [
'available_begin_time' => '2025-08-01T00:00:00+08:00',
'available_end_time' => '2025-08-31T23:59:59+08:00',
'available_days' => 30,
'wait_days_after_receive' => 1,
'weekly_available_period' => [
'day_list' => ['MONDAY'],
'day_period_list' => [[
'begin_time' => 60,
'end_time' => 86399,
],],
],
'irregular_available_period_list' => [[
'begin_time' => '2025-08-01T00:00:00+08:00',
'end_time' => '2025-08-31T23:59:59+08:00',
],],
],
'normal_coupon' => [
'threshold' => 10000,
'discount_amount' => 1,
],
'discount_coupon' => [
'threshold' => 10000,
'percent_off' => 20,
],
'exchange_coupon' => [
'threshold' => 10000,
'exchange_price' => 20,
],
],
'sequential_usage_rule' => [
'coupon_available_period' => [
'available_begin_time' => '2025-08-01T00:00:00+08:00',
'available_end_time' => '2025-08-31T23:59:59+08:00',
'wait_days_after_receive' => 1,
'weekly_available_period' => [
'day_list' => ['MONDAY'],
'day_period_list' => [[
'begin_time' => 60,
'end_time' => 86399,
],],
],
'irregular_available_period_list' => [[
'begin_time' => '2025-08-01T00:00:00+08:00',
'end_time' => '2025-08-31T23:59:59+08:00',
],],
],
'normal_coupon_list' => [[
'threshold' => 10000,
'discount_amount' => 1,
],],
'discount_coupon_list' => [[
'threshold' => 10000,
'percent_off' => 20,
],],
'exchange_coupon_list' => [[
'threshold' => 10000,
'exchange_price' => 20,
],],
'special_first' => true,
],
'usage_rule_display_info' => [
'coupon_usage_method_list' => ['OFFLINE'],
'mini_program_appid' => 'wx1234567890',
'mini_program_path' => '/pages/index/product',
'app_path' => '',
'usage_description' => '工作日可用',
'coupon_available_store_info' => [
'description' => '所有门店可用,可使用小程序查看门店列表',
'mini_program_appid' => 'wx1234567890',
'mini_program_path' => '/pages/index/product',
],
],
'coupon_display_info' => [
'code_display_mode' => 'QRCODE',
'background_color' => 'Color020',
'entrance_mini_program' => [
'appid' => 'wx234545656765876',
'path' => '/path/index/index',
'entrance_wording' => '欢迎选购',
'guidance_wording' => '获取更多优惠',
],
'entrance_official_account' => [
'appid' => 'wx1234567890',
],
'entrance_finder' => [
'finder_id' => 'gh_12345678',
'finder_video_id' => 'UDFsdf24df34dD456Hdf34',
'finder_video_cover_image_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx',
],
],
'notify_config' => [
'notify_appid' => 'wx23232232323',
],
'store_scope' => 'NONE',
],
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/marketing/partner/product-coupon/product-coupons/{product_coupon_id}/stocks']->postAsync([
'product_coupon_id' => '1000000013',
'json' => [
'brand_id' => '120344',
'out_request_no' => '34657_20250101_123456',
'stock' => [
'remark' => '疯狂星期四项目专用',
'coupon_code_mode' => 'WECHATPAY',
'stock_send_rule' => [
'max_count' => 100000,
'max_count_per_day' => 100000000,
'max_count_per_user' => 5,
],
'single_usage_rule' => [
'coupon_available_period' => [
'available_begin_time' => '2025-08-01T00:00:00+08:00',
'available_end_time' => '2025-08-31T23:59:59+08:00',
'available_days' => 30,
'wait_days_after_receive' => 1,
'weekly_available_period' => [
'day_list' => ['MONDAY'],
'day_period_list' => [[
'begin_time' => 60,
'end_time' => 86399,
],],
],
'irregular_available_period_list' => [[
'begin_time' => '2025-08-01T00:00:00+08:00',
'end_time' => '2025-08-31T23:59:59+08:00',
],],
],
'normal_coupon' => [
'threshold' => 10000,
'discount_amount' => 1,
],
'discount_coupon' => [
'threshold' => 10000,
'percent_off' => 20,
],
'exchange_coupon' => [
'threshold' => 10000,
'exchange_price' => 20,
],
],
'sequential_usage_rule' => [
'coupon_available_period' => [
'available_begin_time' => '2025-08-01T00:00:00+08:00',
'available_end_time' => '2025-08-31T23:59:59+08:00',
'wait_days_after_receive' => 1,
'weekly_available_period' => [
'day_list' => ['MONDAY'],
'day_period_list' => [[
'begin_time' => 60,
'end_time' => 86399,
],],
],
'irregular_available_period_list' => [[
'begin_time' => '2025-08-01T00:00:00+08:00',
'end_time' => '2025-08-31T23:59:59+08:00',
],],
],
'normal_coupon_list' => [[
'threshold' => 10000,
'discount_amount' => 1,
],],
'discount_coupon_list' => [[
'threshold' => 10000,
'percent_off' => 20,
],],
'exchange_coupon_list' => [[
'threshold' => 10000,
'exchange_price' => 20,
],],
'special_first' => true,
],
'usage_rule_display_info' => [
'coupon_usage_method_list' => ['OFFLINE'],
'mini_program_appid' => 'wx1234567890',
'mini_program_path' => '/pages/index/product',
'app_path' => '',
'usage_description' => '工作日可用',
'coupon_available_store_info' => [
'description' => '所有门店可用,可使用小程序查看门店列表',
'mini_program_appid' => 'wx1234567890',
'mini_program_path' => '/pages/index/product',
],
],
'coupon_display_info' => [
'code_display_mode' => 'QRCODE',
'background_color' => 'Color020',
'entrance_mini_program' => [
'appid' => 'wx234545656765876',
'path' => '/path/index/index',
'entrance_wording' => '欢迎选购',
'guidance_wording' => '获取更多优惠',
],
'entrance_official_account' => [
'appid' => 'wx1234567890',
],
'entrance_finder' => [
'finder_id' => 'gh_12345678',
'finder_video_id' => 'UDFsdf24df34dD456Hdf34',
'finder_video_cover_image_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx',
],
],
'notify_config' => [
'notify_appid' => 'wx23232232323',
],
'store_scope' => 'NONE',
],
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->marketing->partner->productCoupon->productCoupons->_product_coupon_id_->stocks->post([
'product_coupon_id' => '1000000013',
'json' => [
'brand_id' => '120344',
'out_request_no' => '34657_20250101_123456',
'stock' => [
'remark' => '疯狂星期四项目专用',
'coupon_code_mode' => 'WECHATPAY',
'stock_send_rule' => [
'max_count' => 100000,
'max_count_per_day' => 100000000,
'max_count_per_user' => 5,
],
'single_usage_rule' => [
'coupon_available_period' => [
'available_begin_time' => '2025-08-01T00:00:00+08:00',
'available_end_time' => '2025-08-31T23:59:59+08:00',
'available_days' => 30,
'wait_days_after_receive' => 1,
'weekly_available_period' => [
'day_list' => ['MONDAY'],
'day_period_list' => [[
'begin_time' => 60,
'end_time' => 86399,
],],
],
'irregular_available_period_list' => [[
'begin_time' => '2025-08-01T00:00:00+08:00',
'end_time' => '2025-08-31T23:59:59+08:00',
],],
],
'normal_coupon' => [
'threshold' => 10000,
'discount_amount' => 1,
],
'discount_coupon' => [
'threshold' => 10000,
'percent_off' => 20,
],
'exchange_coupon' => [
'threshold' => 10000,
'exchange_price' => 20,
],
],
'sequential_usage_rule' => [
'coupon_available_period' => [
'available_begin_time' => '2025-08-01T00:00:00+08:00',
'available_end_time' => '2025-08-31T23:59:59+08:00',
'wait_days_after_receive' => 1,
'weekly_available_period' => [
'day_list' => ['MONDAY'],
'day_period_list' => [[
'begin_time' => 60,
'end_time' => 86399,
],],
],
'irregular_available_period_list' => [[
'begin_time' => '2025-08-01T00:00:00+08:00',
'end_time' => '2025-08-31T23:59:59+08:00',
],],
],
'normal_coupon_list' => [[
'threshold' => 10000,
'discount_amount' => 1,
],],
'discount_coupon_list' => [[
'threshold' => 10000,
'percent_off' => 20,
],],
'exchange_coupon_list' => [[
'threshold' => 10000,
'exchange_price' => 20,
],],
'special_first' => true,
],
'usage_rule_display_info' => [
'coupon_usage_method_list' => ['OFFLINE'],
'mini_program_appid' => 'wx1234567890',
'mini_program_path' => '/pages/index/product',
'app_path' => '',
'usage_description' => '工作日可用',
'coupon_available_store_info' => [
'description' => '所有门店可用,可使用小程序查看门店列表',
'mini_program_appid' => 'wx1234567890',
'mini_program_path' => '/pages/index/product',
],
],
'coupon_display_info' => [
'code_display_mode' => 'QRCODE',
'background_color' => 'Color020',
'entrance_mini_program' => [
'appid' => 'wx234545656765876',
'path' => '/path/index/index',
'entrance_wording' => '欢迎选购',
'guidance_wording' => '获取更多优惠',
],
'entrance_official_account' => [
'appid' => 'wx1234567890',
],
'entrance_finder' => [
'finder_id' => 'gh_12345678',
'finder_video_id' => 'UDFsdf24df34dD456Hdf34',
'finder_video_cover_image_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx',
],
],
'notify_config' => [
'notify_appid' => 'wx23232232323',
],
'store_scope' => 'NONE',
],
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/marketing/partner/product-coupon/product-coupons/{product_coupon_id}/stocks')->post([
'product_coupon_id' => '1000000013',
'json' => [
'brand_id' => '120344',
'out_request_no' => '34657_20250101_123456',
'stock' => [
'remark' => '疯狂星期四项目专用',
'coupon_code_mode' => 'WECHATPAY',
'stock_send_rule' => [
'max_count' => 100000,
'max_count_per_day' => 100000000,
'max_count_per_user' => 5,
],
'single_usage_rule' => [
'coupon_available_period' => [
'available_begin_time' => '2025-08-01T00:00:00+08:00',
'available_end_time' => '2025-08-31T23:59:59+08:00',
'available_days' => 30,
'wait_days_after_receive' => 1,
'weekly_available_period' => [
'day_list' => ['MONDAY'],
'day_period_list' => [[
'begin_time' => 60,
'end_time' => 86399,
],],
],
'irregular_available_period_list' => [[
'begin_time' => '2025-08-01T00:00:00+08:00',
'end_time' => '2025-08-31T23:59:59+08:00',
],],
],
'normal_coupon' => [
'threshold' => 10000,
'discount_amount' => 1,
],
'discount_coupon' => [
'threshold' => 10000,
'percent_off' => 20,
],
'exchange_coupon' => [
'threshold' => 10000,
'exchange_price' => 20,
],
],
'sequential_usage_rule' => [
'coupon_available_period' => [
'available_begin_time' => '2025-08-01T00:00:00+08:00',
'available_end_time' => '2025-08-31T23:59:59+08:00',
'wait_days_after_receive' => 1,
'weekly_available_period' => [
'day_list' => ['MONDAY'],
'day_period_list' => [[
'begin_time' => 60,
'end_time' => 86399,
],],
],
'irregular_available_period_list' => [[
'begin_time' => '2025-08-01T00:00:00+08:00',
'end_time' => '2025-08-31T23:59:59+08:00',
],],
],
'normal_coupon_list' => [[
'threshold' => 10000,
'discount_amount' => 1,
],],
'discount_coupon_list' => [[
'threshold' => 10000,
'percent_off' => 20,
],],
'exchange_coupon_list' => [[
'threshold' => 10000,
'exchange_price' => 20,
],],
'special_first' => true,
],
'usage_rule_display_info' => [
'coupon_usage_method_list' => ['OFFLINE'],
'mini_program_appid' => 'wx1234567890',
'mini_program_path' => '/pages/index/product',
'app_path' => '',
'usage_description' => '工作日可用',
'coupon_available_store_info' => [
'description' => '所有门店可用,可使用小程序查看门店列表',
'mini_program_appid' => 'wx1234567890',
'mini_program_path' => '/pages/index/product',
],
],
'coupon_display_info' => [
'code_display_mode' => 'QRCODE',
'background_color' => 'Color020',
'entrance_mini_program' => [
'appid' => 'wx234545656765876',
'path' => '/path/index/index',
'entrance_wording' => '欢迎选购',
'guidance_wording' => '获取更多优惠',
],
'entrance_official_account' => [
'appid' => 'wx1234567890',
],
'entrance_finder' => [
'finder_id' => 'gh_12345678',
'finder_video_id' => 'UDFsdf24df34dD456Hdf34',
'finder_video_cover_image_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx',
],
],
'notify_config' => [
'notify_appid' => 'wx23232232323',
],
'store_scope' => 'NONE',
],
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/marketing/partner/product-coupon/product-coupons/{product_coupon_id}/stocks']->post([
'product_coupon_id' => '1000000013',
'json' => [
'brand_id' => '120344',
'out_request_no' => '34657_20250101_123456',
'stock' => [
'remark' => '疯狂星期四项目专用',
'coupon_code_mode' => 'WECHATPAY',
'stock_send_rule' => [
'max_count' => 100000,
'max_count_per_day' => 100000000,
'max_count_per_user' => 5,
],
'single_usage_rule' => [
'coupon_available_period' => [
'available_begin_time' => '2025-08-01T00:00:00+08:00',
'available_end_time' => '2025-08-31T23:59:59+08:00',
'available_days' => 30,
'wait_days_after_receive' => 1,
'weekly_available_period' => [
'day_list' => ['MONDAY'],
'day_period_list' => [[
'begin_time' => 60,
'end_time' => 86399,
],],
],
'irregular_available_period_list' => [[
'begin_time' => '2025-08-01T00:00:00+08:00',
'end_time' => '2025-08-31T23:59:59+08:00',
],],
],
'normal_coupon' => [
'threshold' => 10000,
'discount_amount' => 1,
],
'discount_coupon' => [
'threshold' => 10000,
'percent_off' => 20,
],
'exchange_coupon' => [
'threshold' => 10000,
'exchange_price' => 20,
],
],
'sequential_usage_rule' => [
'coupon_available_period' => [
'available_begin_time' => '2025-08-01T00:00:00+08:00',
'available_end_time' => '2025-08-31T23:59:59+08:00',
'wait_days_after_receive' => 1,
'weekly_available_period' => [
'day_list' => ['MONDAY'],
'day_period_list' => [[
'begin_time' => 60,
'end_time' => 86399,
],],
],
'irregular_available_period_list' => [[
'begin_time' => '2025-08-01T00:00:00+08:00',
'end_time' => '2025-08-31T23:59:59+08:00',
],],
],
'normal_coupon_list' => [[
'threshold' => 10000,
'discount_amount' => 1,
],],
'discount_coupon_list' => [[
'threshold' => 10000,
'percent_off' => 20,
],],
'exchange_coupon_list' => [[
'threshold' => 10000,
'exchange_price' => 20,
],],
'special_first' => true,
],
'usage_rule_display_info' => [
'coupon_usage_method_list' => ['OFFLINE'],
'mini_program_appid' => 'wx1234567890',
'mini_program_path' => '/pages/index/product',
'app_path' => '',
'usage_description' => '工作日可用',
'coupon_available_store_info' => [
'description' => '所有门店可用,可使用小程序查看门店列表',
'mini_program_appid' => 'wx1234567890',
'mini_program_path' => '/pages/index/product',
],
],
'coupon_display_info' => [
'code_display_mode' => 'QRCODE',
'background_color' => 'Color020',
'entrance_mini_program' => [
'appid' => 'wx234545656765876',
'path' => '/path/index/index',
'entrance_wording' => '欢迎选购',
'guidance_wording' => '获取更多优惠',
],
'entrance_official_account' => [
'appid' => 'wx1234567890',
],
'entrance_finder' => [
'finder_id' => 'gh_12345678',
'finder_video_id' => 'UDFsdf24df34dD456Hdf34',
'finder_video_cover_image_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx',
],
],
'notify_config' => [
'notify_appid' => 'wx23232232323',
],
'store_scope' => 'NONE',
],
],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典 | 类型 | 描述 |
---|---|---|
product_coupon_id | string | 商品券ID |
stock_id | string | 批次ID |
remark | string | 备注 |
coupon_code_mode | string | 券Code分配模式WECHATPAY | UPLOAD | API_ASSIGN 枚举值之一 |
coupon_code_count_info | object | 品牌方预上传的券Code数量信息 |
total_count | integer | 已上传的Code总数 |
available_count | integer | 当前可用的Code |
stock_send_rule | object | 发放规则 |
max_count | integer | 发放次数总上限 |
max_count_per_day | integer | 每日发放次数上限 |
max_count_per_user | integer | 每个用户领取次数上限 |
single_usage_rule | object | 单券使用规则 |
coupon_available_period | object | 券可核销时间 |
available_begin_time | string | 开始时间 |
available_end_time | string | 结束时间 |
available_days | integer | 生效后N天内有效 |
wait_days_after_receive | integer | 领取后N天开始生效 |
weekly_available_period | object | 每周固定可用时间 |
day_list | string[] | 每周可用星期数MONDAY | TUESDAY | WEDNESDAY | THURSDAY | FRIDAY | SATURDAY | SUNDAY 枚举值之一 |
day_period_list | object[] | 当天可用时间段 |
begin_time | integer | 当天可用开始时间 |
end_time | integer | 当天可用结束时间 |
irregular_available_period_list | object[] | 无规律的可用时间段 |
begin_time | string | 开始时间 |
end_time | string | 结束时间 |
normal_coupon | object | 满减券使用规则 |
threshold | integer | 门槛金额 |
discount_amount | integer | 固定减免金额 |
discount_coupon | object | 折扣券使用规则 |
threshold | integer | 门槛金额 |
percent_off | integer | 固定减免百分比 |
exchange_coupon | object | 兑换券使用规则 |
threshold | integer | 门槛金额 |
exchange_price | integer | 固定兑换价格 |
sequential_usage_rule | object | 多次优惠使用规则 |
coupon_available_period | object | 券可核销时间 |
available_begin_time | string | 开始时间 |
available_end_time | string | 结束时间 |
wait_days_after_receive | integer | 领取后N天开始生效 |
weekly_available_period | object | 每周固定可用时间 |
day_list | string[] | 每周可用星期数MONDAY | TUESDAY | WEDNESDAY | THURSDAY | FRIDAY | SATURDAY | SUNDAY 枚举值之一 |
day_period_list | object[] | 当天可用时间段 |
begin_time | integer | 当天可用开始时间 |
end_time | integer | 当天可用结束时间 |
irregular_available_period_list | object[] | 无规律的可用时间段 |
begin_time | string | 开始时间 |
end_time | string | 结束时间 |
normal_coupon_list | object[] | 满减券使用规则 |
threshold | integer | 门槛金额 |
discount_amount | integer | 固定减免金额 |
discount_coupon_list | object[] | 折扣券使用规则列表 |
threshold | integer | 门槛金额 |
percent_off | integer | 固定减免百分比 |
exchange_coupon_list | object[] | 兑换券使用规则列表 |
threshold | integer | 门槛金额 |
exchange_price | integer | 固定兑换价格 |
special_first | boolean | 多次优惠是否提供首笔特惠 |
usage_rule_display_info | object | 券使用规则展示信息 |
coupon_usage_method_list | string[] | 券使用方式列表OFFLINE | MINI_PROGRAM | APP | PAYMENT_CODE 枚举值之一 |
mini_program_appid | string | 小程序AppID |
mini_program_path | string | 小程序跳转路径 |
app_path | string | APP跳转路径 |
usage_description | string | 券使用说明 |
coupon_available_store_info | object | 券可用门店信息 |
description | string | 券可用门店描述 |
mini_program_appid | string | 小程序AppID |
mini_program_path | string | 小程序跳转路径 |
coupon_display_info | object | 用户商品券展示信息 |
code_display_mode | string | 用户商品券Code展示模式INVISIBLE | BARCODE | QRCODE 枚举值之一 |
background_color | string | 背景颜色Color010 | Color020 | Color030 | Color040 | Color050 | Color060 | Color070 | Color080 | Color090 | Color100 枚举值之一 |
entrance_mini_program | object | 小程序入口 |
appid | string | 小程序appid |
path | string | 小程序跳转路径 |
entrance_wording | string | 入口文案 |
guidance_wording | string | 引导文案 |
entrance_official_account | object | 公众号入口 |
appid | string | 公众号AppID |
entrance_finder | object | 视频号入口 |
finder_id | string | 视频号ID |
finder_video_id | string | 视频号视频ID |
finder_video_cover_image_url | string | 视频号封面图 |
notify_config | object | 事件通知配置 |
notify_appid | string | 事件通知appid |
store_scope | string | 可用门店范围NONE | ALL | SPECIFIC 枚举值之一 |
sent_count_info | object | 已发放次数 |
total_count | integer | 已发放总次数 |
today_count | integer | 当天已发放次数 |
state | string | 批次状态AUDITING | SENDING | PAUSED | STOPPED | DEACTIVATED 枚举值之一 |
deactivate_request_no | string | 失效请求单号 |
deactivate_time | string | 失效时间 |
deactivate_reason | string | 失效原因 |
brand_id | string | 品牌ID |
参阅 官方文档
查询商品券批次列表
品牌方可以通过该接口分页查询某个商品券的批次列表。
请求参数 | 类型 | 描述 |
---|---|---|
product_coupon_id | string | 商品券ID |
query | object | 声明请求的查询参数 |
state | string | 批次状态AUDITING | SENDING | PAUSED | STOPPED | DEACTIVATED 枚举值之一 |
page_size | integer | 分页大小 |
page_token | string | 分页Token |
brand_id | string | 品牌ID |
php
$instance->v3->marketing->partner->productCoupon->productCoupons->_product_coupon_id_->stocks->getAsync([
'product_coupon_id' => '1000000013',
'query' => [
'state' => 'AUDITING',
'page_size' => 20,
'page_token' => 'MTIzMjUK',
'brand_id' => '120344',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/marketing/partner/product-coupon/product-coupons/{product_coupon_id}/stocks')->getAsync([
'product_coupon_id' => '1000000013',
'query' => [
'state' => 'AUDITING',
'page_size' => 20,
'page_token' => 'MTIzMjUK',
'brand_id' => '120344',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/marketing/partner/product-coupon/product-coupons/{product_coupon_id}/stocks']->getAsync([
'product_coupon_id' => '1000000013',
'query' => [
'state' => 'AUDITING',
'page_size' => 20,
'page_token' => 'MTIzMjUK',
'brand_id' => '120344',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->marketing->partner->productCoupon->productCoupons->_product_coupon_id_->stocks->get([
'product_coupon_id' => '1000000013',
'query' => [
'state' => 'AUDITING',
'page_size' => 20,
'page_token' => 'MTIzMjUK',
'brand_id' => '120344',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/marketing/partner/product-coupon/product-coupons/{product_coupon_id}/stocks')->get([
'product_coupon_id' => '1000000013',
'query' => [
'state' => 'AUDITING',
'page_size' => 20,
'page_token' => 'MTIzMjUK',
'brand_id' => '120344',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/marketing/partner/product-coupon/product-coupons/{product_coupon_id}/stocks']->get([
'product_coupon_id' => '1000000013',
'query' => [
'state' => 'AUDITING',
'page_size' => 20,
'page_token' => 'MTIzMjUK',
'brand_id' => '120344',
],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典 | 类型 | 描述 |
---|---|---|
total_count | integer | 总个数 |
next_page_token | string | 下一页Token |
stock_list | object[] | 批次列表 |
product_coupon_id | string | 商品券ID |
stock_id | string | 批次ID |
remark | string | 备注 |
coupon_code_mode | string | 券Code分配模式WECHATPAY | UPLOAD | API_ASSIGN 枚举值之一 |
coupon_code_count_info | object | 品牌方预上传的券Code数量信息 |
total_count | integer | 已上传的Code总数 |
available_count | integer | 当前可用的Code |
stock_send_rule | object | 发放规则 |
max_count | integer | 发放次数总上限 |
max_count_per_day | integer | 每日发放次数上限 |
max_count_per_user | integer | 每个用户领取次数上限 |
single_usage_rule | object | 单券使用规则 |
coupon_available_period | object | 券可核销时间 |
available_begin_time | string | 开始时间 |
available_end_time | string | 结束时间 |
available_days | integer | 生效后N天内有效 |
wait_days_after_receive | integer | 领取后N天开始生效 |
weekly_available_period | object | 每周固定可用时间 |
day_list | string[] | 每周可用星期数MONDAY | TUESDAY | WEDNESDAY | THURSDAY | FRIDAY | SATURDAY | SUNDAY 枚举值之一 |
day_period_list | object[] | 当天可用时间段 |
begin_time | integer | 当天可用开始时间 |
end_time | integer | 当天可用结束时间 |
irregular_available_period_list | object[] | 无规律的可用时间段 |
begin_time | string | 开始时间 |
end_time | string | 结束时间 |
normal_coupon | object | 满减券使用规则 |
threshold | integer | 门槛金额 |
discount_amount | integer | 固定减免金额 |
discount_coupon | object | 折扣券使用规则 |
threshold | integer | 门槛金额 |
percent_off | integer | 固定减免百分比 |
exchange_coupon | object | 兑换券使用规则 |
threshold | integer | 门槛金额 |
exchange_price | integer | 固定兑换价格 |
sequential_usage_rule | object | 多次优惠使用规则 |
coupon_available_period | object | 券可核销时间 |
available_begin_time | string | 开始时间 |
available_end_time | string | 结束时间 |
wait_days_after_receive | integer | 领取后N天开始生效 |
weekly_available_period | object | 每周固定可用时间 |
day_list | string[] | 每周可用星期数MONDAY | TUESDAY | WEDNESDAY | THURSDAY | FRIDAY | SATURDAY | SUNDAY 枚举值之一 |
day_period_list | object[] | 当天可用时间段 |
begin_time | integer | 当天可用开始时间 |
end_time | integer | 当天可用结束时间 |
irregular_available_period_list | object[] | 无规律的可用时间段 |
begin_time | string | 开始时间 |
end_time | string | 结束时间 |
normal_coupon_list | object[] | 满减券使用规则 |
threshold | integer | 门槛金额 |
discount_amount | integer | 固定减免金额 |
discount_coupon_list | object[] | 折扣券使用规则列表 |
threshold | integer | 门槛金额 |
percent_off | integer | 固定减免百分比 |
exchange_coupon_list | object[] | 兑换券使用规则列表 |
threshold | integer | 门槛金额 |
exchange_price | integer | 固定兑换价格 |
special_first | boolean | 多次优惠是否提供首笔特惠 |
usage_rule_display_info | object | 券使用规则展示信息 |
coupon_usage_method_list | string[] | 券使用方式列表OFFLINE | MINI_PROGRAM | APP | PAYMENT_CODE 枚举值之一 |
mini_program_appid | string | 小程序AppID |
mini_program_path | string | 小程序跳转路径 |
app_path | string | APP跳转路径 |
usage_description | string | 券使用说明 |
coupon_available_store_info | object | 券可用门店信息 |
description | string | 券可用门店描述 |
mini_program_appid | string | 小程序AppID |
mini_program_path | string | 小程序跳转路径 |
coupon_display_info | object | 用户商品券展示信息 |
code_display_mode | string | 用户商品券Code展示模式INVISIBLE | BARCODE | QRCODE 枚举值之一 |
background_color | string | 背景颜色Color010 | Color020 | Color030 | Color040 | Color050 | Color060 | Color070 | Color080 | Color090 | Color100 枚举值之一 |
entrance_mini_program | object | 小程序入口 |
appid | string | 小程序appid |
path | string | 小程序跳转路径 |
entrance_wording | string | 入口文案 |
guidance_wording | string | 引导文案 |
entrance_official_account | object | 公众号入口 |
appid | string | 公众号AppID |
entrance_finder | object | 视频号入口 |
finder_id | string | 视频号ID |
finder_video_id | string | 视频号视频ID |
finder_video_cover_image_url | string | 视频号封面图 |
notify_config | object | 事件通知配置 |
notify_appid | string | 事件通知appid |
store_scope | string | 可用门店范围NONE | ALL | SPECIFIC 枚举值之一 |
sent_count_info | object | 已发放次数 |
total_count | integer | 已发放总次数 |
today_count | integer | 当天已发放次数 |
state | string | 批次状态AUDITING | SENDING | PAUSED | STOPPED | DEACTIVATED 枚举值之一 |
deactivate_request_no | string | 失效请求单号 |
deactivate_time | string | 失效时间 |
deactivate_reason | string | 失效原因 |
brand_id | string | 品牌ID |
参阅 官方文档