向用户发放商品券
商户可通过该接口向指定用户发放关联了商品信息的商家券,未关联商品信息的商家券不支持通过该接口发放;支持指定券 code 发放或系统自动分配券 code。
请求参数 | 类型 | 描述 |
---|---|---|
json | object | 声明请求的JSON 数据结构 |
openid | string | 用户标识 |
appid | string | 公众账号ID |
stock_id | string | 批次号 |
out_request_no | string | 发券凭证 |
coupon_code | string | 券code |
coupon_type | string | 券类型NORMAL | MEMBER 枚举值之一 |
member_card_id | string | 会员卡ID |
php
$instance->v3->marketing->busifavor->productCoupons->send->postAsync([
'json' => [
'openid' => 'xsd3434454567676',
'appid' => 'wx1234567889999',
'stock_id' => '12312354',
'out_request_no' => '2335465',
'coupon_code' => '202007019999',
'coupon_type' => 'NORMAL',
'member_card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/marketing/busifavor/product-coupons/send')->postAsync([
'json' => [
'openid' => 'xsd3434454567676',
'appid' => 'wx1234567889999',
'stock_id' => '12312354',
'out_request_no' => '2335465',
'coupon_code' => '202007019999',
'coupon_type' => 'NORMAL',
'member_card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/marketing/busifavor/product-coupons/send']->postAsync([
'json' => [
'openid' => 'xsd3434454567676',
'appid' => 'wx1234567889999',
'stock_id' => '12312354',
'out_request_no' => '2335465',
'coupon_code' => '202007019999',
'coupon_type' => 'NORMAL',
'member_card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->marketing->busifavor->productCoupons->send->post([
'json' => [
'openid' => 'xsd3434454567676',
'appid' => 'wx1234567889999',
'stock_id' => '12312354',
'out_request_no' => '2335465',
'coupon_code' => '202007019999',
'coupon_type' => 'NORMAL',
'member_card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/marketing/busifavor/product-coupons/send')->post([
'json' => [
'openid' => 'xsd3434454567676',
'appid' => 'wx1234567889999',
'stock_id' => '12312354',
'out_request_no' => '2335465',
'coupon_code' => '202007019999',
'coupon_type' => 'NORMAL',
'member_card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/marketing/busifavor/product-coupons/send']->post([
'json' => [
'openid' => 'xsd3434454567676',
'appid' => 'wx1234567889999',
'stock_id' => '12312354',
'out_request_no' => '2335465',
'coupon_code' => '202007019999',
'coupon_type' => 'NORMAL',
'member_card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典 | 类型 | 描述 |
---|---|---|
stock_id | string | 批次号 |
coupon_code | string | 券code |
out_request_no | string | 发券凭证 |