Skip to content

添加会员卡服务项

在会员卡模板上添加并展示某个会员服务项,指定添加服务项id后会在会员卡上展示对应的会员服务

请求参数类型描述
card_idstring会员卡id
jsonobject声明请求的JSON数据结构
service_module_idstring会员服务项ID
jump_miniprogramobject跳转小程序
appidstring小程序appid
pathstring小程序path
php
$instance->v3->marketing->membercardOpen->cards->_card_id_->serviceModules->postAsync([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'json' => [
    'service_module_id' => '666',
    'jump_miniprogram'  => [
      'appid' => 'wx37178d097a6851d8',
      'path'  => 'pages/index/index',
    ],
  ],
])
->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}/service-modules')->postAsync([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'json' => [
    'service_module_id' => '666',
    'jump_miniprogram'  => [
      'appid' => 'wx37178d097a6851d8',
      'path'  => 'pages/index/index',
    ],
  ],
])
->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}/service-modules']->postAsync([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'json' => [
    'service_module_id' => '666',
    'jump_miniprogram'  => [
      'appid' => 'wx37178d097a6851d8',
      'path'  => 'pages/index/index',
    ],
  ],
])
->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_->serviceModules->post([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'json' => [
    'service_module_id' => '666',
    'jump_miniprogram'  => [
      'appid' => 'wx37178d097a6851d8',
      'path'  => 'pages/index/index',
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/marketing/membercard-open/cards/{card_id}/service-modules')->post([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'json' => [
    'service_module_id' => '666',
    'jump_miniprogram'  => [
      'appid' => 'wx37178d097a6851d8',
      'path'  => 'pages/index/index',
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/marketing/membercard-open/cards/{card_id}/service-modules']->post([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'json' => [
    'service_module_id' => '666',
    'jump_miniprogram'  => [
      'appid' => 'wx37178d097a6851d8',
      'path'  => 'pages/index/index',
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
card_idstring会员卡id
service_module_idstring会员服务项ID
jump_miniprogramobject跳转小程序
appidstring小程序appid
pathstring小程序path

参阅 官方文档 官方文档

Published on the GitHub by TheNorthMemory