失效商品券批次
品牌方可以通过该接口使已经创建的某个商品券批次失效。注意:调用本接口只会失效单个批次,商品券本身以及其他商品券批次不受影响。失效商品券批次后,该批次不会有新的用户领券事件,但历史已经通过该批次发放的用户商品券仍然有效。
| 请求参数 | 类型 | 描述 |
|---|---|---|
| product_coupon_id | string | 商品券ID |
| stock_id | string | 批次ID |
| json | object | 声明请求的JSON数据结构 |
| brand_id | string | 品牌ID |
| out_request_no | string | 失效请求单号 |
| deactivate_reason | string | 失效原因 |
php
$instance->v3->marketing->partner->productCoupon->productCoupons->_product_coupon_id_->stocks->_stock_id_->deactivate->postAsync([
'product_coupon_id' => '1000000013',
'stock_id' => '1000000013001',
'json' => [
'brand_id' => '120344',
'out_request_no' => '34657_20250101_123456',
'deactivate_reason' => '批次信息有误,重新创建',
],
])
->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}/deactivate')->postAsync([
'product_coupon_id' => '1000000013',
'stock_id' => '1000000013001',
'json' => [
'brand_id' => '120344',
'out_request_no' => '34657_20250101_123456',
'deactivate_reason' => '批次信息有误,重新创建',
],
])
->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}/deactivate']->postAsync([
'product_coupon_id' => '1000000013',
'stock_id' => '1000000013001',
'json' => [
'brand_id' => '120344',
'out_request_no' => '34657_20250101_123456',
'deactivate_reason' => '批次信息有误,重新创建',
],
])
->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_->deactivate->post([
'product_coupon_id' => '1000000013',
'stock_id' => '1000000013001',
'json' => [
'brand_id' => '120344',
'out_request_no' => '34657_20250101_123456',
'deactivate_reason' => '批次信息有误,重新创建',
],
]);
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}/deactivate')->post([
'product_coupon_id' => '1000000013',
'stock_id' => '1000000013001',
'json' => [
'brand_id' => '120344',
'out_request_no' => '34657_20250101_123456',
'deactivate_reason' => '批次信息有误,重新创建',
],
]);
print_r(json_decode((string) $response->getBody(), true));php
$response = $instance['v3/marketing/partner/product-coupon/product-coupons/{product_coupon_id}/stocks/{stock_id}/deactivate']->post([
'product_coupon_id' => '1000000013',
'stock_id' => '1000000013001',
'json' => [
'brand_id' => '120344',
'out_request_no' => '34657_20250101_123456',
'deactivate_reason' => '批次信息有误,重新创建',
],
]);
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 |
参阅 官方文档