Skip to content

查询、修改及删除会员卡模板信息

查询会员卡模板信息

通过此接口可查询指定会员卡模板的所有信息

请求参数类型描述
card_idstring会员卡id
php
$instance->v3->marketing->membercardOpen->cards->_card_id_->getAsync([
  '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/membercard-open/cards/{card_id}')->getAsync([
  '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/membercard-open/cards/{card_id}']->getAsync([
  '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->membercardOpen->cards->_card_id_->get([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/marketing/membercard-open/cards/{card_id}')->get([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/marketing/membercard-open/cards/{card_id}']->get([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
card_idstring会员卡id
create_timestring创建时间
update_timestring更新时间
remain_quantityinteger剩余库存
statusstring会员卡状态
NOT_APPROVE | APPROVE_FAIL | APPROVED | DELETED 枚举值之一
brandobject品牌信息
brand_idstring品牌id
display_namestring品牌展示名称
appidstring商户AppId
logo_urlstring会员卡logo
titlestring卡名称
background_picture_urlstring会员卡背景图
descriptionstring使用须知
service_phonestring服务电话
code_typestring会员码型
BAR_CODE | QRCODE | BAR_CODE_AND_QRCODE | NONE_CODE 枚举值之一
total_quantityinteger会员卡总库存
date_informationobject有效期
typestring有效期类型
FIX_TIME_RANGE | FIX_TERM | PERMANENT 枚举值之一
available_begin_timestring有效期开始时间
available_end_timestring有效期结束时间
available_day_after_receiveinteger生效后N天内有效
code_modestring会员卡code分配类型
SYSTEM_ALLOCATE | MERCHANT_DEPOSIT | REAL_TIME 枚举值之一
need_display_levelboolean是否展示会员等级
init_levelstring会员初始等级
out_request_nostring商户请求单号
balance_informationobject储值信息
need_balanceboolean是否支持储值
balance_appidstring储值小程序appid
balance_pathstring储值小程序path
balance_urlstring储值url
user_information_formobject开卡信息
common_field_liststring[]平台提供的通用开卡信息字段
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 枚举值之一
custom_field_listobject[]商户自定义的开卡信息字段
typestring商户自定义的开卡信息字段类型
TEXT | SELECT | RADIO | CHECK_BOX 枚举值之一
namestring字段名称
valuesstring[]字段值
additional_statementobject商户补充声明
titlestring标题
urlstring跳转url
appidstring跳转小程序appid
pathstring跳转小程序path

参阅 官方文档

修改会员卡模板信息

通过此接口可更新会员卡的信息,包括基本信息、储值信息、开卡信息、补充说明

请求参数类型描述
card_idstring会员卡id
jsonobject声明请求的JSON数据结构
appidstring商户AppId
logo_urlstring会员卡logo
titlestring卡名称
background_picture_urlstring会员卡背景图
descriptionstring使用须知
service_phonestring服务电话
total_quantityinteger会员卡总库存
date_informationobject有效期
typestring有效期类型
FIX_TIME_RANGE | FIX_TERM | PERMANENT 枚举值之一
available_end_timestring有效期结束时间
available_day_after_receiveinteger生效后N天内有效
wait_days_after_receiveinteger领取后N天开始生效
need_display_levelboolean是否展示会员等级
init_levelstring会员初始等级
balance_informationobject储值信息
need_balanceboolean是否支持储值
balance_appidstring储值小程序appid
balance_pathstring储值小程序path
balance_urlstring储值url
user_information_formobject开卡信息
can_modify_after_activateboolean是否允许修改
common_field_liststring[]平台提供的通用开卡信息字段
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 枚举值之一
custom_field_listobject[]商户自定义的开卡信息字段
typestring商户自定义的开卡信息字段类型
TEXT | SELECT | RADIO | CHECK_BOX 枚举值之一
namestring字段名称
valuesstring[]字段值
additional_statementobject商户补充声明
titlestring标题
urlstring跳转url
appidstring跳转小程序appid
pathstring跳转小程序path
php
$instance->v3->marketing->membercardOpen->cards->_card_id_->patchAsync([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'json' => [
    'appid'                  => 'wxea9c30890f48d5ae',
    'logo_url'               => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'title'                  => '微信支付测试卡',
    'background_picture_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'description'            => '使用本会员卡表示你同意xxx公司的协议,最终解释权归xxx公司所有',
    'service_phone'          => '010-8877xxxx',
    'total_quantity'         => 5000000,
    'date_information'       => [
      'type'                        => 'FIX_TIME_RANGE',
      'available_end_time'          => '2030-05-20T13:29:35.120+08:00',
      'available_day_after_receive' => 200,
      'wait_days_after_receive'     => 2,
    ],
    'need_display_level'     => true,
    'init_level'             => '白银会员',
    'balance_information'    => [
      'need_balance'  => true,
      'balance_appid' => 'wxea9c30890f48d5ae',
      'balance_path'  => 'pages/balance/balance',
      'balance_url'   => 'https://xxx.com',
    ],
    'user_information_form'  => [
      'can_modify_after_activate' => true,
      'common_field_list'         => ['USER_FORM_FLAG_MOBILE'],
      'custom_field_list'         => [[
        'type'   => 'TEXT',
        'name'   => '喜欢的运动',
        'values' => ['string'],
      ],],
    ],
    'additional_statement'   => [
      'title' => 'xxx会员卡使用须知',
      'url'   => 'https://xxx.111.com',
      'appid' => 'wxea9c30890f48d5ae',
      'path'  => 'pages/statement/statement',
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance->chain('v3/marketing/membercard-open/cards/{card_id}')->patchAsync([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'json' => [
    'appid'                  => 'wxea9c30890f48d5ae',
    'logo_url'               => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'title'                  => '微信支付测试卡',
    'background_picture_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'description'            => '使用本会员卡表示你同意xxx公司的协议,最终解释权归xxx公司所有',
    'service_phone'          => '010-8877xxxx',
    'total_quantity'         => 5000000,
    'date_information'       => [
      'type'                        => 'FIX_TIME_RANGE',
      'available_end_time'          => '2030-05-20T13:29:35.120+08:00',
      'available_day_after_receive' => 200,
      'wait_days_after_receive'     => 2,
    ],
    'need_display_level'     => true,
    'init_level'             => '白银会员',
    'balance_information'    => [
      'need_balance'  => true,
      'balance_appid' => 'wxea9c30890f48d5ae',
      'balance_path'  => 'pages/balance/balance',
      'balance_url'   => 'https://xxx.com',
    ],
    'user_information_form'  => [
      'can_modify_after_activate' => true,
      'common_field_list'         => ['USER_FORM_FLAG_MOBILE'],
      'custom_field_list'         => [[
        'type'   => 'TEXT',
        'name'   => '喜欢的运动',
        'values' => ['string'],
      ],],
    ],
    'additional_statement'   => [
      'title' => 'xxx会员卡使用须知',
      'url'   => 'https://xxx.111.com',
      'appid' => 'wxea9c30890f48d5ae',
      'path'  => 'pages/statement/statement',
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance['v3/marketing/membercard-open/cards/{card_id}']->patchAsync([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'json' => [
    'appid'                  => 'wxea9c30890f48d5ae',
    'logo_url'               => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'title'                  => '微信支付测试卡',
    'background_picture_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'description'            => '使用本会员卡表示你同意xxx公司的协议,最终解释权归xxx公司所有',
    'service_phone'          => '010-8877xxxx',
    'total_quantity'         => 5000000,
    'date_information'       => [
      'type'                        => 'FIX_TIME_RANGE',
      'available_end_time'          => '2030-05-20T13:29:35.120+08:00',
      'available_day_after_receive' => 200,
      'wait_days_after_receive'     => 2,
    ],
    'need_display_level'     => true,
    'init_level'             => '白银会员',
    'balance_information'    => [
      'need_balance'  => true,
      'balance_appid' => 'wxea9c30890f48d5ae',
      'balance_path'  => 'pages/balance/balance',
      'balance_url'   => 'https://xxx.com',
    ],
    'user_information_form'  => [
      'can_modify_after_activate' => true,
      'common_field_list'         => ['USER_FORM_FLAG_MOBILE'],
      'custom_field_list'         => [[
        'type'   => 'TEXT',
        'name'   => '喜欢的运动',
        'values' => ['string'],
      ],],
    ],
    'additional_statement'   => [
      'title' => 'xxx会员卡使用须知',
      'url'   => 'https://xxx.111.com',
      'appid' => 'wxea9c30890f48d5ae',
      'path'  => 'pages/statement/statement',
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$response = $instance->v3->marketing->membercardOpen->cards->_card_id_->patch([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'json' => [
    'appid'                  => 'wxea9c30890f48d5ae',
    'logo_url'               => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'title'                  => '微信支付测试卡',
    'background_picture_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'description'            => '使用本会员卡表示你同意xxx公司的协议,最终解释权归xxx公司所有',
    'service_phone'          => '010-8877xxxx',
    'total_quantity'         => 5000000,
    'date_information'       => [
      'type'                        => 'FIX_TIME_RANGE',
      'available_end_time'          => '2030-05-20T13:29:35.120+08:00',
      'available_day_after_receive' => 200,
      'wait_days_after_receive'     => 2,
    ],
    'need_display_level'     => true,
    'init_level'             => '白银会员',
    'balance_information'    => [
      'need_balance'  => true,
      'balance_appid' => 'wxea9c30890f48d5ae',
      'balance_path'  => 'pages/balance/balance',
      'balance_url'   => 'https://xxx.com',
    ],
    'user_information_form'  => [
      'can_modify_after_activate' => true,
      'common_field_list'         => ['USER_FORM_FLAG_MOBILE'],
      'custom_field_list'         => [[
        'type'   => 'TEXT',
        'name'   => '喜欢的运动',
        'values' => ['string'],
      ],],
    ],
    'additional_statement'   => [
      'title' => 'xxx会员卡使用须知',
      'url'   => 'https://xxx.111.com',
      'appid' => 'wxea9c30890f48d5ae',
      'path'  => 'pages/statement/statement',
    ],
  ],
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance->chain('v3/marketing/membercard-open/cards/{card_id}')->patch([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'json' => [
    'appid'                  => 'wxea9c30890f48d5ae',
    'logo_url'               => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'title'                  => '微信支付测试卡',
    'background_picture_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'description'            => '使用本会员卡表示你同意xxx公司的协议,最终解释权归xxx公司所有',
    'service_phone'          => '010-8877xxxx',
    'total_quantity'         => 5000000,
    'date_information'       => [
      'type'                        => 'FIX_TIME_RANGE',
      'available_end_time'          => '2030-05-20T13:29:35.120+08:00',
      'available_day_after_receive' => 200,
      'wait_days_after_receive'     => 2,
    ],
    'need_display_level'     => true,
    'init_level'             => '白银会员',
    'balance_information'    => [
      'need_balance'  => true,
      'balance_appid' => 'wxea9c30890f48d5ae',
      'balance_path'  => 'pages/balance/balance',
      'balance_url'   => 'https://xxx.com',
    ],
    'user_information_form'  => [
      'can_modify_after_activate' => true,
      'common_field_list'         => ['USER_FORM_FLAG_MOBILE'],
      'custom_field_list'         => [[
        'type'   => 'TEXT',
        'name'   => '喜欢的运动',
        'values' => ['string'],
      ],],
    ],
    'additional_statement'   => [
      'title' => 'xxx会员卡使用须知',
      'url'   => 'https://xxx.111.com',
      'appid' => 'wxea9c30890f48d5ae',
      'path'  => 'pages/statement/statement',
    ],
  ],
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance['v3/marketing/membercard-open/cards/{card_id}']->patch([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'json' => [
    'appid'                  => 'wxea9c30890f48d5ae',
    'logo_url'               => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'title'                  => '微信支付测试卡',
    'background_picture_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'description'            => '使用本会员卡表示你同意xxx公司的协议,最终解释权归xxx公司所有',
    'service_phone'          => '010-8877xxxx',
    'total_quantity'         => 5000000,
    'date_information'       => [
      'type'                        => 'FIX_TIME_RANGE',
      'available_end_time'          => '2030-05-20T13:29:35.120+08:00',
      'available_day_after_receive' => 200,
      'wait_days_after_receive'     => 2,
    ],
    'need_display_level'     => true,
    'init_level'             => '白银会员',
    'balance_information'    => [
      'need_balance'  => true,
      'balance_appid' => 'wxea9c30890f48d5ae',
      'balance_path'  => 'pages/balance/balance',
      'balance_url'   => 'https://xxx.com',
    ],
    'user_information_form'  => [
      'can_modify_after_activate' => true,
      'common_field_list'         => ['USER_FORM_FLAG_MOBILE'],
      'custom_field_list'         => [[
        'type'   => 'TEXT',
        'name'   => '喜欢的运动',
        'values' => ['string'],
      ],],
    ],
    'additional_statement'   => [
      'title' => 'xxx会员卡使用须知',
      'url'   => 'https://xxx.111.com',
      'appid' => 'wxea9c30890f48d5ae',
      'path'  => 'pages/statement/statement',
    ],
  ],
]);
print_r($response->getStatusCode() === 204);
返回字典类型描述
空字符串(无返回内容)

参阅 官方文档

删除会员卡模板

商户可调用此api删除会员卡。删除后,商家将无法通过任何渠道再投放该会员卡。

请求参数类型描述
card_idstring会员卡id
php
$instance->v3->marketing->membercardOpen->cards->_card_id_->deleteAsync([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance->chain('v3/marketing/membercard-open/cards/{card_id}')->deleteAsync([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance['v3/marketing/membercard-open/cards/{card_id}']->deleteAsync([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$response = $instance->v3->marketing->membercardOpen->cards->_card_id_->delete([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance->chain('v3/marketing/membercard-open/cards/{card_id}')->delete([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance['v3/marketing/membercard-open/cards/{card_id}']->delete([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
]);
print_r($response->getStatusCode() === 204);
返回字典类型描述
空字符串(无返回内容)

参阅 官方文档

Published on the GitHub by TheNorthMemory