alipay.marketing.card.template.create
Use this interface to create membership card templates.
Request
Service address
Environment | HTTPS request URL |
Production environment |
Request parameters
Parameter | Description |
Basic parameter | |
app_id String (32) | A unique ID that is assigned by Alipay to identify an app
|
method String (128) | The interface name
|
format String (40) | Request format. Only JSON is supported.
|
charset String (10) | The charset with which the request data are encoded. UTF-8, GBK, and GB2312 are supported.
|
sign_type String (10) | The signature algorithm used by the merchant to generate the pre-sign string. RSA and RSA2 are supported. RSA2 is preferred.
|
sign String (344) | The signature value. See Signature for details.
|
timestamp String (19) | The time when the request is sent. The format is yyyy-MM-dd HH:mm:ss.
|
version String (3) | The interface version. The value is fixed as
|
notify_url String (256) | The URL for receiving asynchronous notifications from Alipay
|
biz_content String | Collection of request parameters. The maximum length is not limited. Except for common parameters, all other request parameters must be passed to this parameter. |
Business parameter | |
request_id String (32) | The unique ID assigned by the ISV/merchant to identify a request.
|
card_type String (32) | Card type. The value is fixed as OUT_MEMBER_CARD.
|
biz_no_prefix String (10) | Prefix of the membership card number. A card number consists of |
biz_no_suffix_len String (2) | Length of the card number suffix. The value ranges from 8 to 32, and cannot be changed after being assigned to a template. A card number consists of
|
write_off_type String (32) | Type of the membership card code that is used for redemption. See the following list for details about each code type. Static code
Alipay dynamic code
The codes expire after two minutes since generation. Merchant dynamic code
The code validity period is subject to the merchant. To use merchant dynamic codes, contact Alipay Technical Support for the related documents.
|
template_style_info TemplateStyleInfoDTO | Template style information. For more information, see template_style_info. |
template_benefit_info TemplateBenefitInfoDTO[] | Membership card privileges. The information in this parameter is displayed in the "Member benefits" module on the membership card page. For more information, see template_benefit_info. |
column_info_list TemplateColumnInfoDTO[] | Information about modules that are to be displayed on the membership card. For more information, see column_info_list. |
field_rule_list TemplateFieldRuleDTO[] | List of rules about the membership card fields information. For example, if the card validity period is two years since issuance, then |
card_action_list TemplateActionInfoDTO[] | List of card action points. An action point is the clickable area on the card. A card can have up to four action points. Duplicated action points are not displayed. For more information, see card_action_list. |
open_card_conf TemplateOpenCardConfDTO | Used to configure information about issuing the membership card. For more information, see open_card_conf. |
card_level_conf TemplateCardLevelConfDTO[] | Used to configure the card level. For more information, see card_level_conf. |
mdcode_notify_conf TemplateMdcodeNotifyConfDTO | Used to configure related information needed for notifying merchants to generate dynamic QR code when the customer uses the membership card. This parameter specifies the notification data that are sent to the merchant when the user opens the electronic membership card. Note: This field is required when the value of For more information, see mdcode_notify_conf. |
card_spec_tag String (20) | Special tag of the card, which is used only for certain situations. Usually can be ignored. |
template_style_info
Parameter | Description |
card_show_name String (10) | Card name displayed in the wallet. Example: Huabei Joint Card |
logo_id String (1000) | ID of the logo image obtained after using
|
background_id String (1000) | ID of the background image obtained after using
|
bg_color String (32) | Font color. Only applies to texts.
|
front_text_list_enable Boolean (5) | This parameter decides whether texts are to be displayed in the card front. The default value is
|
front_image_enable Boolean (5) | This parameter decides whether the ID photo is to be displayed in the card front. The default value is
|
feature_descriptions String[] (4000) | Information about the card features that can be previewed by the user when issuing the card.
|
slogan String (100) | Slogan
|
slogan_img_id String (100) | ID of the slogan image obtained after using alipay.offline.material.image.upload to upload the image.
|
brand_name String (100) | Brand name
|
banner_img_id String (1000) | ID of the banner image obtained after using
|
banner_url String (256) | Redirection address of the banner.
|
column_info_layout String (10) | Module information layout. Possible values are:
If empty, the default value is list.
|
template_benefit_info
Parameter | Description |
title String (16) | Benefit title
|
benefit_desc String[] (1000) | Benefit description
|
start_date String (64) | Start time of the benefit
|
end_date String (64) | End time of the benefit
|
column_info_list
Parameter | Description |
code String (32) | Module code, including standard module codes and customized module code: Standard module codes are specified by Alipay and include the following code values:
Customized module codes are specified by merchants to display customized functions and features. Duplicated module codes are not allowed.
|
operate_type String (32) | Module operation type. Possible values:
Notes:
|
title String (16) | Module title
|
value String (16) | Value of the module code. For example, the value of
|
more_info MoreInfoDTO (2048) | Additional information about the module. For more information, see more_info. |
icon_id String (1000) | If the value of
|
tag String (3) | If the value of
|
more_info
Parameter | Description |
title String (16) | Subpage title of the
|
url String (256) | URL address of the
|
params String (1024) | Extended parameter, which must contain the value in URL. Format: JSON. This field is required when the value of |
descs String[] (1000) | Descriptions to be shown on the subpage of the
|
field_rule_list
Parameter | Description |
field_name String (64) | Field names. Possible values:
|
rule_name String (64) | Rule name. Possible values:
|
rule_value String (512) | The value of this field depends on the If If If
|
card_action_list
Parameter | Description |
code String (32) | Code of the card action point, which is customized by the merchant.
|
text String (6) | Texts dispalyed at the card action point.
|
url_type String (20) | Redirection URL type. Possible values are:
If this field is not specified, the default value is
|
url String (1024) | Action point redirection URL, which is an HTTP(S) address or Alipay schema address of the action point. This field is required when
|
mini_app_url TemplateOpenCardConfDTO (999) | Action point redirection URL, which is a redirection URL to a specified Alipay mini program page. This field is required when |
mini_app_url
Parameter | Description |
mini_app_id String (20) | ID of the mini program
|
mini_page_param String (20) | Used to specify the Alipay mini program page that the customer is redirected from the action point. If this field is not specified, the customer is redirected to the Alipay mini program homepage. |
mini_query_param String (50) | Merchant customized parameter. The value of this parameter is passed in to the mini-app page with a name of "query". |
display_on_list String (5) | Used to decide whether the action point button is to be displayed in the list page. If this field is not specified, the default value is false to indicate that the action point button is not to be displayed. Up to two action points can be added in the list page.
|
open_card_conf
Parameter | Description |
open_card_source_type String (20) | The party that issues the membership card. Possible values are:
|
source_app_id String (32) | App ID of the service provider that provides the card issuance page.
|
open_card_url String (256) | Card issuing link, which starts with http or https.
|
conf String (4000) | Reserved parameter for future use |
card_rights TemplateRightsContentDTO[] (3) | Card privilege information. For more information, see card_rights. |
card_rights
Parameter | Description |
title String (10) | Privilege title
|
detail String (20) | Privilege details
|
card_level_conf
Parameter | Description |
level String (64) | Membership level. Must be consistent with the value of level in alipay.marketing.card.open.
|
level_show_name String (64) | Displayed name of the membership level
|
level_icon String (64) | ID of the membership level icon image. Use the alipay.offline.material.image.upload interface to upload the icon.
|
level_desc String (4000) | Membership level description
|
mdcode_notify_conf
Parameter | Description |
url String (1024) | URL used to receive the code issuing notification. Use HTTPS URLs. When a member opens the electronic card, Alipay sends a POST request to this URL to notify the merhcant to generate a code.
|
ext_params String (1024) | Extended parameters, which is in a "key":value" format. The POST request that is sent by Alipay to the address specified by url are including all the parameters in ext_params.
|
Response
Parameter | Description |
Basic parameter | |
code String | Gateway return code, which indicates whether the request is accepted by Alipay gateway.
|
msg String | Description of the gateway return code
|
sub_code String | Processing result of the request
|
sub_msg String | Description of the processing result of the request
|
sign String | The signature value. See Signature for details.
|
Business parameter | |
template_id String (32) | The unique ID assigned by Alipay to identify a membership card template
|
Notification trigger condition
Trigger condition name | Description | Default value |
tradeStatus.TRADE_SUCCESS | Request is processed successfully | 1: to indicate that by default the notification is to be sent |
Business error code
Error code | Description | Solution |
INVALID_PARAMETER | The parameters are invalid. | Use correct request parameters and try again. |
SYSTEM_ERROR | System error | Try again later. |
TEMPLATE_NOT_EXIT | The template does not exist. | Check whether the template ID is correct. |
NO_CARD_TYPE | The card type does not exist. | Use a valid card type and try again. |
TEMPLATE_OVER_LIMIT | The template quantity limit is reached. | Use an existing template instead. Or contact the merchant support to expand the limit. |
Sample
Request sample
JAVA
AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do","app_id","your private_key","json","GBK","alipay_public_key","RSA2");
AlipayMarketingCardTemplateCreateRequest request = new AlipayMarketingCardTemplateCreateRequest();
request.setBizContent("{" +
"\"request_id\":\"2016072600000000000000001\"," +
"\"card_type\":\"OUT_MEMBER_CARD\"," +
"\"biz_no_prefix\":\"prex\"," +
"\"biz_no_suffix_len\":\"10\"," +
"\"write_off_type\":\"qrcode\"," +
"\"template_style_info\":{" +
"\"card_show_name\":\"Huabei Joint Card\"," +
"\"logo_id\":\"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC\"," +
"\"color\":\"rgb(55,112,179)\"," +
"\"background_id\":\"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC\"," +
"\"bg_color\":\"rgb(55,112,179)\"," +
"\"front_text_list_enable\":false," +
"\"front_image_enable\":false," +
" \"feature_descriptions\":[" +
" \"With the Huabei Card, you can enjoy free installments.\"" +
" ]," +
"\"slogan\":\"Benefits more than you can imagine.\"," +
"\"slogan_img_id\":\"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC\"," +
"\"brand_name\":\"Coca Cola\"," +
"\"banner_img_id\":\"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC\"," +
"\"banner_url\":\"http://www.baidu.com\"," +
"\"column_info_layout\":\"list\"" +
" }," +
" \"template_benefit_info\":[{" +
" \"title\":\"Discount for every purchase\"," +
" \"benefit_desc\":[" +
" \"Discount for every purchase\"" +
" ]," +
"\"start_date\":\"2016-07-18 15:17:23\"," +
"\"end_date\":\"2016-07-34 12:12:12\"" +
" }]," +
" \"column_info_list\":[{" +
" \"code\":\"BENEFIT_INFO\"," +
"\"operate_type\":\"openWeb\"," +
"\"title\":\"Only for members\"," +
"\"value\":\"80\"," +
"\"more_info\":{" +
"\"title\":\"Member benefits\"," +
"\"url\":\"http://www.baidu.com\"," +
"\"params\":\"{}\"," +
" \"descs\":[" +
" \"30% off on your birthday\"" +
" ]" +
" }," +
"\"icon_id\":\"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC\"," +
"\"tag\":\"Popular\"," +
"\"group_title\":\"School helper\"" +
" }]," +
" \"field_rule_list\":[{" +
" \"field_name\":\"Balance\"," +
"\"rule_name\":\"ASSIGN_FROM_REQUEST\"," +
"\"rule_value\":\"Balance\"" +
" }]," +
" \"card_action_list\":[{" +
" \"code\":\"TO_CLOCK_IN\"," +
"\"text\":\"Clock in\"," +
"\"url_type\":\"url\"," +
"\"url\":\"https://merchant.ali.com/ee/clock_in.do\"," +
"\"mini_app_url\":{" +
"\"mini_app_id\":\"2018xxxxxxx\"," +
"\"mini_page_param\":\"xxxxxxxx\"," +
"\"mini_query_param\":\"abcxxxxxx\"," +
"\"display_on_list\":\"false\"" +
" }" +
" }]," +
"\"open_card_conf\":{" +
"\"open_card_source_type\":\"ISV\"," +
"\"source_app_id\":\"201609191111111\"," +
"\"open_card_url\":\"https://www.alipay.com\"," +
"\"conf\":\"\\\"\\\"\"," +
" \"card_rights\":[{" +
" \"title\":\"Points for gifts\"," +
"\"detail\":\"Check your points anytime,use your points for gifts\"" +
" }]" +
" }," +
" \"shop_ids\":[" +
" \"2015122900077000000002409504\"" +
" ]," +
" \"pub_channels\":[{" +
" \"pub_channel\":\"SHOP_DETAIL\"," +
"\"ext_info\":\"\\\"key\\\":\\\"value\\\"\"" +
" }]," +
" \"card_level_conf\":[{" +
" \"level\":\"VIP1\"," +
"\"level_show_name\":\"Golden member\"," +
"\"level_icon\":\"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC\"," +
"\"level_desc\":\"Free parking for golden members\"" +
" }]," +
"\"mdcode_notify_conf\":{" +
"\"url\":\"https://www.ali123.com/ant/mdcode\"," +
"\"ext_params\":\"{\\\"param1\\\":\\\"value1\\\",\\\"param2\\\":\\\"value2\\\"}\"" +
" }," +
"\"card_spec_tag\":\"NONE\"" +
" }");
AlipayMarketingCardTemplateCreateResponse response = alipayClient.execute(request);
if(response.isSuccess()){
System.out.println("Call succeeds");
} else {
System.out.println("Call fails");
}
.NET
IAopClient client = new DefaultAopClient("https://openapi.alipay.com/gateway.do", "app_id", "merchant_private_key", "json", "1.0", "RSA2", "alipay_public_key", "GBK", false);
AlipayMarketingCardTemplateCreateRequest request= new AlipayMarketingCardTemplateCreateRequest() ;
request.BizContent="{" +
"\"request_id\":\"2016072600000000000000001\"," +
"\"card_type\":\"OUT_MEMBER_CARD\"," +
"\"biz_no_prefix\":\"prex\"," +
"\"biz_no_suffix_len\":\"10\"," +
"\"write_off_type\":\"qrcode\"," +
"\"template_style_info\":{" +
"\"card_show_name\":\"Huabei Joint Card\"," +
"\"logo_id\":\"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC\"," +
"\"color\":\"rgb(55,112,179)\"," +
"\"background_id\":\"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC\"," +
"\"bg_color\":\"rgb(55,112,179)\"," +
"\"front_text_list_enable\":false," +
"\"front_image_enable\":false," +
" \"feature_descriptions\":[" +
" \"With the Huabei Card, you can enjoy free installments\"" +
" ]," +
"\"slogan\":\"Benefits more than you can imagine.\"," +
"\"slogan_img_id\":\"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC\"," +
"\"brand_name\":\"Coca Cola\"," +
"\"banner_img_id\":\"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC\"," +
"\"banner_url\":\"http://www.baidu.com\"," +
"\"column_info_layout\":\"list\"" +
" }," +
" \"template_benefit_info\":[{" +
" \"title\":\"Discount for every purchase\"," +
" \"benefit_desc\":[" +
" \"Discount for every purchase\"" +
" ]," +
"\"start_date\":\"2016-07-18 15:17:23\"," +
"\"end_date\":\"2016-07-34 12:12:12\"" +
" }]," +
" \"column_info_list\":[{" +
" \"code\":\"BENEFIT_INFO\"," +
"\"operate_type\":\"openWeb\"," +
"\"title\":\"Only for members\"," +
"\"value\":\"80\"," +
"\"more_info\":{" +
"\"title\":\"Member benefits\"," +
"\"url\":\"http://www.baidu.com\"," +
"\"params\":\"{}\"," +
" \"descs\":[" +
" \"30% off on your birthday\"" +
" ]" +
" }," +
"\"icon_id\":\"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC\"," +
"\"tag\":\"Popular\"," +
"\"group_title\":\"School helper\"" +
" }]," +
" \"field_rule_list\":[{" +
" \"field_name\":\"Balance\"," +
"\"rule_name\":\"ASSIGN_FROM_REQUEST\"," +
"\"rule_value\":\"Balance\"" +
" }]," +
" \"card_action_list\":[{" +
" \"code\":\"TO_CLOCK_IN\"," +
"\"text\":\"Clock in\"," +
"\"url_type\":\"url\"," +
"\"url\":\"https://merchant.ali.com/ee/clock_in.do\"," +
"\"mini_app_url\":{" +
"\"mini_app_id\":\"2018xxxxxxx\"," +
"\"mini_page_param\":\"xxxxxxxx\"," +
"\"mini_query_param\":\"abcxxxxxx\"," +
"\"display_on_list\":\"false\"" +
" }" +
" }]," +
"\"open_card_conf\":{" +
"\"open_card_source_type\":\"ISV\"," +
"\"source_app_id\":\"201609191111111\"," +
"\"open_card_url\":\"https://www.alipay.com\"," +
"\"conf\":\"\\\"\\\"\"," +
" \"card_rights\":[{" +
" \"title\":\"Points for gifts\"," +
"\"detail\":\"Check your points anytime,use your points for gifts\"" +
" }]" +
" }," +
" \"shop_ids\":[" +
" \"2015122900077000000002409504\"" +
" ]," +
" \"pub_channels\":[{" +
" \"pub_channel\":\"SHOP_DETAIL\"," +
"\"ext_info\":\"\\\"key\\\":\\\"value\\\"\"" +
" }]," +
" \"card_level_conf\":[{" +
" \"level\":\"VIP1\"," +
"\"level_show_name\":\"Golden members\"," +
"\"level_icon\":\"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC\"," +
"\"level_desc\":\"Free parking for golden members\"" +
" }]," +
"\"mdcode_notify_conf\":{" +
"\"url\":\"https://www.ali123.com/ant/mdcode\"," +
"\"ext_params\":\"{\\\"param1\\\":\\\"value1\\\",\\\"param2\\\":\\\"value2\\\"}\"" +
" }," +
"\"card_spec_tag\":\"NONE\"" +
" }";
AlipayMarketingCardTemplateCreateResponse response=client.execute(request);
Console.WriteLine(response.Body);
PHP
$aop = new AopClient ();
$aop->gatewayUrl = 'https://openapi.alipay.com/gateway.do';
$aop->appId = 'your app_id';
$aop->rsaPrivateKey = 'Please fill in the developer's private key without the head, tail, or any return';
$aop->alipayrsaPublicKey='Please fill in the Alipay public key';
$aop->apiVersion = '1.0';
$aop->signType = 'RSA2';
$aop->postCharset='GBK';
$aop->format='json';
$request = new AlipayMarketingCardTemplateCreateRequest ();
$request->setBizContent("{" .
"\"request_id\":\"2016072600000000000000001\"," .
"\"card_type\":\"OUT_MEMBER_CARD\"," .
"\"biz_no_prefix\":\"prex\"," .
"\"biz_no_suffix_len\":\"10\"," .
"\"write_off_type\":\"qrcode\"," .
"\"template_style_info\":{" .
"\"card_show_name\":\"Huabei Joint Card\"," .
"\"logo_id\":\"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC\"," .
"\"color\":\"rgb(55,112,179)\"," .
"\"background_id\":\"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC\"," .
"\"bg_color\":\"rgb(55,112,179)\"," .
"\"front_text_list_enable\":false," .
"\"front_image_enable\":false," .
" \"feature_descriptions\":[" .
" \"With the Huabei Card, you can enjoy free installments\"" .
" ]," .
"\"slogan\":\"Benefits more than you can imagine\"," .
"\"slogan_img_id\":\"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC\"," .
"\"brand_name\":\"Coca Cola\"," .
"\"banner_img_id\":\"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC\"," .
"\"banner_url\":\"http://www.baidu.com\"," .
"\"column_info_layout\":\"list\"" .
" }," .
" \"template_benefit_info\":[{" .
" \"title\":\"Discount for every purchase\"," .
" \"benefit_desc\":[" .
" \"Discount for every purchase\"" .
" ]," .
"\"start_date\":\"2016-07-18 15:17:23\"," .
"\"end_date\":\"2016-07-34 12:12:12\"" .
" }]," .
" \"column_info_list\":[{" .
" \"code\":\"BENEFIT_INFO\"," .
"\"operate_type\":\"openWeb\"," .
"\"title\":\"Only for members\"," .
"\"value\":\"80\"," .
"\"more_info\":{" .
"\"title\":\"Member benefits\"," .
"\"url\":\"http://www.baidu.com\"," .
"\"params\":\"{}\"," .
" \"descs\":[" .
" \"30% off on your birthday\"" .
" ]" .
" }," .
"\"icon_id\":\"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC\"," .
"\"tag\":\"Popular\"," .
"\"group_title\":\"School helper\"" .
" }]," .
" \"field_rule_list\":[{" .
" \"field_name\":\"Balance\"," .
"\"rule_name\":\"ASSIGN_FROM_REQUEST\"," .
"\"rule_value\":\"Balance\"" .
" }]," .
" \"card_action_list\":[{" .
" \"code\":\"TO_CLOCK_IN\"," .
"\"text\":\"Clock in\"," .
"\"url_type\":\"url\"," .
"\"url\":\"https://merchant.ali.com/ee/clock_in.do\"," .
"\"mini_app_url\":{" .
"\"mini_app_id\":\"2018xxxxxxx\"," .
"\"mini_page_param\":\"xxxxxxxx\"," .
"\"mini_query_param\":\"abcxxxxxx\"," .
"\"display_on_list\":\"false\"" .
" }" .
" }]," .
"\"open_card_conf\":{" .
"\"open_card_source_type\":\"ISV\"," .
"\"source_app_id\":\"201609191111111\"," .
"\"open_card_url\":\"https://www.alipay.com\"," .
"\"conf\":\"\\\"\\\"\"," .
" \"card_rights\":[{" .
" \"title\":\"Points for gifts\"," .
"\"detail\":\"Check your points anytime,use your points for gifts\"" .
" }]" .
" }," .
" \"shop_ids\":[" .
" \"2015122900077000000002409504\"" .
" ]," .
" \"pub_channels\":[{" .
" \"pub_channel\":\"SHOP_DETAIL\"," .
"\"ext_info\":\"\\\"key\\\":\\\"value\\\"\"" .
" }]," .
" \"card_level_conf\":[{" .
" \"level\":\"VIP1\"," .
"\"level_show_name\":\"Golden member\"," .
"\"level_icon\":\"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC\"," .
"\"level_desc\":\"Free parking for golden members\"" .
" }]," .
"\"mdcode_notify_conf\":{" .
"\"url\":\"https://www.ali123.com/ant/mdcode\"," .
"\"ext_params\":\"{\\\"param1\\\":\\\"value1\\\",\\\"param2\\\":\\\"value2\\\"}\"" .
" }," .
"\"card_spec_tag\":\"NONE\"" .
" }");
$result = $aop->execute ( $request);
$responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response";
$resultCode = $result->$responseNode->code;
if(!empty($resultCode)&&$resultCode == 10000){
echo "Succeeded";
} else {
echo "Failed";
}
HTTP request source code
https://openapi.alipay.com/gateway.do?timestamp=2013-01-01 08:08:08&method=alipay.marketing.card.template.create&app_id=16783&sign_type=RSA2&sign=ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE&version=1.0&charset=GBK&biz_content=
{
"request_id":"2016072600000000000000001",
"card_type":"OUT_MEMBER_CARD",
"biz_no_prefix":"prex",
"biz_no_suffix_len":"10",
"write_off_type":"qrcode",
"template_style_info":{
"card_show_name":"Huabei Joint Card",
"logo_id":"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC",
"color":"rgb(55,112,179)",
"background_id":"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC",
"bg_color":"rgb(55,112,179)",
"front_text_list_enable":false,
"front_image_enable":false,
"feature_descriptions":[
"With the Huabei Card, you can enjoy free installments"
],
"slogan":"Benefits more than you can imagine",
"slogan_img_id":"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC",
"brand_name":"Coca Cola",
"banner_img_id":"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC",
"banner_url":"http://www.baidu.com",
"column_info_layout":"list"
},
"template_benefit_info":[{
"title":"Discount for every purchase",
"benefit_desc":[
"Discount for every purchase"
],
"start_date":"2016-07-18 15:17:23",
"end_date":"2016-07-34 12:12:12"
}],
"column_info_list":[{
"code":"BENEFIT_INFO",
"operate_type":"openWeb",
"title":"Only for members",
"value":"80",
"more_info":{
"title":"Member benefits",
"url":"http://www.baidu.com",
"params":"{}",
"descs":[
"30% off on your birthday"
]
},
"icon_id":"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC",
"tag":"Popular",
"group_title":"School helper"
}],
"field_rule_list":[{
"field_name":"Balance",
"rule_name":"ASSIGN_FROM_REQUEST",
"rule_value":"Balance"
}],
"card_action_list":[{
"code":"TO_CLOCK_IN",
"text":"Clock in",
"url_type":"url",
"url":"https://merchant.ali.com/ee/clock_in.do",
"mini_app_url":{
"mini_app_id":"2018xxxxxxx",
"mini_page_param":"xxxxxxxx",
"mini_query_param":"abcxxxxxx",
"display_on_list":"false"
}
}],
"open_card_conf":{
"open_card_source_type":"ISV",
"source_app_id":"201609191111111",
"open_card_url":"https://www.alipay.com",
"conf":"\"\"",
"card_rights":[{
"title":"Points for gifts",
"detail":"Check your points anytime,use your points for gifts"
}]
},
"shop_ids":[
"2015122900077000000002409504"
],
"pub_channels":[{
"pub_channel":"SHOP_DETAIL",
"ext_info":"\"key\":\"value\""
}],
"card_level_conf":[{
"level":"VIP1",
"level_show_name":"Golden member",
"level_icon":"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC",
"level_desc":"Free parking for golden members"
}],
"mdcode_notify_conf":{
"url":"https://www.ali123.com/ant/mdcode",
"ext_params":"{\"param1\":\"value1\",\"param2\":\"value2\"}"
},
"card_spec_tag":"NONE"
}
//To ensure a secure communication, verify whether the sign value in the response sample is provided by Ant Financial.
Response sample
JSON
{
"alipay_marketing_card_template_create_response": {
"code": "10000",
"msg": "Success",
"template_id": "201607180000001"
},
"sign": "ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE"
}
XML
<alipay_marketing_card_template_create_response>
<code>10000</code>
<msg>Success</msg> <template_id>201607180000001</template_id>
</alipay_marketing_card_template_create_response>
Exception sample
- JSON
{
"alipay_marketing_card_template_create_response": {
"code": "20000",
"msg": "Service Currently Unavailable",
"sub_code": "isp.unknow-error",
"sub_msg": "System busy"
},
"sign": "ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE"
}
Notification trigger sample
https://www.merchant.com/receive_notify.htm?notify_type=trade_status_sync¬ify_id=91722adff935e8cfa58b3aabf4dead6ibe¬ify_time=2017-02-16 21:46:15&sign_type=RSA2&sign=WcO+t3D8Kg71dTlKwN7r9PzUOXeaBJwp8/FOuSxcuSkXsoVYxBpsAidprySCjHCjmaglNcjoKJQLJ28/Asl93joTW39FX6i07lXhnbPknezAlwmvPdnQuI01HZsZF9V1i6ggZjBiAd5lG8bZtTxZOJ87ub2i9GuJ3Nr/NUc9VeY=&card_type=null&external_card_no=null&user_id=null&card_status=null&template_id=null&request_id=null&process_time=null&event_code=TREATE_PAY&biz_card_no=1000000089&trade_no=20170425000000000001&out_trade_no=201704250000000000001&total_amount=23.20&buyer_pay_amount=23.23&gmt_payment=2017-04-25 14:51:22&merchant_uid=2088202855218634