Skip to content

向用户发券

请求参数类型描述
jsonobject声明请求的JSON数据结构
openidstring用户标识
appidstring公众账号ID
stock_idstring批次号
out_request_nostring发券凭证
coupon_codestring券code
php
$instance->v3->marketing->busifavor->coupons->send->postAsync([
  'json' => [
    'openid' => 'xsd3434454567676',
    'appid' => 'wx1234567889999',
    'stock_id' => '100088',
    'out_request_no' => '1002600620019090123143254435',
    'coupon_code' => 'sxxe34343434',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/marketing/busifavor/coupons/send')->postAsync([
  'json' => [
    'openid' => 'xsd3434454567676',
    'appid' => 'wx1234567889999',
    'stock_id' => '100088',
    'out_request_no' => '1002600620019090123143254435',
    'coupon_code' => 'sxxe34343434',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/marketing/busifavor/coupons/send']->postAsync([
  'json' => [
    'openid' => 'xsd3434454567676',
    'appid' => 'wx1234567889999',
    'stock_id' => '100088',
    'out_request_no' => '1002600620019090123143254435',
    'coupon_code' => 'sxxe34343434',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->marketing->busifavor->coupons->send->post([
  'json' => [
    'openid' => 'xsd3434454567676',
    'appid' => 'wx1234567889999',
    'stock_id' => '100088',
    'out_request_no' => '1002600620019090123143254435',
    'coupon_code' => 'sxxe34343434',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/marketing/busifavor/coupons/send')->post([
  'json' => [
    'openid' => 'xsd3434454567676',
    'appid' => 'wx1234567889999',
    'stock_id' => '100088',
    'out_request_no' => '1002600620019090123143254435',
    'coupon_code' => 'sxxe34343434',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/marketing/busifavor/coupons/send']->post([
  'json' => [
    'openid' => 'xsd3434454567676',
    'appid' => 'wx1234567889999',
    'stock_id' => '100088',
    'out_request_no' => '1002600620019090123143254435',
    'coupon_code' => 'sxxe34343434',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
stock_idstring批次号
coupon_codestring券code
out_request_nostring发券凭证

参阅 官方文档

Published on the GitHub by TheNorthMemory