Skip to content

查询用户会员卡信息

通过此接口可查询指定用户会员卡的信息,如会员积分、储值余额、开卡信息等

请求参数类型描述
card_idstring会员卡id
codestring会员卡code
php
$instance->v3->marketing->membercardOpen->cards->_card_id_->codes->_code_->getAsync([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'code' => '478515832665',
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/marketing/membercard-open/cards/{card_id}/codes/{code}')->getAsync([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'code' => '478515832665',
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/marketing/membercard-open/cards/{card_id}/codes/{code}']->getAsync([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'code' => '478515832665',
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->marketing->membercardOpen->cards->_card_id_->codes->_code_->get([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'code' => '478515832665',
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/marketing/membercard-open/cards/{card_id}/codes/{code}')->get([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'code' => '478515832665',
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/marketing/membercard-open/cards/{card_id}/codes/{code}']->get([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'code' => '478515832665',
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
card_idstring会员卡id
codestring会员卡code
openidstring用户标识
membership_numberstring会员卡编号
levelstring用户等级
nicknamestring微信昵称
head_image_urlstring微信头像url
background_picture_urlstring会员卡背景图
balanceinteger用户储值余额
user_card_statusstring用户会员卡状态
NOT_ACTIVATE | EFFECTIVE | EXPIRE | UNAVAILABLE | DELETE 枚举值之一
user_informationobject用户开卡时填写的个人信息
common_field_listobject[]平台提供的通用开卡信息字段
namestring平台提供的通用开卡信息字段
USER_FORM_FLAG_MOBILE | USER_FORM_FLAG_SEX | USER_FORM_FLAG_NAME | USER_FORM_FLAG_BIRTHDAY | USER_FORM_FLAG_ADDRESS | USER_FORM_FLAG_EMAIL | USER_FORM_FLAG_CITY 枚举值之一
valuestring用户开卡时填写的个人信息
custom_field_listobject[]商户自定义的开卡信息字段
namestring字段名称
valuestring字段值
value_liststring[]字段值列表
bonus_valueinteger用户当前积分

参阅 官方文档

修改用户会员卡信息

通过此接口可更新指定用户的会员卡背景图、会员卡号、等级、储值余额

请求参数类型描述
card_idstring会员卡id
codestring会员卡code
jsonobject声明请求的JSON数据结构
membership_numberstring会员卡编号
background_picture_urlstring会员卡背景图
levelstring用户等级
out_request_nostring商户请求单号
balance_informationobject用户储值变更信息
before_balanceinteger更新前用户储值余额
balanceinteger更新后用户储值余额
add_balanceinteger本次余额变动值
balance_remarkstring储值消耗记录
php
$instance->v3->marketing->membercardOpen->cards->_card_id_->codes->_code_->patchAsync([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'code' => '478515832665',
  'json' => [
    'membership_number'      => '316510891298',
    'background_picture_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'level'                  => '钻石会员',
    'out_request_no'         => '100002322019090134234sfdf',
    'balance_information'    => [
      'before_balance' => 888,
      'balance'        => 888,
      'add_balance'    => 100,
      'balance_remark' => '购买一杯珍珠奶茶,消耗30元',
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance->chain('v3/marketing/membercard-open/cards/{card_id}/codes/{code}')->patchAsync([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'code' => '478515832665',
  'json' => [
    'membership_number'      => '316510891298',
    'background_picture_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'level'                  => '钻石会员',
    'out_request_no'         => '100002322019090134234sfdf',
    'balance_information'    => [
      'before_balance' => 888,
      'balance'        => 888,
      'add_balance'    => 100,
      'balance_remark' => '购买一杯珍珠奶茶,消耗30元',
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance['v3/marketing/membercard-open/cards/{card_id}/codes/{code}']->patchAsync([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'code' => '478515832665',
  'json' => [
    'membership_number'      => '316510891298',
    'background_picture_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'level'                  => '钻石会员',
    'out_request_no'         => '100002322019090134234sfdf',
    'balance_information'    => [
      'before_balance' => 888,
      'balance'        => 888,
      'add_balance'    => 100,
      'balance_remark' => '购买一杯珍珠奶茶,消耗30元',
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$response = $instance->v3->marketing->membercardOpen->cards->_card_id_->codes->_code_->patch([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'code' => '478515832665',
  'json' => [
    'membership_number'      => '316510891298',
    'background_picture_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'level'                  => '钻石会员',
    'out_request_no'         => '100002322019090134234sfdf',
    'balance_information'    => [
      'before_balance' => 888,
      'balance'        => 888,
      'add_balance'    => 100,
      'balance_remark' => '购买一杯珍珠奶茶,消耗30元',
    ],
  ],
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance->chain('v3/marketing/membercard-open/cards/{card_id}/codes/{code}')->patch([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'code' => '478515832665',
  'json' => [
    'membership_number'      => '316510891298',
    'background_picture_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'level'                  => '钻石会员',
    'out_request_no'         => '100002322019090134234sfdf',
    'balance_information'    => [
      'before_balance' => 888,
      'balance'        => 888,
      'add_balance'    => 100,
      'balance_remark' => '购买一杯珍珠奶茶,消耗30元',
    ],
  ],
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance['v3/marketing/membercard-open/cards/{card_id}/codes/{code}']->patch([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'code' => '478515832665',
  'json' => [
    'membership_number'      => '316510891298',
    'background_picture_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'level'                  => '钻石会员',
    'out_request_no'         => '100002322019090134234sfdf',
    'balance_information'    => [
      'before_balance' => 888,
      'balance'        => 888,
      'add_balance'    => 100,
      'balance_remark' => '购买一杯珍珠奶茶,消耗30元',
    ],
  ],
]);
print_r($response->getStatusCode() === 204);
返回字典类型描述
空字符串(无返回内容)

参阅 官方文档

Published on the GitHub by TheNorthMemory