Skip to content

修改及查询商品券指定批次

修改商品券指定批次

品牌方可以通过该接口修改商品券批次的基本信息,包括展示信息、通知配置。展示信息修改不会影响已经发放的用户商品券。

请求参数类型描述
product_coupon_idstring商品券ID
stock_idstring批次ID
jsonobject声明请求的JSON数据结构
brand_idstring品牌ID
out_request_nostring修改请求单号
remarkstring备注
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->_product_coupon_id_->stocks->_stock_id_->patchAsync([
  'product_coupon_id' => '1000000013',
  'stock_id' => '1000000013001',
  'json' => [
    'brand_id'                => '120344',
    'out_request_no'          => '34657_20250101_123456',
    'remark'                  => '疯狂星期四项目专用',
    '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/{stock_id}')->patchAsync([
  'product_coupon_id' => '1000000013',
  'stock_id' => '1000000013001',
  'json' => [
    'brand_id'                => '120344',
    'out_request_no'          => '34657_20250101_123456',
    'remark'                  => '疯狂星期四项目专用',
    '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/{stock_id}']->patchAsync([
  'product_coupon_id' => '1000000013',
  'stock_id' => '1000000013001',
  'json' => [
    'brand_id'                => '120344',
    'out_request_no'          => '34657_20250101_123456',
    'remark'                  => '疯狂星期四项目专用',
    '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->_stock_id_->patch([
  'product_coupon_id' => '1000000013',
  'stock_id' => '1000000013001',
  'json' => [
    'brand_id'                => '120344',
    'out_request_no'          => '34657_20250101_123456',
    'remark'                  => '疯狂星期四项目专用',
    '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/{stock_id}')->patch([
  'product_coupon_id' => '1000000013',
  'stock_id' => '1000000013001',
  'json' => [
    'brand_id'                => '120344',
    'out_request_no'          => '34657_20250101_123456',
    'remark'                  => '疯狂星期四项目专用',
    '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/{stock_id}']->patch([
  'product_coupon_id' => '1000000013',
  'stock_id' => '1000000013001',
  'json' => [
    'brand_id'                => '120344',
    'out_request_no'          => '34657_20250101_123456',
    'remark'                  => '疯狂星期四项目专用',
    '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
stock_idstring批次ID
remarkstring备注
coupon_code_modestring券Code分配模式
WECHATPAY | UPLOAD | API_ASSIGN 枚举值之一
coupon_code_count_infoobject品牌方预上传的券Code数量信息
total_countinteger已上传的Code总数
available_countinteger当前可用的Code
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

参阅 官方文档

查询商品券指定批次

品牌方可以通过该接口查询某个商品券批次的详情。

请求参数类型描述
product_coupon_idstring商品券ID
stock_idstring批次ID
queryobject声明请求的查询参数
brand_idstring品牌ID
php
$instance->v3->marketing->partner->productCoupon->productCoupons->_product_coupon_id_->stocks->_stock_id_->getAsync([
  'product_coupon_id' => '1000000013',
  'stock_id' => '1000000013001',
  'query' => [
    '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/{stock_id}')->getAsync([
  'product_coupon_id' => '1000000013',
  'stock_id' => '1000000013001',
  'query' => [
    '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/{stock_id}']->getAsync([
  'product_coupon_id' => '1000000013',
  'stock_id' => '1000000013001',
  'query' => [
    '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->_stock_id_->get([
  'product_coupon_id' => '1000000013',
  'stock_id' => '1000000013001',
  'query' => [
    '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/{stock_id}')->get([
  'product_coupon_id' => '1000000013',
  'stock_id' => '1000000013001',
  'query' => [
    '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/{stock_id}']->get([
  'product_coupon_id' => '1000000013',
  'stock_id' => '1000000013001',
  'query' => [
    'brand_id' => '120344',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
product_coupon_idstring商品券ID
stock_idstring批次ID
remarkstring备注
coupon_code_modestring券Code分配模式
WECHATPAY | UPLOAD | API_ASSIGN 枚举值之一
coupon_code_count_infoobject品牌方预上传的券Code数量信息
total_countinteger已上传的Code总数
available_countinteger当前可用的Code
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