Skip to content

设置会员权益

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

请求参数类型描述
card_idstring会员卡id
codestring会员卡code
jsonobject声明请求的JSON数据结构
before_bonus_valueinteger变更前的会员积分值
bonus_valueinteger变更后的会员积分值
add_bonus_valueinteger会员积分变动值
out_request_nostring商户请求单号
php
$instance->v3->marketing->membercardOpen->cards->_card_id_->codes->_code_->rights->patchAsync([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'code' => '478515832665',
  'json' => [
    'before_bonus_value' => 500,
    'bonus_value' => 600,
    'add_bonus_value' => 100,
    'out_request_no' => '100002322019090134234sfdf',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance->chain('v3/marketing/membercard-open/cards/{card_id}/codes/{code}/rights')->patchAsync([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'code' => '478515832665',
  'json' => [
    'before_bonus_value' => 500,
    'bonus_value' => 600,
    'add_bonus_value' => 100,
    'out_request_no' => '100002322019090134234sfdf',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance['v3/marketing/membercard-open/cards/{card_id}/codes/{code}/rights']->patchAsync([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'code' => '478515832665',
  'json' => [
    'before_bonus_value' => 500,
    'bonus_value' => 600,
    'add_bonus_value' => 100,
    'out_request_no' => '100002322019090134234sfdf',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$response = $instance->v3->marketing->membercardOpen->cards->_card_id_->codes->_code_->rights->patch([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'code' => '478515832665',
  'json' => [
    'before_bonus_value' => 500,
    'bonus_value' => 600,
    'add_bonus_value' => 100,
    'out_request_no' => '100002322019090134234sfdf',
  ],
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance->chain('v3/marketing/membercard-open/cards/{card_id}/codes/{code}/rights')->patch([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'code' => '478515832665',
  'json' => [
    'before_bonus_value' => 500,
    'bonus_value' => 600,
    'add_bonus_value' => 100,
    'out_request_no' => '100002322019090134234sfdf',
  ],
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance['v3/marketing/membercard-open/cards/{card_id}/codes/{code}/rights']->patch([
  'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
  'code' => '478515832665',
  'json' => [
    'before_bonus_value' => 500,
    'bonus_value' => 600,
    'add_bonus_value' => 100,
    'out_request_no' => '100002322019090134234sfdf',
  ],
]);
print_r($response->getStatusCode() === 204);
返回字典类型描述
空字符串(无返回内容)

参阅 官方文档

Published on the GitHub by TheNorthMemory