Skip to content

使券失效

商户可以通过该接口将可用券进行失效处理,券失效后无法再被核销

请求参数类型描述
jsonobject声明请求的JSON数据结构
coupon_codestring券code
stock_idstring批次号
deactivate_request_nostring失效请求单据号
deactivate_reasonstring失效原因
php
$instance->v3->marketing->busifavor->coupons->deactivate->postAsync([
  'json' => [
    'coupon_code' => 'sxxe34343434',
    'stock_id' => '1234567891',
    'deactivate_request_no' => '1002600620019090123143254436',
    'deactivate_reason' => '此券使用时间设置错误',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/marketing/busifavor/coupons/deactivate')->postAsync([
  'json' => [
    'coupon_code' => 'sxxe34343434',
    'stock_id' => '1234567891',
    'deactivate_request_no' => '1002600620019090123143254436',
    'deactivate_reason' => '此券使用时间设置错误',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/marketing/busifavor/coupons/deactivate']->postAsync([
  'json' => [
    'coupon_code' => 'sxxe34343434',
    'stock_id' => '1234567891',
    'deactivate_request_no' => '1002600620019090123143254436',
    'deactivate_reason' => '此券使用时间设置错误',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->marketing->busifavor->coupons->deactivate->post([
  'json' => [
    'coupon_code' => 'sxxe34343434',
    'stock_id' => '1234567891',
    'deactivate_request_no' => '1002600620019090123143254436',
    'deactivate_reason' => '此券使用时间设置错误',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/marketing/busifavor/coupons/deactivate')->post([
  'json' => [
    'coupon_code' => 'sxxe34343434',
    'stock_id' => '1234567891',
    'deactivate_request_no' => '1002600620019090123143254436',
    'deactivate_reason' => '此券使用时间设置错误',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/marketing/busifavor/coupons/deactivate']->post([
  'json' => [
    'coupon_code' => 'sxxe34343434',
    'stock_id' => '1234567891',
    'deactivate_request_no' => '1002600620019090123143254436',
    'deactivate_reason' => '此券使用时间设置错误',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
wechatpay_deactivate_timestring券成功失效的时间

参阅 官方文档

Published on the GitHub by TheNorthMemory