Skip to content

创建商品券

品牌方可以通过该接口创建商品券和批次。微信支付创建成功后,会返回此次创建的商品券以及批次。品牌方可在【经营平台】上配置【活动】对商品券进行投放。频率限制:接口级限制1000/min

请求参数类型描述
jsonobject声明请求的JSON数据结构
brand_idstring品牌ID
out_request_nostring创建请求单号
scopestring优惠范围
ALL | SINGLE 枚举值之一
typestring商品券类型
NORMAL | DISCOUNT | EXCHANGE 枚举值之一
usage_modestring使用模式
SINGLE | SEQUENTIAL 枚举值之一
single_usage_infoobject单券模式信息
normal_couponobject满减券使用规则
thresholdinteger门槛金额
discount_amountinteger固定减免金额
discount_couponobject折扣券使用规则
thresholdinteger门槛金额
percent_offinteger固定减免百分比
sequential_usage_infoobject多次优惠模式信息
typestring多次优惠规则类型
INCREMENTAL | EQUAL 枚举值之一
countinteger可使用次数
available_daysinteger多次优惠有效天数
interval_daysinteger多次优惠使用间隔天数
display_infoobject展示信息
namestring商品券名称
image_urlstring商品券图片
background_urlstring商品券背景图
detail_image_url_liststring[]商品券详情图列表
original_priceinteger商品原价
combo_package_listobject[]套餐组合
namestring套餐名
pick_countinteger可选单品数量
choice_listobject[]单品列表
namestring单品名称
priceinteger单品价格
countinteger单品数量
image_urlstring单品图片
mini_program_appidstring单品跳转小程序AppID
mini_program_pathstring单品跳转小程序路径
out_product_nostring外部商品ID
stockobject批次信息
remarkstring备注
coupon_code_modestring券Code分配模式
WECHATPAY | UPLOAD | API_ASSIGN 枚举值之一
stock_send_ruleobject发放规则
max_countinteger发放次数总上限
max_count_per_dayinteger每日发放次数上限
max_count_per_userinteger每个用户领取次数上限
single_usage_ruleobject单券使用规则
coupon_available_periodobject券可核销时间
available_begin_timestring开始时间
available_end_timestring结束时间
available_daysinteger生效后N天内有效
wait_days_after_receiveinteger领取后N天开始生效
weekly_available_periodobject每周固定可用时间
day_liststring[]每周可用星期数
MONDAY | TUESDAY | WEDNESDAY | THURSDAY | FRIDAY | SATURDAY | SUNDAY 枚举值之一
day_period_listobject[]当天可用时间段
begin_timeinteger当天可用开始时间
end_timeinteger当天可用结束时间
irregular_available_period_listobject[]无规律的可用时间段
begin_timestring开始时间
end_timestring结束时间
normal_couponobject满减券使用规则
thresholdinteger门槛金额
discount_amountinteger固定减免金额
discount_couponobject折扣券使用规则
thresholdinteger门槛金额
percent_offinteger固定减免百分比
exchange_couponobject兑换券使用规则
thresholdinteger门槛金额
exchange_priceinteger固定兑换价格
sequential_usage_ruleobject多次优惠使用规则
coupon_available_periodobject券可核销时间
available_begin_timestring开始时间
available_end_timestring结束时间
wait_days_after_receiveinteger领取后N天开始生效
weekly_available_periodobject每周固定可用时间
day_liststring[]每周可用星期数
MONDAY | TUESDAY | WEDNESDAY | THURSDAY | FRIDAY | SATURDAY | SUNDAY 枚举值之一
day_period_listobject[]当天可用时间段
begin_timeinteger当天可用开始时间
end_timeinteger当天可用结束时间
irregular_available_period_listobject[]无规律的可用时间段
begin_timestring开始时间
end_timestring结束时间
normal_coupon_listobject[]满减券使用规则
thresholdinteger门槛金额
discount_amountinteger固定减免金额
discount_coupon_listobject[]折扣券使用规则列表
thresholdinteger门槛金额
percent_offinteger固定减免百分比
exchange_coupon_listobject[]兑换券使用规则列表
thresholdinteger门槛金额
exchange_priceinteger固定兑换价格
special_firstboolean多次优惠是否提供首笔特惠
usage_rule_display_infoobject券使用规则展示信息
coupon_usage_method_liststring[]券使用方式列表
OFFLINE | MINI_PROGRAM | APP | PAYMENT_CODE 枚举值之一
mini_program_appidstring小程序AppID
mini_program_pathstring小程序跳转路径
app_pathstringAPP跳转路径
usage_descriptionstring券使用说明
coupon_available_store_infoobject券可用门店信息
descriptionstring券可用门店描述
mini_program_appidstring小程序AppID
mini_program_pathstring小程序跳转路径
coupon_display_infoobject用户商品券展示信息
code_display_modestring用户商品券Code展示模式
INVISIBLE | BARCODE | QRCODE 枚举值之一
background_colorstring背景颜色
Color010 | Color020 | Color030 | Color040 | Color050 | Color060 | Color070 | Color080 | Color090 | Color100 枚举值之一
entrance_mini_programobject小程序入口
appidstring小程序appid
pathstring小程序跳转路径
entrance_wordingstring入口文案
guidance_wordingstring引导文案
entrance_official_accountobject公众号入口
appidstring公众号AppID
entrance_finderobject视频号入口
finder_idstring视频号ID
finder_video_idstring视频号视频ID
finder_video_cover_image_urlstring视频号封面图
notify_configobject事件通知配置
notify_appidstring事件通知appid
store_scopestring可用门店范围
NONE | ALL | SPECIFIC 枚举值之一
php
$instance->v3->marketing->partner->productCoupon->productCoupons->postAsync([
  'json' => [
    'brand_id'              => '120344',
    'out_request_no'        => '12345_20250101_A3489',
    'scope'                 => 'ALL',
    'type'                  => 'NORMAL',
    'usage_mode'            => 'SINGLE',
    'single_usage_info'     => [
      'normal_coupon'   => [
        'threshold'       => 10000,
        'discount_amount' => 1,
      ],
      'discount_coupon' => [
        'threshold'   => 10000,
        'percent_off' => 20,
      ],
    ],
    'sequential_usage_info' => [
      'type'           => 'INCREMENTAL',
      'count'          => 15,
      'available_days' => 365,
      'interval_days'  => 0,
    ],
    'display_info'          => [
      'name'                  => '全场满100立打8折',
      'image_url'             => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx',
      'background_url'        => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx',
      'detail_image_url_list' => ['https://wxpaylogo.qpic.cn/wxpayl'],
      'original_price'        => 10000,
      'combo_package_list'    => [[
        'name'        => '咖啡2选1',
        'pick_count'  => 3,
        'choice_list' => [[
          'name'               => '美式',
          'price'              => 10000,
          'count'              => 2,
          'image_url'          => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx',
          'mini_program_appid' => 'wx4fd12345678',
          'mini_program_path'  => '/pages/index/index',
        ],],
      ],],
    ],
    'out_product_no'        => 'Product_1234567890',
    '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'         => 30,
          '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')->postAsync([
  'json' => [
    'brand_id'              => '120344',
    'out_request_no'        => '12345_20250101_A3489',
    'scope'                 => 'ALL',
    'type'                  => 'NORMAL',
    'usage_mode'            => 'SINGLE',
    'single_usage_info'     => [
      'normal_coupon'   => [
        'threshold'       => 10000,
        'discount_amount' => 1,
      ],
      'discount_coupon' => [
        'threshold'   => 10000,
        'percent_off' => 20,
      ],
    ],
    'sequential_usage_info' => [
      'type'           => 'INCREMENTAL',
      'count'          => 15,
      'available_days' => 365,
      'interval_days'  => 0,
    ],
    'display_info'          => [
      'name'                  => '全场满100立打8折',
      'image_url'             => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx',
      'background_url'        => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx',
      'detail_image_url_list' => ['https://wxpaylogo.qpic.cn/wxpayl'],
      'original_price'        => 10000,
      'combo_package_list'    => [[
        'name'        => '咖啡2选1',
        'pick_count'  => 3,
        'choice_list' => [[
          'name'               => '美式',
          'price'              => 10000,
          'count'              => 2,
          'image_url'          => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx',
          'mini_program_appid' => 'wx4fd12345678',
          'mini_program_path'  => '/pages/index/index',
        ],],
      ],],
    ],
    'out_product_no'        => 'Product_1234567890',
    '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'         => 30,
          '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']->postAsync([
  'json' => [
    'brand_id'              => '120344',
    'out_request_no'        => '12345_20250101_A3489',
    'scope'                 => 'ALL',
    'type'                  => 'NORMAL',
    'usage_mode'            => 'SINGLE',
    'single_usage_info'     => [
      'normal_coupon'   => [
        'threshold'       => 10000,
        'discount_amount' => 1,
      ],
      'discount_coupon' => [
        'threshold'   => 10000,
        'percent_off' => 20,
      ],
    ],
    'sequential_usage_info' => [
      'type'           => 'INCREMENTAL',
      'count'          => 15,
      'available_days' => 365,
      'interval_days'  => 0,
    ],
    'display_info'          => [
      'name'                  => '全场满100立打8折',
      'image_url'             => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx',
      'background_url'        => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx',
      'detail_image_url_list' => ['https://wxpaylogo.qpic.cn/wxpayl'],
      'original_price'        => 10000,
      'combo_package_list'    => [[
        'name'        => '咖啡2选1',
        'pick_count'  => 3,
        'choice_list' => [[
          'name'               => '美式',
          'price'              => 10000,
          'count'              => 2,
          'image_url'          => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx',
          'mini_program_appid' => 'wx4fd12345678',
          'mini_program_path'  => '/pages/index/index',
        ],],
      ],],
    ],
    'out_product_no'        => 'Product_1234567890',
    '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'         => 30,
          '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->post([
  'json' => [
    'brand_id'              => '120344',
    'out_request_no'        => '12345_20250101_A3489',
    'scope'                 => 'ALL',
    'type'                  => 'NORMAL',
    'usage_mode'            => 'SINGLE',
    'single_usage_info'     => [
      'normal_coupon'   => [
        'threshold'       => 10000,
        'discount_amount' => 1,
      ],
      'discount_coupon' => [
        'threshold'   => 10000,
        'percent_off' => 20,
      ],
    ],
    'sequential_usage_info' => [
      'type'           => 'INCREMENTAL',
      'count'          => 15,
      'available_days' => 365,
      'interval_days'  => 0,
    ],
    'display_info'          => [
      'name'                  => '全场满100立打8折',
      'image_url'             => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx',
      'background_url'        => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx',
      'detail_image_url_list' => ['https://wxpaylogo.qpic.cn/wxpayl'],
      'original_price'        => 10000,
      'combo_package_list'    => [[
        'name'        => '咖啡2选1',
        'pick_count'  => 3,
        'choice_list' => [[
          'name'               => '美式',
          'price'              => 10000,
          'count'              => 2,
          'image_url'          => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx',
          'mini_program_appid' => 'wx4fd12345678',
          'mini_program_path'  => '/pages/index/index',
        ],],
      ],],
    ],
    'out_product_no'        => 'Product_1234567890',
    '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'         => 30,
          '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')->post([
  'json' => [
    'brand_id'              => '120344',
    'out_request_no'        => '12345_20250101_A3489',
    'scope'                 => 'ALL',
    'type'                  => 'NORMAL',
    'usage_mode'            => 'SINGLE',
    'single_usage_info'     => [
      'normal_coupon'   => [
        'threshold'       => 10000,
        'discount_amount' => 1,
      ],
      'discount_coupon' => [
        'threshold'   => 10000,
        'percent_off' => 20,
      ],
    ],
    'sequential_usage_info' => [
      'type'           => 'INCREMENTAL',
      'count'          => 15,
      'available_days' => 365,
      'interval_days'  => 0,
    ],
    'display_info'          => [
      'name'                  => '全场满100立打8折',
      'image_url'             => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx',
      'background_url'        => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx',
      'detail_image_url_list' => ['https://wxpaylogo.qpic.cn/wxpayl'],
      'original_price'        => 10000,
      'combo_package_list'    => [[
        'name'        => '咖啡2选1',
        'pick_count'  => 3,
        'choice_list' => [[
          'name'               => '美式',
          'price'              => 10000,
          'count'              => 2,
          'image_url'          => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx',
          'mini_program_appid' => 'wx4fd12345678',
          'mini_program_path'  => '/pages/index/index',
        ],],
      ],],
    ],
    'out_product_no'        => 'Product_1234567890',
    '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'         => 30,
          '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']->post([
  'json' => [
    'brand_id'              => '120344',
    'out_request_no'        => '12345_20250101_A3489',
    'scope'                 => 'ALL',
    'type'                  => 'NORMAL',
    'usage_mode'            => 'SINGLE',
    'single_usage_info'     => [
      'normal_coupon'   => [
        'threshold'       => 10000,
        'discount_amount' => 1,
      ],
      'discount_coupon' => [
        'threshold'   => 10000,
        'percent_off' => 20,
      ],
    ],
    'sequential_usage_info' => [
      'type'           => 'INCREMENTAL',
      'count'          => 15,
      'available_days' => 365,
      'interval_days'  => 0,
    ],
    'display_info'          => [
      'name'                  => '全场满100立打8折',
      'image_url'             => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx',
      'background_url'        => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx',
      'detail_image_url_list' => ['https://wxpaylogo.qpic.cn/wxpayl'],
      'original_price'        => 10000,
      'combo_package_list'    => [[
        'name'        => '咖啡2选1',
        'pick_count'  => 3,
        'choice_list' => [[
          'name'               => '美式',
          'price'              => 10000,
          'count'              => 2,
          'image_url'          => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx',
          'mini_program_appid' => 'wx4fd12345678',
          'mini_program_path'  => '/pages/index/index',
        ],],
      ],],
    ],
    'out_product_no'        => 'Product_1234567890',
    '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'         => 30,
          '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_idstring商品券ID
statestring商品券状态
AUDITING | EFFECTIVE | DEACTIVATED 枚举值之一
brand_idstring品牌ID
scopestring优惠范围
ALL | SINGLE 枚举值之一
typestring商品券类型
NORMAL | DISCOUNT | EXCHANGE 枚举值之一
usage_modestring使用模式
SINGLE | SEQUENTIAL 枚举值之一
single_usage_infoobject单券模式信息
normal_couponobject满减券使用规则
thresholdinteger门槛金额
discount_amountinteger固定减免金额
discount_couponobject折扣券使用规则
thresholdinteger门槛金额
percent_offinteger固定减免百分比
sequential_usage_infoobject多次优惠模式信息
typestring多次优惠规则类型
INCREMENTAL | EQUAL 枚举值之一
countinteger可使用次数
available_daysinteger多次优惠有效天数
interval_daysinteger多次优惠使用间隔天数
display_infoobject展示信息
namestring商品券名称
image_urlstring商品券图片
background_urlstring商品券背景图
detail_image_url_liststring[]商品券详情图列表
original_priceinteger商品原价
combo_package_listobject[]套餐组合
namestring套餐名
pick_countinteger可选单品数量
choice_listobject[]单品列表
namestring单品名称
priceinteger单品价格
countinteger单品数量
image_urlstring单品图片
mini_program_appidstring单品跳转小程序AppID
mini_program_pathstring单品跳转小程序路径
out_product_nostring外部商品ID
stockobject批次信息
product_coupon_idstring商品券ID
stock_idstring批次ID
remarkstring备注
coupon_code_modestring券Code分配模式
WECHATPAY | UPLOAD | API_ASSIGN 枚举值之一
stock_send_ruleobject发放规则
max_countinteger发放次数总上限
max_count_per_dayinteger每日发放次数上限
max_count_per_userinteger每个用户领取次数上限
single_usage_ruleobject单券使用规则
coupon_available_periodobject券可核销时间
available_begin_timestring开始时间
available_end_timestring结束时间
available_daysinteger生效后N天内有效
wait_days_after_receiveinteger领取后N天开始生效
weekly_available_periodobject每周固定可用时间
day_liststring[]每周可用星期数
MONDAY | TUESDAY | WEDNESDAY | THURSDAY | FRIDAY | SATURDAY | SUNDAY 枚举值之一
day_period_listobject[]当天可用时间段
begin_timeinteger当天可用开始时间
end_timeinteger当天可用结束时间
irregular_available_period_listobject[]无规律的可用时间段
begin_timestring开始时间
end_timestring结束时间
normal_couponobject满减券使用规则
thresholdinteger门槛金额
discount_amountinteger固定减免金额
discount_couponobject折扣券使用规则
thresholdinteger门槛金额
percent_offinteger固定减免百分比
exchange_couponobject兑换券使用规则
thresholdinteger门槛金额
exchange_priceinteger固定兑换价格
sequential_usage_ruleobject多次优惠使用规则
coupon_available_periodobject券可核销时间
available_begin_timestring开始时间
available_end_timestring结束时间
wait_days_after_receiveinteger领取后N天开始生效
weekly_available_periodobject每周固定可用时间
day_liststring[]每周可用星期数
MONDAY | TUESDAY | WEDNESDAY | THURSDAY | FRIDAY | SATURDAY | SUNDAY 枚举值之一
day_period_listobject[]当天可用时间段
begin_timeinteger当天可用开始时间
end_timeinteger当天可用结束时间
irregular_available_period_listobject[]无规律的可用时间段
begin_timestring开始时间
end_timestring结束时间
normal_coupon_listobject[]满减券使用规则
thresholdinteger门槛金额
discount_amountinteger固定减免金额
discount_coupon_listobject[]折扣券使用规则列表
thresholdinteger门槛金额
percent_offinteger固定减免百分比
exchange_coupon_listobject[]兑换券使用规则列表
thresholdinteger门槛金额
exchange_priceinteger固定兑换价格
special_firstboolean多次优惠是否提供首笔特惠
usage_rule_display_infoobject券使用规则展示信息
coupon_usage_method_liststring[]券使用方式列表
OFFLINE | MINI_PROGRAM | APP | PAYMENT_CODE 枚举值之一
mini_program_appidstring小程序AppID
mini_program_pathstring小程序跳转路径
app_pathstringAPP跳转路径
usage_descriptionstring券使用说明
coupon_available_store_infoobject券可用门店信息
descriptionstring券可用门店描述
mini_program_appidstring小程序AppID
mini_program_pathstring小程序跳转路径
coupon_display_infoobject用户商品券展示信息
code_display_modestring用户商品券Code展示模式
INVISIBLE | BARCODE | QRCODE 枚举值之一
background_colorstring背景颜色
Color010 | Color020 | Color030 | Color040 | Color050 | Color060 | Color070 | Color080 | Color090 | Color100 枚举值之一
entrance_mini_programobject小程序入口
appidstring小程序appid
pathstring小程序跳转路径
entrance_wordingstring入口文案
guidance_wordingstring引导文案
entrance_official_accountobject公众号入口
appidstring公众号AppID
entrance_finderobject视频号入口
finder_idstring视频号ID
finder_video_idstring视频号视频ID
finder_video_cover_image_urlstring视频号封面图
notify_configobject事件通知配置
notify_appidstring事件通知appid
store_scopestring可用门店范围
NONE | ALL | SPECIFIC 枚举值之一
sent_count_infoobject已发放次数
total_countinteger已发放总次数
today_countinteger当天已发放次数
statestring批次状态
AUDITING | SENDING | PAUSED | STOPPED | DEACTIVATED 枚举值之一
deactivate_request_nostring失效请求单号
deactivate_timestring失效时间
deactivate_reasonstring失效原因
brand_idstring品牌ID

参阅 官方文档

Published on the GitHub by TheNorthMemory