Skip to content

导入加密手机号提醒会员领卡

如商户有存量注册会员未领取会员卡,可导入最近一年在品牌内有微信支付交易的活跃会员手机号(需加密后才能导入),导入后微信将通过卡包提醒用户将会员卡领取到卡包。

请求参数类型描述
jsonobject声明请求的JSON数据结构
member_informationobject会员信息
card_idstring会员卡id
codestring会员卡code
membership_numberstring会员卡编号
registration_timestring会员注册时间
encrypted_phone_numberstring加密手机号
outer_strstring自定义场景值
headersobject声明请求的头参数
Wechatpay-Serialstring平台公钥ID/平台公钥证书序列号
php
$instance->v3->marketing->membercardOpen->phonenumberMember->import->postAsync([
  'json' => [
    'member_information'     => [
      'card_id'           => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
      'code'              => '478515832665',
      'membership_number' => '316510891298',
      'registration_time' => '2015-05-20T13:29:35.120+08:00',
    ],
    'encrypted_phone_number' => 'vvysDQeEaH3I+wRh14St0abIkvQyFgh/fbWYSs2bLtG9tj+bdJn4WSCPzqSyXnFbzaaKSE2j4mAFON3kzNexb/SYkHZNJAuCittaW4wpGj7U+h9A==',
    'outer_str'              => 'my_card_CARD',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance->chain('v3/marketing/membercard-open/phonenumber-member/import')->postAsync([
  'json' => [
    'member_information'     => [
      'card_id'           => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
      'code'              => '478515832665',
      'membership_number' => '316510891298',
      'registration_time' => '2015-05-20T13:29:35.120+08:00',
    ],
    'encrypted_phone_number' => 'vvysDQeEaH3I+wRh14St0abIkvQyFgh/fbWYSs2bLtG9tj+bdJn4WSCPzqSyXnFbzaaKSE2j4mAFON3kzNexb/SYkHZNJAuCittaW4wpGj7U+h9A==',
    'outer_str'              => 'my_card_CARD',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance['v3/marketing/membercard-open/phonenumber-member/import']->postAsync([
  'json' => [
    'member_information'     => [
      'card_id'           => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
      'code'              => '478515832665',
      'membership_number' => '316510891298',
      'registration_time' => '2015-05-20T13:29:35.120+08:00',
    ],
    'encrypted_phone_number' => 'vvysDQeEaH3I+wRh14St0abIkvQyFgh/fbWYSs2bLtG9tj+bdJn4WSCPzqSyXnFbzaaKSE2j4mAFON3kzNexb/SYkHZNJAuCittaW4wpGj7U+h9A==',
    'outer_str'              => 'my_card_CARD',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$response = $instance->v3->marketing->membercardOpen->phonenumberMember->import->post([
  'json' => [
    'member_information'     => [
      'card_id'           => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
      'code'              => '478515832665',
      'membership_number' => '316510891298',
      'registration_time' => '2015-05-20T13:29:35.120+08:00',
    ],
    'encrypted_phone_number' => 'vvysDQeEaH3I+wRh14St0abIkvQyFgh/fbWYSs2bLtG9tj+bdJn4WSCPzqSyXnFbzaaKSE2j4mAFON3kzNexb/SYkHZNJAuCittaW4wpGj7U+h9A==',
    'outer_str'              => 'my_card_CARD',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance->chain('v3/marketing/membercard-open/phonenumber-member/import')->post([
  'json' => [
    'member_information'     => [
      'card_id'           => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
      'code'              => '478515832665',
      'membership_number' => '316510891298',
      'registration_time' => '2015-05-20T13:29:35.120+08:00',
    ],
    'encrypted_phone_number' => 'vvysDQeEaH3I+wRh14St0abIkvQyFgh/fbWYSs2bLtG9tj+bdJn4WSCPzqSyXnFbzaaKSE2j4mAFON3kzNexb/SYkHZNJAuCittaW4wpGj7U+h9A==',
    'outer_str'              => 'my_card_CARD',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance['v3/marketing/membercard-open/phonenumber-member/import']->post([
  'json' => [
    'member_information'     => [
      'card_id'           => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
      'code'              => '478515832665',
      'membership_number' => '316510891298',
      'registration_time' => '2015-05-20T13:29:35.120+08:00',
    ],
    'encrypted_phone_number' => 'vvysDQeEaH3I+wRh14St0abIkvQyFgh/fbWYSs2bLtG9tj+bdJn4WSCPzqSyXnFbzaaKSE2j4mAFON3kzNexb/SYkHZNJAuCittaW4wpGj7U+h9A==',
    'outer_str'              => 'my_card_CARD',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r($response->getStatusCode() === 204);
返回字典类型描述
空字符串(无返回内容)

参阅 官方文档

Published on the GitHub by TheNorthMemory