Skip to content

创建活动

创建会员活动,可以创建支付后开卡有礼&老会员有礼、以及小程序开卡有礼&老会员有礼,共四种类型的活动。

请求参数类型描述
jsonobject声明请求的JSON数据结构
card_idstring会员卡ID
activity_namestring活动名称
activity_typestring活动类型
NON_MEMBER_AFTERPAY | MEMBER_AFTERPAY | NON_MEMBER_MINIPROGRAM | MEMBER_MINIPROGRAM 枚举值之一
begin_timestring活动开始时间
end_timestring活动结束时间
award_send_periodobject发放时间段
award_send_timeobject[]指定时间
begin_timestring发放开始时间
end_timestring发放结束时间
award_send_day_timeobject[]指定时间段
begin_day_timeobject每日发放开始时间
hoursinteger
minutesinteger
secondsinteger
end_day_timeobject每日发放结束时间
hoursinteger
minutesinteger
secondsinteger
stock_listobject[]优惠券列表
stock_creator_mchidstring创建批次的商户号
stock_idstring券批次ID
out_request_nostring商户请求单号
pay_activity_settingobject支付后活动设置
logo_urlstring商户logo
activity_second_titlestring支付结果页活动副标题
mchid_liststring[]
activate_settingobject激活方式设置
activate_typestring激活类型
activate_urlstring跳转激活的url
activate_miniprogramobject跳转激活的小程序
activate_appidstring跳转激活的appid
activate_pathstring跳转激活的path
payment_settingobject支付设置
payment_modeobject支付模式
payment_scene_liststring[]
limit_bankstring指定银行的简称
goods_tagsstring[]
miniprogram_activity_settingobject支付前会员活动设置
outer_strstring[]
award_jump_deployobject领奖页面跳转配置
mini_program_appidstring小程序AppID
mini_program_pathstring小程序path
button_textstring跳转按钮文案
php
$instance->v3->marketing->membercardActivity->activities->postAsync([
  'json' => [
    'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
    'activity_name' => '良品铺子回馈活动',
    'activity_type' => 'NON_MEMBER_AFTERPAY',
    'begin_time' => '2020-01-20T13:29:35.120+08:00',
    'end_time' => '2020-01-29T13:29:35.120+08:00',
    'award_send_period' => [
      'award_send_time' => [[
        'begin_time' => '2020-01-21T00:00:00.000+08:00',
        'end_time' => '2020-01-27T00:00:00.000+08:00',
      ],],
      'award_send_day_time' => [[
        'begin_day_time' => [
          'hours' => 9,
          'minutes' => 34,
          'seconds' => 6,
        ],
        'end_day_time' => [
          'hours' => 9,
          'minutes' => 34,
          'seconds' => 6,
        ],
      ],],
    ],
    'stock_list' => [[
      'stock_creator_mchid' => '10000022',
      'stock_id' => '98065001',
    ],],
    'out_request_no' => '100002322019090134234sfdf',
    'pay_activity_setting' => [
      'logo_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
      'activity_second_title' => '湖南麻辣美食券',
      'mchid_list' => ['string'],
      'activate_setting' => [
        'activate_type' => 'AUTO_ACTIVATE',
        'activate_url' => 'https://w.url.cn/s/Ahz3p2C',
        'activate_miniprogram' => [
          'activate_appid' => 'wxea9c30a90fs8d3fe',
          'activate_path' => 'pages/activate/activate',
        ],
      ],
      'payment_setting' => [
        'payment_mode' => [
          'payment_scene_list' => ['string'],
        ],
        'limit_bank' => 'CFT',
        'goods_tags' => ['string'],
      ],
    ],
    'miniprogram_activity_setting' => [
      'outer_str' => ['string'],
      'award_jump_deploy' => [
        'mini_program_appid' => 'wxc0b84a53ed8e8d29',
        'mini_program_path' => 'mall/pages/List',
        'button_text' => '点击',
      ],
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/marketing/membercard-activity/activities')->postAsync([
  'json' => [
    'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
    'activity_name' => '良品铺子回馈活动',
    'activity_type' => 'NON_MEMBER_AFTERPAY',
    'begin_time' => '2020-01-20T13:29:35.120+08:00',
    'end_time' => '2020-01-29T13:29:35.120+08:00',
    'award_send_period' => [
      'award_send_time' => [[
        'begin_time' => '2020-01-21T00:00:00.000+08:00',
        'end_time' => '2020-01-27T00:00:00.000+08:00',
      ],],
      'award_send_day_time' => [[
        'begin_day_time' => [
          'hours' => 9,
          'minutes' => 34,
          'seconds' => 6,
        ],
        'end_day_time' => [
          'hours' => 9,
          'minutes' => 34,
          'seconds' => 6,
        ],
      ],],
    ],
    'stock_list' => [[
      'stock_creator_mchid' => '10000022',
      'stock_id' => '98065001',
    ],],
    'out_request_no' => '100002322019090134234sfdf',
    'pay_activity_setting' => [
      'logo_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
      'activity_second_title' => '湖南麻辣美食券',
      'mchid_list' => ['string'],
      'activate_setting' => [
        'activate_type' => 'AUTO_ACTIVATE',
        'activate_url' => 'https://w.url.cn/s/Ahz3p2C',
        'activate_miniprogram' => [
          'activate_appid' => 'wxea9c30a90fs8d3fe',
          'activate_path' => 'pages/activate/activate',
        ],
      ],
      'payment_setting' => [
        'payment_mode' => [
          'payment_scene_list' => ['string'],
        ],
        'limit_bank' => 'CFT',
        'goods_tags' => ['string'],
      ],
    ],
    'miniprogram_activity_setting' => [
      'outer_str' => ['string'],
      'award_jump_deploy' => [
        'mini_program_appid' => 'wxc0b84a53ed8e8d29',
        'mini_program_path' => 'mall/pages/List',
        'button_text' => '点击',
      ],
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/marketing/membercard-activity/activities']->postAsync([
  'json' => [
    'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
    'activity_name' => '良品铺子回馈活动',
    'activity_type' => 'NON_MEMBER_AFTERPAY',
    'begin_time' => '2020-01-20T13:29:35.120+08:00',
    'end_time' => '2020-01-29T13:29:35.120+08:00',
    'award_send_period' => [
      'award_send_time' => [[
        'begin_time' => '2020-01-21T00:00:00.000+08:00',
        'end_time' => '2020-01-27T00:00:00.000+08:00',
      ],],
      'award_send_day_time' => [[
        'begin_day_time' => [
          'hours' => 9,
          'minutes' => 34,
          'seconds' => 6,
        ],
        'end_day_time' => [
          'hours' => 9,
          'minutes' => 34,
          'seconds' => 6,
        ],
      ],],
    ],
    'stock_list' => [[
      'stock_creator_mchid' => '10000022',
      'stock_id' => '98065001',
    ],],
    'out_request_no' => '100002322019090134234sfdf',
    'pay_activity_setting' => [
      'logo_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
      'activity_second_title' => '湖南麻辣美食券',
      'mchid_list' => ['string'],
      'activate_setting' => [
        'activate_type' => 'AUTO_ACTIVATE',
        'activate_url' => 'https://w.url.cn/s/Ahz3p2C',
        'activate_miniprogram' => [
          'activate_appid' => 'wxea9c30a90fs8d3fe',
          'activate_path' => 'pages/activate/activate',
        ],
      ],
      'payment_setting' => [
        'payment_mode' => [
          'payment_scene_list' => ['string'],
        ],
        'limit_bank' => 'CFT',
        'goods_tags' => ['string'],
      ],
    ],
    'miniprogram_activity_setting' => [
      'outer_str' => ['string'],
      'award_jump_deploy' => [
        'mini_program_appid' => 'wxc0b84a53ed8e8d29',
        'mini_program_path' => 'mall/pages/List',
        'button_text' => '点击',
      ],
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->marketing->membercardActivity->activities->post([
  'json' => [
    'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
    'activity_name' => '良品铺子回馈活动',
    'activity_type' => 'NON_MEMBER_AFTERPAY',
    'begin_time' => '2020-01-20T13:29:35.120+08:00',
    'end_time' => '2020-01-29T13:29:35.120+08:00',
    'award_send_period' => [
      'award_send_time' => [[
        'begin_time' => '2020-01-21T00:00:00.000+08:00',
        'end_time' => '2020-01-27T00:00:00.000+08:00',
      ],],
      'award_send_day_time' => [[
        'begin_day_time' => [
          'hours' => 9,
          'minutes' => 34,
          'seconds' => 6,
        ],
        'end_day_time' => [
          'hours' => 9,
          'minutes' => 34,
          'seconds' => 6,
        ],
      ],],
    ],
    'stock_list' => [[
      'stock_creator_mchid' => '10000022',
      'stock_id' => '98065001',
    ],],
    'out_request_no' => '100002322019090134234sfdf',
    'pay_activity_setting' => [
      'logo_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
      'activity_second_title' => '湖南麻辣美食券',
      'mchid_list' => ['string'],
      'activate_setting' => [
        'activate_type' => 'AUTO_ACTIVATE',
        'activate_url' => 'https://w.url.cn/s/Ahz3p2C',
        'activate_miniprogram' => [
          'activate_appid' => 'wxea9c30a90fs8d3fe',
          'activate_path' => 'pages/activate/activate',
        ],
      ],
      'payment_setting' => [
        'payment_mode' => [
          'payment_scene_list' => ['string'],
        ],
        'limit_bank' => 'CFT',
        'goods_tags' => ['string'],
      ],
    ],
    'miniprogram_activity_setting' => [
      'outer_str' => ['string'],
      'award_jump_deploy' => [
        'mini_program_appid' => 'wxc0b84a53ed8e8d29',
        'mini_program_path' => 'mall/pages/List',
        'button_text' => '点击',
      ],
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/marketing/membercard-activity/activities')->post([
  'json' => [
    'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
    'activity_name' => '良品铺子回馈活动',
    'activity_type' => 'NON_MEMBER_AFTERPAY',
    'begin_time' => '2020-01-20T13:29:35.120+08:00',
    'end_time' => '2020-01-29T13:29:35.120+08:00',
    'award_send_period' => [
      'award_send_time' => [[
        'begin_time' => '2020-01-21T00:00:00.000+08:00',
        'end_time' => '2020-01-27T00:00:00.000+08:00',
      ],],
      'award_send_day_time' => [[
        'begin_day_time' => [
          'hours' => 9,
          'minutes' => 34,
          'seconds' => 6,
        ],
        'end_day_time' => [
          'hours' => 9,
          'minutes' => 34,
          'seconds' => 6,
        ],
      ],],
    ],
    'stock_list' => [[
      'stock_creator_mchid' => '10000022',
      'stock_id' => '98065001',
    ],],
    'out_request_no' => '100002322019090134234sfdf',
    'pay_activity_setting' => [
      'logo_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
      'activity_second_title' => '湖南麻辣美食券',
      'mchid_list' => ['string'],
      'activate_setting' => [
        'activate_type' => 'AUTO_ACTIVATE',
        'activate_url' => 'https://w.url.cn/s/Ahz3p2C',
        'activate_miniprogram' => [
          'activate_appid' => 'wxea9c30a90fs8d3fe',
          'activate_path' => 'pages/activate/activate',
        ],
      ],
      'payment_setting' => [
        'payment_mode' => [
          'payment_scene_list' => ['string'],
        ],
        'limit_bank' => 'CFT',
        'goods_tags' => ['string'],
      ],
    ],
    'miniprogram_activity_setting' => [
      'outer_str' => ['string'],
      'award_jump_deploy' => [
        'mini_program_appid' => 'wxc0b84a53ed8e8d29',
        'mini_program_path' => 'mall/pages/List',
        'button_text' => '点击',
      ],
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/marketing/membercard-activity/activities']->post([
  'json' => [
    'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
    'activity_name' => '良品铺子回馈活动',
    'activity_type' => 'NON_MEMBER_AFTERPAY',
    'begin_time' => '2020-01-20T13:29:35.120+08:00',
    'end_time' => '2020-01-29T13:29:35.120+08:00',
    'award_send_period' => [
      'award_send_time' => [[
        'begin_time' => '2020-01-21T00:00:00.000+08:00',
        'end_time' => '2020-01-27T00:00:00.000+08:00',
      ],],
      'award_send_day_time' => [[
        'begin_day_time' => [
          'hours' => 9,
          'minutes' => 34,
          'seconds' => 6,
        ],
        'end_day_time' => [
          'hours' => 9,
          'minutes' => 34,
          'seconds' => 6,
        ],
      ],],
    ],
    'stock_list' => [[
      'stock_creator_mchid' => '10000022',
      'stock_id' => '98065001',
    ],],
    'out_request_no' => '100002322019090134234sfdf',
    'pay_activity_setting' => [
      'logo_url' => 'https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/0',
      'activity_second_title' => '湖南麻辣美食券',
      'mchid_list' => ['string'],
      'activate_setting' => [
        'activate_type' => 'AUTO_ACTIVATE',
        'activate_url' => 'https://w.url.cn/s/Ahz3p2C',
        'activate_miniprogram' => [
          'activate_appid' => 'wxea9c30a90fs8d3fe',
          'activate_path' => 'pages/activate/activate',
        ],
      ],
      'payment_setting' => [
        'payment_mode' => [
          'payment_scene_list' => ['string'],
        ],
        'limit_bank' => 'CFT',
        'goods_tags' => ['string'],
      ],
    ],
    'miniprogram_activity_setting' => [
      'outer_str' => ['string'],
      'award_jump_deploy' => [
        'mini_program_appid' => 'wxc0b84a53ed8e8d29',
        'mini_program_path' => 'mall/pages/List',
        'button_text' => '点击',
      ],
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
activity_idstring活动ID
activity_statusstring活动的当前状态
create_timestring创建时间
update_timestring更新时间
card_idstring会员卡ID
activity_namestring活动名称
activity_typestring活动类型
begin_timestring活动开始时间
end_timestring活动结束时间
award_send_periodobject发放时间段
award_send_timeobject[]指定时间
begin_timestring发放开始时间
end_timestring发放结束时间
award_send_day_timeobject[]指定时间段
begin_day_timeobject每日发放开始时间
hoursinteger
minutesinteger
secondsinteger
end_day_timeobject每日发放结束时间
hoursinteger
minutesinteger
secondsinteger
stock_listobject[]优惠券列表
stock_creator_mchidstring创建批次的商户号
stock_idstring券批次ID
out_request_nostring商户请求单号
pay_activity_settingobject支付后活动设置
logo_urlstring商户logo
activity_second_titlestring支付结果页活动副标题
mchid_liststring[]
activate_settingobject激活方式设置
activate_typestring激活类型
activate_urlstring跳转激活的url
activate_miniprogramobject跳转激活的小程序
activate_appidstring跳转激活的appid
activate_pathstring跳转激活的path
payment_settingobject支付设置
payment_modeobject支付模式
payment_scene_liststring[]支付场景列表
limit_bankstring指定银行的简称
goods_tagsstring[]订单优惠标记
miniprogram_activity_settingobject支付前会员活动设置
outer_strstring[]
award_jump_deployobject领奖页面跳转配置
mini_program_appidstring小程序AppID
mini_program_pathstring小程序path
button_textstring跳转按钮文案

参阅 官方文档 官方文档

查询活动列表

查询符合条件的多个活动

请求参数类型描述
queryobject声明请求的查询参数
limitinteger最大资源条数
offsetinteger请求资源起始位置
activity_typestring活动类型
NON_MEMBER_AFTERPAY | MEMBER_AFTERPAY | NON_MEMBER_MINIPROGRAM | MEMBER_MINIPROGRAM 枚举值之一
card_idstring会员卡ID
activity_statusstring活动的当前状态
CREATED | ONGOING | TERMINATED | OVER_TIME 枚举值之一
php
$instance->v3->marketing->membercardActivity->activities->getAsync([
  'query' => [
    'limit' => 5,
    'offset' => 10,
    'activity_type' => 'NON_MEMBER_AFTERPAY',
    'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
    'activity_status' => 'ONGOING',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/marketing/membercard-activity/activities')->getAsync([
  'query' => [
    'limit' => 5,
    'offset' => 10,
    'activity_type' => 'NON_MEMBER_AFTERPAY',
    'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
    'activity_status' => 'ONGOING',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/marketing/membercard-activity/activities']->getAsync([
  'query' => [
    'limit' => 5,
    'offset' => 10,
    'activity_type' => 'NON_MEMBER_AFTERPAY',
    'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
    'activity_status' => 'ONGOING',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->marketing->membercardActivity->activities->get([
  'query' => [
    'limit' => 5,
    'offset' => 10,
    'activity_type' => 'NON_MEMBER_AFTERPAY',
    'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
    'activity_status' => 'ONGOING',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/marketing/membercard-activity/activities')->get([
  'query' => [
    'limit' => 5,
    'offset' => 10,
    'activity_type' => 'NON_MEMBER_AFTERPAY',
    'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
    'activity_status' => 'ONGOING',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/marketing/membercard-activity/activities']->get([
  'query' => [
    'limit' => 5,
    'offset' => 10,
    'activity_type' => 'NON_MEMBER_AFTERPAY',
    'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
    'activity_status' => 'ONGOING',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
dataobject[]活动详情
activity_idstring活动ID
activity_statusstring活动的当前状态
create_timestring创建时间
update_timestring更新时间
card_idstring会员卡ID
activity_namestring活动名称
activity_typestring活动类型
begin_timestring活动开始时间
end_timestring活动结束时间
award_send_periodobject发放时间段
award_send_timeobject[]指定时间
begin_timestring发放开始时间
end_timestring发放结束时间
award_send_day_timeobject[]指定时间段
begin_day_timeobject每日发放开始时间
hoursinteger
minutesinteger
secondsinteger
end_day_timeobject每日发放结束时间
hoursinteger
minutesinteger
secondsinteger
stock_listobject[]优惠券列表
stock_creator_mchidstring创建批次的商户号
stock_idstring券批次ID
out_request_nostring商户请求单号
pay_activity_settingobject支付后活动设置
logo_urlstring商户logo
activity_second_titlestring支付结果页活动副标题
mchid_liststring[]
activate_settingobject激活方式设置
activate_typestring激活类型
activate_urlstring跳转激活的url
activate_miniprogramobject跳转激活的小程序
activate_appidstring跳转激活的appid
activate_pathstring跳转激活的path
payment_settingobject支付设置
payment_modeobject支付模式
payment_scene_liststring[]支付场景列表
limit_bankstring指定银行的简称
goods_tagsstring[]订单优惠标记
miniprogram_activity_settingobject支付前会员活动设置
outer_strstring[]
award_jump_deployobject领奖页面跳转配置
mini_program_appidstring小程序AppID
mini_program_pathstring小程序path
button_textstring跳转按钮文案
offsetinteger请求资源起始位置
limitinteger最大资源条数
total_countinteger资源总条数

参阅 官方文档 官方文档

Published on the GitHub by TheNorthMemory