创建活动
创建会员活动,可以创建支付后开卡有礼&老会员有礼、以及小程序开卡有礼&老会员有礼,共四种类型的活动。
请求参数 | 类型 | 描述 |
---|---|---|
json | object | 声明请求的JSON 数据结构 |
card_id | string | 会员卡ID |
activity_name | string | 活动名称 |
activity_type | string | 活动类型NON_MEMBER_AFTERPAY | MEMBER_AFTERPAY | NON_MEMBER_MINIPROGRAM | MEMBER_MINIPROGRAM 枚举值之一 |
begin_time | string | 活动开始时间 |
end_time | string | 活动结束时间 |
award_send_period | object | 发放时间段 |
award_send_time | object[] | 指定时间 |
begin_time | string | 发放开始时间 |
end_time | string | 发放结束时间 |
award_send_day_time | object[] | 指定时间段 |
begin_day_time | object | 每日发放开始时间 |
hours | integer | 时 |
minutes | integer | 分 |
seconds | integer | 秒 |
end_day_time | object | 每日发放结束时间 |
hours | integer | 时 |
minutes | integer | 分 |
seconds | integer | 秒 |
stock_list | object[] | 优惠券列表 |
stock_creator_mchid | string | 创建批次的商户号 |
stock_id | string | 券批次ID |
out_request_no | string | 商户请求单号 |
pay_activity_setting | object | 支付后活动设置 |
logo_url | string | 商户logo |
activity_second_title | string | 支付结果页活动副标题 |
mchid_list | string[] | |
activate_setting | object | 激活方式设置 |
activate_type | string | 激活类型 |
activate_url | string | 跳转激活的url |
activate_miniprogram | object | 跳转激活的小程序 |
activate_appid | string | 跳转激活的appid |
activate_path | string | 跳转激活的path |
payment_setting | object | 支付设置 |
payment_mode | object | 支付模式 |
payment_scene_list | string[] | |
limit_bank | string | 指定银行的简称 |
goods_tags | string[] | |
miniprogram_activity_setting | object | 支付前会员活动设置 |
outer_str | string[] | |
award_jump_deploy | object | 领奖页面跳转配置 |
mini_program_appid | string | 小程序AppID |
mini_program_path | string | 小程序path |
button_text | string | 跳转按钮文案 |
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_id | string | 活动ID |
activity_status | string | 活动的当前状态 |
create_time | string | 创建时间 |
update_time | string | 更新时间 |
card_id | string | 会员卡ID |
activity_name | string | 活动名称 |
activity_type | string | 活动类型 |
begin_time | string | 活动开始时间 |
end_time | string | 活动结束时间 |
award_send_period | object | 发放时间段 |
award_send_time | object[] | 指定时间 |
begin_time | string | 发放开始时间 |
end_time | string | 发放结束时间 |
award_send_day_time | object[] | 指定时间段 |
begin_day_time | object | 每日发放开始时间 |
hours | integer | 时 |
minutes | integer | 分 |
seconds | integer | 秒 |
end_day_time | object | 每日发放结束时间 |
hours | integer | 时 |
minutes | integer | 分 |
seconds | integer | 秒 |
stock_list | object[] | 优惠券列表 |
stock_creator_mchid | string | 创建批次的商户号 |
stock_id | string | 券批次ID |
out_request_no | string | 商户请求单号 |
pay_activity_setting | object | 支付后活动设置 |
logo_url | string | 商户logo |
activity_second_title | string | 支付结果页活动副标题 |
mchid_list | string[] | |
activate_setting | object | 激活方式设置 |
activate_type | string | 激活类型 |
activate_url | string | 跳转激活的url |
activate_miniprogram | object | 跳转激活的小程序 |
activate_appid | string | 跳转激活的appid |
activate_path | string | 跳转激活的path |
payment_setting | object | 支付设置 |
payment_mode | object | 支付模式 |
payment_scene_list | string[] | 支付场景列表 |
limit_bank | string | 指定银行的简称 |
goods_tags | string[] | 订单优惠标记 |
miniprogram_activity_setting | object | 支付前会员活动设置 |
outer_str | string[] | |
award_jump_deploy | object | 领奖页面跳转配置 |
mini_program_appid | string | 小程序AppID |
mini_program_path | string | 小程序path |
button_text | string | 跳转按钮文案 |
查询活动列表
查询符合条件的多个活动
请求参数 | 类型 | 描述 |
---|---|---|
query | object | 声明请求的查询参数 |
limit | integer | 最大资源条数 |
offset | integer | 请求资源起始位置 |
activity_type | string | 活动类型NON_MEMBER_AFTERPAY | MEMBER_AFTERPAY | NON_MEMBER_MINIPROGRAM | MEMBER_MINIPROGRAM 枚举值之一 |
card_id | string | 会员卡ID |
activity_status | string | 活动的当前状态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));
返回字典 | 类型 | 描述 |
---|---|---|
data | object[] | 活动详情 |
activity_id | string | 活动ID |
activity_status | string | 活动的当前状态 |
create_time | string | 创建时间 |
update_time | string | 更新时间 |
card_id | string | 会员卡ID |
activity_name | string | 活动名称 |
activity_type | string | 活动类型 |
begin_time | string | 活动开始时间 |
end_time | string | 活动结束时间 |
award_send_period | object | 发放时间段 |
award_send_time | object[] | 指定时间 |
begin_time | string | 发放开始时间 |
end_time | string | 发放结束时间 |
award_send_day_time | object[] | 指定时间段 |
begin_day_time | object | 每日发放开始时间 |
hours | integer | 时 |
minutes | integer | 分 |
seconds | integer | 秒 |
end_day_time | object | 每日发放结束时间 |
hours | integer | 时 |
minutes | integer | 分 |
seconds | integer | 秒 |
stock_list | object[] | 优惠券列表 |
stock_creator_mchid | string | 创建批次的商户号 |
stock_id | string | 券批次ID |
out_request_no | string | 商户请求单号 |
pay_activity_setting | object | 支付后活动设置 |
logo_url | string | 商户logo |
activity_second_title | string | 支付结果页活动副标题 |
mchid_list | string[] | |
activate_setting | object | 激活方式设置 |
activate_type | string | 激活类型 |
activate_url | string | 跳转激活的url |
activate_miniprogram | object | 跳转激活的小程序 |
activate_appid | string | 跳转激活的appid |
activate_path | string | 跳转激活的path |
payment_setting | object | 支付设置 |
payment_mode | object | 支付模式 |
payment_scene_list | string[] | 支付场景列表 |
limit_bank | string | 指定银行的简称 |
goods_tags | string[] | 订单优惠标记 |
miniprogram_activity_setting | object | 支付前会员活动设置 |
outer_str | string[] | |
award_jump_deploy | object | 领奖页面跳转配置 |
mini_program_appid | string | 小程序AppID |
mini_program_path | string | 小程序path |
button_text | string | 跳转按钮文案 |
offset | integer | 请求资源起始位置 |
limit | integer | 最大资源条数 |
total_count | integer | 资源总条数 |