Skip to content

根据过滤条件查询用户券

服务商自定义筛选条件(如创建商户号、归属商户号、发放商户号等),查询指定微信用户卡包中满足对应条件的所有商家券信息。

请求参数类型描述
openidstring用户标识
queryobject声明请求的查询参数
appidstring公众账号ID
stock_idstring批次号
coupon_statestring券状态
SENDED | USED | EXPIRED 枚举值之一
creator_merchantstring创建批次的商户号
belong_merchantstring批次归属商户号
sender_merchantstring批次发放商户号
offsetnumber分页页码
limitnumber分页大小
php
$instance->v3->marketing->busifavor->users->_openid_->coupons->getAsync([
  'openid' => '2323dfsdf342342',
  'query' => [
    'appid'            => 'wx233544546545989',
    'stock_id'         => '9865000',
    'coupon_state'     => 'SENDED',
    'creator_merchant' => '1000000001',
    'belong_merchant'  => '1000000002',
    'sender_merchant'  => '1000000003',
    'offset'           => 0,
    'limit'            => 20,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/marketing/busifavor/users/{openid}/coupons')->getAsync([
  'openid' => '2323dfsdf342342',
  'query' => [
    'appid'            => 'wx233544546545989',
    'stock_id'         => '9865000',
    'coupon_state'     => 'SENDED',
    'creator_merchant' => '1000000001',
    'belong_merchant'  => '1000000002',
    'sender_merchant'  => '1000000003',
    'offset'           => 0,
    'limit'            => 20,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/marketing/busifavor/users/{openid}/coupons']->getAsync([
  'openid' => '2323dfsdf342342',
  'query' => [
    'appid'            => 'wx233544546545989',
    'stock_id'         => '9865000',
    'coupon_state'     => 'SENDED',
    'creator_merchant' => '1000000001',
    'belong_merchant'  => '1000000002',
    'sender_merchant'  => '1000000003',
    'offset'           => 0,
    'limit'            => 20,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->marketing->busifavor->users->_openid_->coupons->get([
  'openid' => '2323dfsdf342342',
  'query' => [
    'appid'            => 'wx233544546545989',
    'stock_id'         => '9865000',
    'coupon_state'     => 'SENDED',
    'creator_merchant' => '1000000001',
    'belong_merchant'  => '1000000002',
    'sender_merchant'  => '1000000003',
    'offset'           => 0,
    'limit'            => 20,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/marketing/busifavor/users/{openid}/coupons')->get([
  'openid' => '2323dfsdf342342',
  'query' => [
    'appid'            => 'wx233544546545989',
    'stock_id'         => '9865000',
    'coupon_state'     => 'SENDED',
    'creator_merchant' => '1000000001',
    'belong_merchant'  => '1000000002',
    'sender_merchant'  => '1000000003',
    'offset'           => 0,
    'limit'            => 20,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/marketing/busifavor/users/{openid}/coupons']->get([
  'openid' => '2323dfsdf342342',
  'query' => [
    'appid'            => 'wx233544546545989',
    'stock_id'         => '9865000',
    'coupon_state'     => 'SENDED',
    'creator_merchant' => '1000000001',
    'belong_merchant'  => '1000000002',
    'sender_merchant'  => '1000000003',
    'offset'           => 0,
    'limit'            => 20,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
total_countnumber总数量
offsetnumber分页页码
limitnumber分页大小

参阅 官方文档

Published on the GitHub by TheNorthMemory