Skip to content

创建及列表查询品牌会员发券活动

创建品牌会员发券活动

通过此接口可以创建一个品牌会员发券活动,创建成功将获得活动ID。该接口需要配合品牌会员组件使用,创建活动的中的券,将会在品牌会员组件调用时展示。

请求参数类型描述
jsonobject声明请求的JSON数据结构
out_request_nostring商户请求单号
brand_idstring品牌ID
card_idstring会员卡ID
activity_channelstring活动渠道
MECHANT_APP_COMPONENT 枚举值
titlestring活动主标题
sub_titlestring活动主标题
begin_timestring活动开始时间
end_timestring活动结束时间
apply_totalinteger活动总库存
product_coupon_stock_listobject[]商品券批次列表
product_coupon_idstring商品券ID
stock_idstring批次ID
php
$instance->v3->brand->partner->cardMember->membershipActivities->postAsync([
  'json' => [
    'out_request_no'            => '100002322019090134234sfdf',
    'brand_id'                  => '1004',
    'card_id'                   => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
    'activity_channel'          => 'MECHANT_APP_COMPONENT',
    'title'                     => '入会享券',
    'sub_title'                 => '5张满减券',
    'begin_time'                => '2020-01-20T13:29:35.120+08:00',
    'end_time'                  => '2020-01-29T13:29:35.120+08:00',
    'apply_total'               => 1000,
    'product_coupon_stock_list' => [[
      'product_coupon_id' => '701138812971763025610907319729',
      'stock_id'          => '98065001',
    ],],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/brand/partner/card-member/membership-activities')->postAsync([
  'json' => [
    'out_request_no'            => '100002322019090134234sfdf',
    'brand_id'                  => '1004',
    'card_id'                   => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
    'activity_channel'          => 'MECHANT_APP_COMPONENT',
    'title'                     => '入会享券',
    'sub_title'                 => '5张满减券',
    'begin_time'                => '2020-01-20T13:29:35.120+08:00',
    'end_time'                  => '2020-01-29T13:29:35.120+08:00',
    'apply_total'               => 1000,
    'product_coupon_stock_list' => [[
      'product_coupon_id' => '701138812971763025610907319729',
      'stock_id'          => '98065001',
    ],],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/brand/partner/card-member/membership-activities']->postAsync([
  'json' => [
    'out_request_no'            => '100002322019090134234sfdf',
    'brand_id'                  => '1004',
    'card_id'                   => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
    'activity_channel'          => 'MECHANT_APP_COMPONENT',
    'title'                     => '入会享券',
    'sub_title'                 => '5张满减券',
    'begin_time'                => '2020-01-20T13:29:35.120+08:00',
    'end_time'                  => '2020-01-29T13:29:35.120+08:00',
    'apply_total'               => 1000,
    'product_coupon_stock_list' => [[
      'product_coupon_id' => '701138812971763025610907319729',
      'stock_id'          => '98065001',
    ],],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->brand->partner->cardMember->membershipActivities->post([
  'json' => [
    'out_request_no'            => '100002322019090134234sfdf',
    'brand_id'                  => '1004',
    'card_id'                   => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
    'activity_channel'          => 'MECHANT_APP_COMPONENT',
    'title'                     => '入会享券',
    'sub_title'                 => '5张满减券',
    'begin_time'                => '2020-01-20T13:29:35.120+08:00',
    'end_time'                  => '2020-01-29T13:29:35.120+08:00',
    'apply_total'               => 1000,
    'product_coupon_stock_list' => [[
      'product_coupon_id' => '701138812971763025610907319729',
      'stock_id'          => '98065001',
    ],],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/brand/partner/card-member/membership-activities')->post([
  'json' => [
    'out_request_no'            => '100002322019090134234sfdf',
    'brand_id'                  => '1004',
    'card_id'                   => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
    'activity_channel'          => 'MECHANT_APP_COMPONENT',
    'title'                     => '入会享券',
    'sub_title'                 => '5张满减券',
    'begin_time'                => '2020-01-20T13:29:35.120+08:00',
    'end_time'                  => '2020-01-29T13:29:35.120+08:00',
    'apply_total'               => 1000,
    'product_coupon_stock_list' => [[
      'product_coupon_id' => '701138812971763025610907319729',
      'stock_id'          => '98065001',
    ],],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/brand/partner/card-member/membership-activities']->post([
  'json' => [
    'out_request_no'            => '100002322019090134234sfdf',
    'brand_id'                  => '1004',
    'card_id'                   => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
    'activity_channel'          => 'MECHANT_APP_COMPONENT',
    'title'                     => '入会享券',
    'sub_title'                 => '5张满减券',
    'begin_time'                => '2020-01-20T13:29:35.120+08:00',
    'end_time'                  => '2020-01-29T13:29:35.120+08:00',
    'apply_total'               => 1000,
    'product_coupon_stock_list' => [[
      'product_coupon_id' => '701138812971763025610907319729',
      'stock_id'          => '98065001',
    ],],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
out_request_nostring商户请求单号
brand_idstring品牌ID
card_idstring会员卡ID
activity_channelstring活动渠道
MECHANT_APP_COMPONENT 枚举值
titlestring活动主标题
sub_titlestring活动主标题
begin_timestring活动开始时间
end_timestring活动结束时间
apply_totalinteger活动总库存
apply_availableinteger活动剩余库存
product_coupon_stock_listobject[]商品券批次列表
product_coupon_idstring商品券ID
stock_idstring批次ID
activity_idstring活动ID
activity_statestring活动状态
MEMBERSHIP_ACTIVITY_CREATED | MEMBERSHIP_ACTIVITY_EFFECTIVE | MEMBERSHIP_ACTIVITY_TERMINATED | MEMBERSHIP_ACTIVITY_EXPIRED 枚举值之一
create_timestring创建时间
modify_timestring更新时间

参阅 官方文档

查询品牌会员发券活动列表

查询符合条件的品牌会员发券活动列表 接口限频:按服务商商户号维度 5次/秒

请求参数类型描述
queryobject声明请求的查询参数
brand_idstring品牌id
card_idstring会员卡模板ID
activity_statestring活动状态
MEMBERSHIP_ACTIVITY_CREATED | MEMBERSHIP_ACTIVITY_EFFECTIVE | MEMBERSHIP_ACTIVITY_TERMINATED | MEMBERSHIP_ACTIVITY_EXPIRED 枚举值之一
offsetinteger请求资源起始位置
limitinteger最大资源条数
php
$instance->v3->brand->partner->cardMember->membershipActivities->getAsync([
  'query' => [
    'brand_id'       => '1004',
    'card_id'        => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
    'activity_state' => 'MEMBERSHIP_ACTIVITY_CREATED',
    'offset'         => 10,
    'limit'          => 5,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/brand/partner/card-member/membership-activities')->getAsync([
  'query' => [
    'brand_id'       => '1004',
    'card_id'        => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
    'activity_state' => 'MEMBERSHIP_ACTIVITY_CREATED',
    'offset'         => 10,
    'limit'          => 5,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/brand/partner/card-member/membership-activities']->getAsync([
  'query' => [
    'brand_id'       => '1004',
    'card_id'        => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
    'activity_state' => 'MEMBERSHIP_ACTIVITY_CREATED',
    'offset'         => 10,
    'limit'          => 5,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->brand->partner->cardMember->membershipActivities->get([
  'query' => [
    'brand_id'       => '1004',
    'card_id'        => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
    'activity_state' => 'MEMBERSHIP_ACTIVITY_CREATED',
    'offset'         => 10,
    'limit'          => 5,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/brand/partner/card-member/membership-activities')->get([
  'query' => [
    'brand_id'       => '1004',
    'card_id'        => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
    'activity_state' => 'MEMBERSHIP_ACTIVITY_CREATED',
    'offset'         => 10,
    'limit'          => 5,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/brand/partner/card-member/membership-activities']->get([
  'query' => [
    'brand_id'       => '1004',
    'card_id'        => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
    'activity_state' => 'MEMBERSHIP_ACTIVITY_CREATED',
    'offset'         => 10,
    'limit'          => 5,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
dataobject[]活动列表
out_request_nostring商户请求单号
brand_idstring品牌ID
card_idstring会员卡ID
activity_channelstring活动渠道
MECHANT_APP_COMPONENT 枚举值
titlestring活动主标题
sub_titlestring活动主标题
begin_timestring活动开始时间
end_timestring活动结束时间
apply_totalinteger活动总库存
apply_availableinteger活动剩余库存
product_coupon_stock_listobject[]商品券批次列表
product_coupon_idstring商品券ID
stock_idstring批次ID
activity_idstring活动ID
activity_statestring活动状态
MEMBERSHIP_ACTIVITY_CREATED | MEMBERSHIP_ACTIVITY_EFFECTIVE | MEMBERSHIP_ACTIVITY_TERMINATED | MEMBERSHIP_ACTIVITY_EXPIRED 枚举值之一
create_timestring创建时间
modify_timestring更新时间
offsetinteger请求资源起始位置
limitinteger最大资源条数
total_countinteger资源总条数

参阅 官方文档

Published on the GitHub by TheNorthMemory