核销用户券
在用户满足优惠门槛后,商户可通过该接口核销用户微信卡包中具体某一张商家券。
| 请求参数 | 类型 | 描述 |
|---|---|---|
| json | object | 声明请求的JSON数据结构 |
| coupon_code | string | 券code |
| stock_id | string | 批次号 |
| appid | string | 公众账号ID |
| use_time | string | 请求核销时间 |
| use_request_no | string | 核销请求单据号 |
| openid | string | 用户标识 |
| out_trade_no | string | 商户订单号 |
| mch_id | string | 下单商户号 |
| transaction_id | string | 微信支付订单号 |
php
$instance->v3->marketing->busifavor->coupons->use->postAsync([
'json' => [
'coupon_code' => 'sxxe34343434',
'stock_id' => '100088',
'appid' => 'wx1234567889999',
'use_time' => '2015-05-20T13:29:35+08:00',
'use_request_no' => '1002600620019090123143254435',
'openid' => 'xsd3434454567676',
'out_trade_no' => '190000001',
'mch_id' => '190000001',
'transaction_id' => '4200000001856498491',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$instance->chain('v3/marketing/busifavor/coupons/use')->postAsync([
'json' => [
'coupon_code' => 'sxxe34343434',
'stock_id' => '100088',
'appid' => 'wx1234567889999',
'use_time' => '2015-05-20T13:29:35+08:00',
'use_request_no' => '1002600620019090123143254435',
'openid' => 'xsd3434454567676',
'out_trade_no' => '190000001',
'mch_id' => '190000001',
'transaction_id' => '4200000001856498491',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$instance['v3/marketing/busifavor/coupons/use']->postAsync([
'json' => [
'coupon_code' => 'sxxe34343434',
'stock_id' => '100088',
'appid' => 'wx1234567889999',
'use_time' => '2015-05-20T13:29:35+08:00',
'use_request_no' => '1002600620019090123143254435',
'openid' => 'xsd3434454567676',
'out_trade_no' => '190000001',
'mch_id' => '190000001',
'transaction_id' => '4200000001856498491',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$response = $instance->v3->marketing->busifavor->coupons->use->post([
'json' => [
'coupon_code' => 'sxxe34343434',
'stock_id' => '100088',
'appid' => 'wx1234567889999',
'use_time' => '2015-05-20T13:29:35+08:00',
'use_request_no' => '1002600620019090123143254435',
'openid' => 'xsd3434454567676',
'out_trade_no' => '190000001',
'mch_id' => '190000001',
'transaction_id' => '4200000001856498491',
],
]);
print_r(json_decode((string) $response->getBody(), true));php
$response = $instance->chain('v3/marketing/busifavor/coupons/use')->post([
'json' => [
'coupon_code' => 'sxxe34343434',
'stock_id' => '100088',
'appid' => 'wx1234567889999',
'use_time' => '2015-05-20T13:29:35+08:00',
'use_request_no' => '1002600620019090123143254435',
'openid' => 'xsd3434454567676',
'out_trade_no' => '190000001',
'mch_id' => '190000001',
'transaction_id' => '4200000001856498491',
],
]);
print_r(json_decode((string) $response->getBody(), true));php
$response = $instance['v3/marketing/busifavor/coupons/use']->post([
'json' => [
'coupon_code' => 'sxxe34343434',
'stock_id' => '100088',
'appid' => 'wx1234567889999',
'use_time' => '2015-05-20T13:29:35+08:00',
'use_request_no' => '1002600620019090123143254435',
'openid' => 'xsd3434454567676',
'out_trade_no' => '190000001',
'mch_id' => '190000001',
'transaction_id' => '4200000001856498491',
],
]);
print_r(json_decode((string) $response->getBody(), true));| 返回字典 | 类型 | 描述 |
|---|---|---|
| stock_id | string | 批次号 |
| openid | string | 用户标识 |
| wechatpay_use_time | string | 系统核销券成功的时间 |