Skip to content

创建会员卡模板

通过此接口可以创建一张会员卡模板,创建成功将获得会员卡模板card_id

请求参数类型描述
jsonobject声明请求的JSON数据结构
appidstring商户AppId
logo_urlstring会员卡logo
brandobject品牌信息
brand_idstring品牌id
display_namestring品牌展示名称
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
php
$instance->v3->marketing->membercardOpen->cards->postAsync([
  'json' => [
    'appid' => 'wxea9c30890f48d5ae',
    'logo_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'brand' => [
      'brand_id' => '1004',
      'display_name' => '微信支付',
    ],
    'title' => '微信支付测试卡',
    'background_picture_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'description' => '使用本会员卡表示你同意xxx公司的协议,最终解释权归xxx公司所有',
    'service_phone' => '010-8877xxxx',
    'code_type' => 'BAR_CODE',
    'total_quantity' => 5000000,
    'date_information' => [
      'type' => 'FIX_TIME_RANGE',
      'available_begin_time' => '2020-05-20T13:29:35.120+08:00',
      'available_end_time' => '2030-05-20T13:29:35.120+08:00',
      'available_day_after_receive' => 200,
    ],
    'code_mode' => 'SYSTEM_ALLOCATE',
    'need_display_level' => true,
    'init_level' => '白银会员',
    'out_request_no' => '100002322019090134234sfdf',
    'balance_information' => [
      'need_balance' => true,
      'balance_appid' => 'wxea9c30890f48d5ae',
      'balance_path' => 'pages/balance/balance',
      'balance_url' => 'https://xxx.com',
    ],
    'user_information_form' => [
      'common_field_list' => ['string'],
      '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(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/marketing/membercard-open/cards')->postAsync([
  'json' => [
    'appid' => 'wxea9c30890f48d5ae',
    'logo_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'brand' => [
      'brand_id' => '1004',
      'display_name' => '微信支付',
    ],
    'title' => '微信支付测试卡',
    'background_picture_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'description' => '使用本会员卡表示你同意xxx公司的协议,最终解释权归xxx公司所有',
    'service_phone' => '010-8877xxxx',
    'code_type' => 'BAR_CODE',
    'total_quantity' => 5000000,
    'date_information' => [
      'type' => 'FIX_TIME_RANGE',
      'available_begin_time' => '2020-05-20T13:29:35.120+08:00',
      'available_end_time' => '2030-05-20T13:29:35.120+08:00',
      'available_day_after_receive' => 200,
    ],
    'code_mode' => 'SYSTEM_ALLOCATE',
    'need_display_level' => true,
    'init_level' => '白银会员',
    'out_request_no' => '100002322019090134234sfdf',
    'balance_information' => [
      'need_balance' => true,
      'balance_appid' => 'wxea9c30890f48d5ae',
      'balance_path' => 'pages/balance/balance',
      'balance_url' => 'https://xxx.com',
    ],
    'user_information_form' => [
      'common_field_list' => ['string'],
      '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(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/marketing/membercard-open/cards']->postAsync([
  'json' => [
    'appid' => 'wxea9c30890f48d5ae',
    'logo_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'brand' => [
      'brand_id' => '1004',
      'display_name' => '微信支付',
    ],
    'title' => '微信支付测试卡',
    'background_picture_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'description' => '使用本会员卡表示你同意xxx公司的协议,最终解释权归xxx公司所有',
    'service_phone' => '010-8877xxxx',
    'code_type' => 'BAR_CODE',
    'total_quantity' => 5000000,
    'date_information' => [
      'type' => 'FIX_TIME_RANGE',
      'available_begin_time' => '2020-05-20T13:29:35.120+08:00',
      'available_end_time' => '2030-05-20T13:29:35.120+08:00',
      'available_day_after_receive' => 200,
    ],
    'code_mode' => 'SYSTEM_ALLOCATE',
    'need_display_level' => true,
    'init_level' => '白银会员',
    'out_request_no' => '100002322019090134234sfdf',
    'balance_information' => [
      'need_balance' => true,
      'balance_appid' => 'wxea9c30890f48d5ae',
      'balance_path' => 'pages/balance/balance',
      'balance_url' => 'https://xxx.com',
    ],
    'user_information_form' => [
      'common_field_list' => ['string'],
      '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(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->marketing->membercardOpen->cards->post([
  'json' => [
    'appid' => 'wxea9c30890f48d5ae',
    'logo_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'brand' => [
      'brand_id' => '1004',
      'display_name' => '微信支付',
    ],
    'title' => '微信支付测试卡',
    'background_picture_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'description' => '使用本会员卡表示你同意xxx公司的协议,最终解释权归xxx公司所有',
    'service_phone' => '010-8877xxxx',
    'code_type' => 'BAR_CODE',
    'total_quantity' => 5000000,
    'date_information' => [
      'type' => 'FIX_TIME_RANGE',
      'available_begin_time' => '2020-05-20T13:29:35.120+08:00',
      'available_end_time' => '2030-05-20T13:29:35.120+08:00',
      'available_day_after_receive' => 200,
    ],
    'code_mode' => 'SYSTEM_ALLOCATE',
    'need_display_level' => true,
    'init_level' => '白银会员',
    'out_request_no' => '100002322019090134234sfdf',
    'balance_information' => [
      'need_balance' => true,
      'balance_appid' => 'wxea9c30890f48d5ae',
      'balance_path' => 'pages/balance/balance',
      'balance_url' => 'https://xxx.com',
    ],
    'user_information_form' => [
      'common_field_list' => ['string'],
      '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(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/marketing/membercard-open/cards')->post([
  'json' => [
    'appid' => 'wxea9c30890f48d5ae',
    'logo_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'brand' => [
      'brand_id' => '1004',
      'display_name' => '微信支付',
    ],
    'title' => '微信支付测试卡',
    'background_picture_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'description' => '使用本会员卡表示你同意xxx公司的协议,最终解释权归xxx公司所有',
    'service_phone' => '010-8877xxxx',
    'code_type' => 'BAR_CODE',
    'total_quantity' => 5000000,
    'date_information' => [
      'type' => 'FIX_TIME_RANGE',
      'available_begin_time' => '2020-05-20T13:29:35.120+08:00',
      'available_end_time' => '2030-05-20T13:29:35.120+08:00',
      'available_day_after_receive' => 200,
    ],
    'code_mode' => 'SYSTEM_ALLOCATE',
    'need_display_level' => true,
    'init_level' => '白银会员',
    'out_request_no' => '100002322019090134234sfdf',
    'balance_information' => [
      'need_balance' => true,
      'balance_appid' => 'wxea9c30890f48d5ae',
      'balance_path' => 'pages/balance/balance',
      'balance_url' => 'https://xxx.com',
    ],
    'user_information_form' => [
      'common_field_list' => ['string'],
      '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(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/marketing/membercard-open/cards']->post([
  'json' => [
    'appid' => 'wxea9c30890f48d5ae',
    'logo_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'brand' => [
      'brand_id' => '1004',
      'display_name' => '微信支付',
    ],
    'title' => '微信支付测试卡',
    'background_picture_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
    'description' => '使用本会员卡表示你同意xxx公司的协议,最终解释权归xxx公司所有',
    'service_phone' => '010-8877xxxx',
    'code_type' => 'BAR_CODE',
    'total_quantity' => 5000000,
    'date_information' => [
      'type' => 'FIX_TIME_RANGE',
      'available_begin_time' => '2020-05-20T13:29:35.120+08:00',
      'available_end_time' => '2030-05-20T13:29:35.120+08:00',
      'available_day_after_receive' => 200,
    ],
    'code_mode' => 'SYSTEM_ALLOCATE',
    'need_display_level' => true,
    'init_level' => '白银会员',
    'out_request_no' => '100002322019090134234sfdf',
    'balance_information' => [
      'need_balance' => true,
      'balance_appid' => 'wxea9c30890f48d5ae',
      'balance_path' => 'pages/balance/balance',
      'balance_url' => 'https://xxx.com',
    ],
    'user_information_form' => [
      'common_field_list' => ['string'],
      '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(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

参阅 官方文档

查询会员卡模板列表

通过此接口可查询指定某品牌的所有会员卡模板列表

请求参数类型描述
queryobject声明请求的查询参数
brand_idstring品牌id
appidstring商户AppId
offsetinteger分页页码
limitinteger分页大小
php
$instance->v3->marketing->membercardOpen->cards->getAsync([
  'query' => [
    'brand_id' => '',
    'appid' => '',
    'offset' => 0,
    'limit' => 0,
  ],
])
->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')->getAsync([
  'query' => [
    'brand_id' => '',
    'appid' => '',
    'offset' => 0,
    'limit' => 0,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/marketing/membercard-open/cards']->getAsync([
  'query' => [
    'brand_id' => '',
    'appid' => '',
    'offset' => 0,
    'limit' => 0,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->marketing->membercardOpen->cards->get([
  'query' => [
    'brand_id' => '',
    'appid' => '',
    'offset' => 0,
    'limit' => 0,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/marketing/membercard-open/cards')->get([
  'query' => [
    'brand_id' => '',
    'appid' => '',
    'offset' => 0,
    'limit' => 0,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/marketing/membercard-open/cards']->get([
  'query' => [
    'brand_id' => '',
    'appid' => '',
    'offset' => 0,
    'limit' => 0,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
total_countinteger总数量
limitinteger分页大小
offsetinteger分页页码

参阅 官方文档

Published on the GitHub by TheNorthMemory