创建及列表查询品牌会员发券活动
创建品牌会员发券活动
通过此接口可以创建一个品牌会员发券活动,创建成功将获得活动ID。该接口需要配合品牌会员组件使用,创建活动的中的券,将会在品牌会员组件调用时展示。
| 请求参数 | 类型 | 描述 |
|---|---|---|
| json | object | 声明请求的JSON数据结构 |
| out_request_no | string | 商户请求单号 |
| brand_id | string | 品牌ID |
| card_id | string | 会员卡ID |
| activity_channel | string | 活动渠道MECHANT_APP_COMPONENT 枚举值 |
| title | string | 活动主标题 |
| sub_title | string | 活动主标题 |
| begin_time | string | 活动开始时间 |
| end_time | string | 活动结束时间 |
| apply_total | integer | 活动总库存 |
| product_coupon_stock_list | object[] | 商品券批次列表 |
| product_coupon_id | string | 商品券ID |
| stock_id | string | 批次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_no | string | 商户请求单号 |
| brand_id | string | 品牌ID |
| card_id | string | 会员卡ID |
| activity_channel | string | 活动渠道MECHANT_APP_COMPONENT 枚举值 |
| title | string | 活动主标题 |
| sub_title | string | 活动主标题 |
| begin_time | string | 活动开始时间 |
| end_time | string | 活动结束时间 |
| apply_total | integer | 活动总库存 |
| apply_available | integer | 活动剩余库存 |
| product_coupon_stock_list | object[] | 商品券批次列表 |
| product_coupon_id | string | 商品券ID |
| stock_id | string | 批次ID |
| activity_id | string | 活动ID |
| activity_state | string | 活动状态MEMBERSHIP_ACTIVITY_CREATED | MEMBERSHIP_ACTIVITY_EFFECTIVE | MEMBERSHIP_ACTIVITY_TERMINATED | MEMBERSHIP_ACTIVITY_EXPIRED 枚举值之一 |
| create_time | string | 创建时间 |
| modify_time | string | 更新时间 |
参阅 官方文档
查询品牌会员发券活动列表
查询符合条件的品牌会员发券活动列表 接口限频:按服务商商户号维度 5次/秒
| 请求参数 | 类型 | 描述 |
|---|---|---|
| query | object | 声明请求的查询参数 |
| brand_id | string | 品牌id |
| card_id | string | 会员卡模板ID |
| activity_state | string | 活动状态MEMBERSHIP_ACTIVITY_CREATED | MEMBERSHIP_ACTIVITY_EFFECTIVE | MEMBERSHIP_ACTIVITY_TERMINATED | MEMBERSHIP_ACTIVITY_EXPIRED 枚举值之一 |
| offset | integer | 请求资源起始位置 |
| limit | integer | 最大资源条数 |
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));| 返回字典 | 类型 | 描述 |
|---|---|---|
| data | object[] | 活动列表 |
| out_request_no | string | 商户请求单号 |
| brand_id | string | 品牌ID |
| card_id | string | 会员卡ID |
| activity_channel | string | 活动渠道MECHANT_APP_COMPONENT 枚举值 |
| title | string | 活动主标题 |
| sub_title | string | 活动主标题 |
| begin_time | string | 活动开始时间 |
| end_time | string | 活动结束时间 |
| apply_total | integer | 活动总库存 |
| apply_available | integer | 活动剩余库存 |
| product_coupon_stock_list | object[] | 商品券批次列表 |
| product_coupon_id | string | 商品券ID |
| stock_id | string | 批次ID |
| activity_id | string | 活动ID |
| activity_state | string | 活动状态MEMBERSHIP_ACTIVITY_CREATED | MEMBERSHIP_ACTIVITY_EFFECTIVE | MEMBERSHIP_ACTIVITY_TERMINATED | MEMBERSHIP_ACTIVITY_EXPIRED 枚举值之一 |
| create_time | string | 创建时间 |
| modify_time | string | 更新时间 |
| offset | integer | 请求资源起始位置 |
| limit | integer | 最大资源条数 |
| total_count | integer | 资源总条数 |
参阅 官方文档