基础功能
接口调用
1.
2.
3.
创建营销活动
示例代码
AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do", APP_ID, APP_PRIVATE_KEY, "json", CHARSET, ALIPAY_PUBLIC_KEY, "RSA2");
KoubeiMarketingCampaignActivityCreateRequest alipayRequest = new KoubeiMarketingCampaignActivityCreateRequest();
String bizContent = "{
"+"\"out_biz_no\": \"0000001\",
"+"\"operator_id\": \"2088102146931393\",
"+"\"operator_type\": \"MER\",
"+"\"name\": \"消费满10元送1元代金券\",
"+"\"start_time\": \"2016-05-0100: 00: 00\",
"+"\"end_time\": \"2016-10-0100: 00: 00\",
"+"\"type\": \"DIRECT_SEND\",
"+"\"desc\": \"该活动是用于挽回流失用户的\",
"+"\"budget_info\": {
"+"\"budget_type\": \"QUANTITY\",
"+"\"budget_total\": \"10258\",
"+"\"sub_budget_dimension\": \"D: 表示每天的预算;\",
"+"\"sub_value\": \"100: 表示sub_dimension定义的纬度预算为100,若sub_dimension为D的话,则表示每天最多发放100张\""+"
},
"+"\"constraint_info\": {
"+"\"user_win_count\": \"1\",
"+"\"cash_pool_id\": \"2017031100073001472700000GY7\",
"+"\"subsidy_percent\": \"95\",
"+"\"user_win_frequency\": \"D||3\",
"+"\"crowd_group_id\": \"12344556\",
"+"\"crowd_restriction\": \"NEW_MEMBER_PROM"+"O: 新会员"+"STUDENT:学生用户,仅对"+"DIRECT_SEND类型下的代金券,折扣券活动有效\",
"+"\"suit_shops\": [
"+"\"2015110600077000000002125023\",
\"2015110600077000000002125022\""+"
],
"+"\"min_cost\": \"100\",
"+"\"item_ids\": [
"+"\"212313\",
\"221322\""+"
]"+"
},
"+"\"auto_delay_flag\": \"N\",
"+"\"promo_tools\": [
{
"+"\"voucher\": {
"+"\"type\": \"MONEY\",
"+"\"verify_mode\": \"MERCHANT_SCAN\",
"+"\"voucher_note\": \"券的备注\",
"+"\"desc_detail_list\": [
{
"+"\"title\": \"温馨提示\",
"+"\"details\": [
"+"\"周一到周五可用\""+"
],
"+"\"images\": [
"+"\"https: //dl.django.t.taobao.com/rest/1.0/image?fileIds=RY7twkJVR26nz8OeXRIjvAAAACMAAQED&zoom=original\""+"
],
"+"\"url\": \"www.alipay.com\""+"
}
],
"+"\"multi_use_mode\": \"NO_MULTI\",
"+"\"rounding_rule\": \"NOT_AUTO_ROUNDING\",
"+"\"name\": \"券的名称\",
"+"\"brand_name\": \"券副标题\",
"+"\"use_instructions\": [
"+"\"券的使用说明\""+"
],
"+"\"logo\": \"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC\",
"+"\"item_info\": {
"+"\"item_text\": \"单品券说明\",
"+"\"sku_min_consume\": \"10\",
"+"\"item_name\": \"单品名称\",
"+"\"item_imgs\": [
"+"\"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC\""+"
],
"+"\"item_link\": \"www.taobao.com\",
"+"\"original_price\": \"28.88\",
"+"\"max_discount_num\": \"1\",
"+"\"min_consume_num\": \"1\",
"+"\"item_ids\": [
"+"\"0000123\",
\"0000124\""+"
],
"+"\"total_max_discount_num\": \"10\""+"
},
"+"\"voucher_img\": \"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC\",
"+"\"rate\": \"0.8\",
"+"\"max_amount\": \"100\",
"+"\"worth_value\": \"10\",
"+"\"donate_flag\": \"true\",
"+"\"validate_type\": \"FIXED\",
"+"\"start_time\": \"2016-05-0100: 00: 00\",
"+"\"end_time\": \"2016-11-0100: 00: 00\",
"+"\"relative_time\": \"1\",
"+"\"use_rule\": {
"+"\"use_time\": [
{
"+"\"dimension\": \"W\",
"+"\"values\": \"1,
3,
5\",
"+"\"times\": \"16: 00: 00,
20: 00: 00^21: 00: 00,
22: 00: 00\""+"
}
],
"+"\"pay_redirect_url\": \"https: //mycar-parkingplatform.alipay-eco.com/pbizplatform/park/parking/stayPayCarList?entrance=1\",
"+"\"forbidden_time\": {
"+"\"days\": \"2016-03-03,
2016-03-08^2016-10-01,
2016-10-01\""+"
},
"+"\"suit_shops\": [
"+"\"2015110600077000000002125023\",
\"2015110600077000000002125022\""+"
],
"+"\"min_consume\": \"10\",
"+"\"ext_info\": \"\\\\\\\"key\\\\\\\": \\\\\\\"value\\\\\\\"\",
"+"\"limit_rule\": \"USE_NO_LIMIT\""+"
},
"+"\"desc\": \"券的详细说明\",
"+"\"display_config\": {
"+"\"slogan\": \"券的宣传语\",
"+"\"slogan_img\": \"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC\""+"
},
"+"\"clause_terms\": [
{
"+"\"title\": \"说明title\",
"+"\"descriptions\": [
"+"\"说明描述内容\""+"
]"+"
}
],
"+"\"effect_type\": \"IMMEDIATELY\",
"+"\"delay_info\": {
"+"\"type\": \"ABSOLUTELY\",
"+"\"value\": \"1440\""+"
},
"+"\"ext_info\": \"\\\"key\\\": \\\"value\\\"\",
"+"\"available_amount\": \"100\",
"+"\"allow_split\": false"+"
},
"+"\"status\": \"STARTED\",
"+"\"voucher_no\": \"2342343245234234\",
"+"\"point_card\": {
"+"\"type\": \"POINT_CARD\",
"+"\"name\": \"集点卡\",
"+"\"desc\": \"集点卡的功能描述\",
"+"\"start_time\": \"2016-05-0100: 00: 00\",
"+"\"end_time\": \"2016-10-0100: 00: 00\",
"+"\"logo\": \"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC\""+"
},
"+"\"send_rule\": {
"+"\"min_cost\": \"100\",
"+"\"send_num\": \"1\",
"+"\"send_budget\": \"1234\",
"+"\"allow_repeat_send\": \"true\""+"
}"+"
}
],
"+"\"publish_channels\": [
{
"+"\"type\": \"SHOP_DETAIL\",
"+"\"name\": \"投放到店铺\",
"+"\"config\": \"\\\"PASSWORD\\\": \\\"口令送密码\\\",
\\\"BACKGROUND_LOGO\\\": \\\"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC\\\"\",
"+"\"ext_info\": \"\\\"key\\\": \\\"value\\\"\""+"
}
],
"+"\"recruit_tool\": {
"+"\"start_time\": \"2016-06-0612: 00: 00\",
"+"\"exclude_constraint_shops\": true,
"+"\"end_time\": \"2016-06-0612: 00: 00\",
"+"\"pid_shops\": [
{
"+"\"pid\": \"2088121232424234\",
"+"\"shop_ids\": [
"+"\"2015110600077000000002125023\",
\"2015110600077000000002125022\""+"
]"+"
}
]"+"
},
"+"\"ext_info\": \"\\\\\\\"key\\\\\\\": \\\\\\\"value\\\\\\\"\""+"
}";
alipayRequest.setBizContent(bizContent);
KoubeiMarketingCampaignActivityCreateResponse alipayResponse = alipayClient.execute(alipayRequest);
//处理接口返回消息alipayResponse