Skip to content

设置会员卡模板权益项

通过此接口商家可设置是否在用户的会员卡详情页展示积分、优惠、发票等权益及服务模块

请求参数类型描述
card_idstring会员卡id
jsonobject声明请求的JSON数据结构
show_bonusboolean是否展示会员积分
show_favorboolean是否展示会员优惠
bonusobject会员积分
init_bonusinteger会员初始积分值
bonus_value_wordstring积分值文案
bonus_cost_titlestring积分价值项标题
bonus_cost_wordstring积分价值项文案
bonus_jump_wordstring积分跳转文案
bonus_jump_appidstring积分跳转appid
bonus_jump_pathstring积分跳转path
bonus_support_appidstring自助积分跳转appid
bonus_support_pathstring自助积分跳转path
favorobject会员优惠
show_couponboolean是否展示优惠券
member_price_wordstring会员专享价文案
member_price_appidstring会员专享价跳转appid
member_price_pathstring会员专享价跳转path
php
$instance->v3->marketing->membercardOpen->cards->_card_id_->rights->patchAsync([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'json' => [
    'show_bonus' => true,
    'show_favor' => true,
    'bonus'      => [
      'init_bonus'          => 100,
      'bonus_value_word'    => '我的积分',
      'bonus_cost_title'    => '积分兑换',
      'bonus_cost_word'     => '500积分=2小时免费停车券',
      'bonus_jump_word'     => '更多礼品',
      'bonus_jump_appid'    => 'wxea9c30a90fs8d3fe',
      'bonus_jump_path'     => '/pages/bonus/bonus',
      'bonus_support_appid' => 'wxea9c30a90fs8d3fe',
      'bonus_support_path'  => 'pages/selfbonus/selfbonus',
    ],
    'favor'      => [
      'show_coupon'        => true,
      'member_price_word'  => '周二会员全场八折',
      'member_price_appid' => 'wxea9c30a90fs8d3fe',
      'member_price_path'  => 'pages/favor/favor',
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance->chain('v3/marketing/membercard-open/cards/{card_id}/rights')->patchAsync([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'json' => [
    'show_bonus' => true,
    'show_favor' => true,
    'bonus'      => [
      'init_bonus'          => 100,
      'bonus_value_word'    => '我的积分',
      'bonus_cost_title'    => '积分兑换',
      'bonus_cost_word'     => '500积分=2小时免费停车券',
      'bonus_jump_word'     => '更多礼品',
      'bonus_jump_appid'    => 'wxea9c30a90fs8d3fe',
      'bonus_jump_path'     => '/pages/bonus/bonus',
      'bonus_support_appid' => 'wxea9c30a90fs8d3fe',
      'bonus_support_path'  => 'pages/selfbonus/selfbonus',
    ],
    'favor'      => [
      'show_coupon'        => true,
      'member_price_word'  => '周二会员全场八折',
      'member_price_appid' => 'wxea9c30a90fs8d3fe',
      'member_price_path'  => 'pages/favor/favor',
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance['v3/marketing/membercard-open/cards/{card_id}/rights']->patchAsync([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'json' => [
    'show_bonus' => true,
    'show_favor' => true,
    'bonus'      => [
      'init_bonus'          => 100,
      'bonus_value_word'    => '我的积分',
      'bonus_cost_title'    => '积分兑换',
      'bonus_cost_word'     => '500积分=2小时免费停车券',
      'bonus_jump_word'     => '更多礼品',
      'bonus_jump_appid'    => 'wxea9c30a90fs8d3fe',
      'bonus_jump_path'     => '/pages/bonus/bonus',
      'bonus_support_appid' => 'wxea9c30a90fs8d3fe',
      'bonus_support_path'  => 'pages/selfbonus/selfbonus',
    ],
    'favor'      => [
      'show_coupon'        => true,
      'member_price_word'  => '周二会员全场八折',
      'member_price_appid' => 'wxea9c30a90fs8d3fe',
      'member_price_path'  => 'pages/favor/favor',
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$response = $instance->v3->marketing->membercardOpen->cards->_card_id_->rights->patch([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'json' => [
    'show_bonus' => true,
    'show_favor' => true,
    'bonus'      => [
      'init_bonus'          => 100,
      'bonus_value_word'    => '我的积分',
      'bonus_cost_title'    => '积分兑换',
      'bonus_cost_word'     => '500积分=2小时免费停车券',
      'bonus_jump_word'     => '更多礼品',
      'bonus_jump_appid'    => 'wxea9c30a90fs8d3fe',
      'bonus_jump_path'     => '/pages/bonus/bonus',
      'bonus_support_appid' => 'wxea9c30a90fs8d3fe',
      'bonus_support_path'  => 'pages/selfbonus/selfbonus',
    ],
    'favor'      => [
      'show_coupon'        => true,
      'member_price_word'  => '周二会员全场八折',
      'member_price_appid' => 'wxea9c30a90fs8d3fe',
      'member_price_path'  => 'pages/favor/favor',
    ],
  ],
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance->chain('v3/marketing/membercard-open/cards/{card_id}/rights')->patch([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'json' => [
    'show_bonus' => true,
    'show_favor' => true,
    'bonus'      => [
      'init_bonus'          => 100,
      'bonus_value_word'    => '我的积分',
      'bonus_cost_title'    => '积分兑换',
      'bonus_cost_word'     => '500积分=2小时免费停车券',
      'bonus_jump_word'     => '更多礼品',
      'bonus_jump_appid'    => 'wxea9c30a90fs8d3fe',
      'bonus_jump_path'     => '/pages/bonus/bonus',
      'bonus_support_appid' => 'wxea9c30a90fs8d3fe',
      'bonus_support_path'  => 'pages/selfbonus/selfbonus',
    ],
    'favor'      => [
      'show_coupon'        => true,
      'member_price_word'  => '周二会员全场八折',
      'member_price_appid' => 'wxea9c30a90fs8d3fe',
      'member_price_path'  => 'pages/favor/favor',
    ],
  ],
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance['v3/marketing/membercard-open/cards/{card_id}/rights']->patch([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'json' => [
    'show_bonus' => true,
    'show_favor' => true,
    'bonus'      => [
      'init_bonus'          => 100,
      'bonus_value_word'    => '我的积分',
      'bonus_cost_title'    => '积分兑换',
      'bonus_cost_word'     => '500积分=2小时免费停车券',
      'bonus_jump_word'     => '更多礼品',
      'bonus_jump_appid'    => 'wxea9c30a90fs8d3fe',
      'bonus_jump_path'     => '/pages/bonus/bonus',
      'bonus_support_appid' => 'wxea9c30a90fs8d3fe',
      'bonus_support_path'  => 'pages/selfbonus/selfbonus',
    ],
    'favor'      => [
      'show_coupon'        => true,
      'member_price_word'  => '周二会员全场八折',
      'member_price_appid' => 'wxea9c30a90fs8d3fe',
      'member_price_path'  => 'pages/favor/favor',
    ],
  ],
]);
print_r($response->getStatusCode() === 204);
返回字典类型描述
空字符串(无返回内容)

参阅 官方文档

Published on the GitHub by TheNorthMemory