创建芝麻 GO 模板
接口调用
settlement_config#cycle_flex_withhold_config#cycle_flex_withhold_total_period_count 的取值需等于obligation_config#obligation_times 。
类型是 JSON 字符串数组,数组的长度需严格等于 obligation_config#obligation_times+ 1,数组中每个对象包含 2 个字段:
1.
1.
2.
请求示例
AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do","app_id","your private_key","json","GBK","alipay_public_key","RSA2");
ZhimaMerchantZmgoTemplateCreateRequest request = new ZhimaMerchantZmgoTemplateCreateRequest();
request.setBizContent("{" +
" \"basic_config\":{" +
" \"template_name\":\"购物节直播活动\"," +
" \"partner_id\":\"2088531780000000\"," +
" \"isv_pid\":\"2088121746200000\"," +
" \"biz_type\":\"yunyinshang\"," +
" \"out_biz_no\":\"202939382829193287262717\"" +
" }," +
" \"obligation_config\":{" +
" \"obligation_template\":\"OBTL001\"," +
" \"obligation_times\":\"3\"," +
" \"obligation_amount\":15.00," +
" \"promise_type_desc\":\"3天内打车2次\"" +
" }," +
" \"right_config\":{" +
" \"custom_benefit_desc\":\"购机直降585元\"," +
" \"custom_sub_benefit_desc\":\"需完成任务24期\"" +
" }," +
" \"open_config\":{" +
" \"freeze_amount\":\"23.00\"," +
" \"period_mode\":\"FIX_DATE\"," +
" \"period_time\":\"7\"," +
" \"appoint_date\":\"2022-06-01 00:00:00\"," +
" \"min_sign_interval\":\"0\"," +
" \"support_expire_deferral\":true," +
" \"custom_open_tip_list\":\"[{\\\"ruleTitle\\\":\\\"当月欠费扣款30元\\\",\\\"ruleIndex\\\":1,\\\"ruleDesc\\\":\\\"任务期内,若25日前手机号处于欠费状态,则将在该月扣除30元保证金\\\"},{\\\"ruleTitle\\\":\\\"未完成任务最高扣款585元\\\",\\\"ruleIndex\\\":2,\\\"ruleDesc\\\":\\\"提前退出或欠费超过92天均视为未完成任务,将扣回已享优惠,最高585元\\\"}]\"," +
" \"card_color_scheme\":\"C_BLACK\"" +
" }," +
" \"settlement_config\":{" +
" \"settlement_type\":\"fulfillTimesCustomSettlement\"," +
" \"custom_fee_name\":\"未完成任务结算费用\"," +
" \"cycle_flex_withhold_config\":{" +
" \"cycle_flex_withhold_total_period_count\":24," +
" \"cycle_flex_withhold_max_price\":30.00," +
" \"cycle_flex_withhold_fee_name\":\"月费\"" +
" }," +
" \"fulfilltimes_custom_settlement_plan\":\"[{\\\"MAX_AMOUNT\\\":0.7,\\\"FULFILL_TIMES\\\":0},{\\\"MAX_AMOUNT\\\":0.6,\\\"FULFILL_TIMES\\\":1}]\"," +
" \"exp_stop_time_mode\":\"ABSOLATE_DATE\"," +
" \"exp_stop_time\":\"2022-06-01 00:00:00\"," +
" \"exp_stop_delay_days\":7" +
" }," +
" \"quit_config\":{" +
" \"quit_type\":\"QUIT_COMMON\"," +
" \"quit_jump_url\":\"https://pages.tmall.com/wow/z/hdwk/profit/tasks?&disableNav=YES&spma=xjk&spmb=21038795\"," +
" \"quit_desc\":\"点击退出\"" +
" }," +
" \"ext_config\":{" +
" \"text_content_fill_rule_id\":\"HTPCFR_20220715001\"," +
" \"text_content_fill_variable\":\"variable@@@变量|||variable1@@@变量1|||variable2@@@变量2|||variable4@@@变量4|||variable3@@@变量3\" +
" }" +
"}");
ZhimaMerchantZmgoTemplateCreateResponse response = alipayClient.execute(request);
if(response.isSuccess()){
System.out.println("调用成功");
} else {
System.out.println("调用失败");
}
异常示例
{
"zhima_merchant_zmgo_template_create_response":{
"msg":"Service Currently Unavailable",
"code":"20000",
"sub_msg":"系统繁忙",
"sub_code":"isp.unknow-error"
},
"sign":"ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE"
}