通用场景
会员卡开卡业务,开发者通过该接口获取用户开卡链接,用于会员卡投放。
公共请求参数
业务请求参数
template_id|会员卡模板id必选string[0,32]
【描述】会员卡模板id。使用会员卡模板创建接口(alipay.marketing.card.template.create)返回的结果
【示例值】20170228000000000210102000300974
out_string|外部自定义参数可选string[1,256]
【描述】该值为商家拉起开卡组件的传递的 out_string 值。通常可用于区分不同业务场景,禁止将该字段作为开卡流程的必要字段,否则会导致会员推广场景下的入会失败
【示例值】201928393932
callback|会员卡开卡表单提交后回调地址可选string[0,10240]
【描述】会员卡开卡表单提交后回调地址。要求必须是单纯的服务端接收回调。
说明:
1.该地址不可带参数,如需回传参数,可设置out_string入参。
【示例值】https://alipay.com/card/demo.htm
follow_app_id|需要关注的生活号appid可选string[0,512]
【描述】需要关注的生活号appid。若需要在领卡页面展示“关注生活号”提示,需开通生活号并绑定会员卡。生活号快速接入详见:https://doc.open.alipay.com/docs/doc.htm?treeid=193&articleid=105933&doctype=1
【示例值】20150000000000000
常见请求示例
默认示例
curl 'https://openapi.alipay.com/gateway.do?charset=utf-8&method=alipay.marketing.card.activateurl.apply&format=json&sign=${sign}&app_id=${appid}&version=1.0&sign_type=rsa2×tamp=${now}' \
-f 'biz_content={
"follow_app_id":"20150000000000000",
"callback":"https://alipay.com/card/demo.htm",
"out_string":"201928393932",
"template_id":"20170228000000000210102000300974"
}'
说明:本示例仅供参考。
公共响应参数
业务响应参数
apply_card_url|会员卡领卡链接必选string(102400)
【描述】会员卡领卡链接(使用时需urldecode解码)。商户获取此链接后可投放到服务窗消息、店铺二维码等。
【示例值】https://memberprod.alipay.com/account/openform/activecard.htm?app_id=2017051007191443&template_id=2017053100
响应示例
正常示例
异常示例
{
"alipay_marketing_card_activateurl_apply_response": {
"code": "10000",
"msg": "success",
"apply_card_url": "https://memberprod.alipay.com/account/openform/activecard.htm?app_id=2017051007191443&template_id=2017053100"
},
"sign": "eritjkeijkjhkkkkkkkhjereeeeeeeeeee"
}
说明:本示例仅供参考。
公共错误码
业务错误码
错误码 | 错误描述 | 凯发app官方网站的解决方案 |
---|---|---|
system_error | 系统繁忙 | 服务器异常 可能发生了网络或者系统异常,导致服务调用失败,商户可以用同样的请求发起重试 |
invalid_parameter | 参数有误 | 请根据接口返回的参数非法的具体错误信息,修改参数后进行重试 |
card_template_not_exist | 会员卡模板不存在 | 请检查会员卡模板id是否正确。使用会员卡模板创建接口(alipay.marketing.card.template.create)返回的结果 |
illegal_argument_out_string | outstring参数非法 | 校验outstring长度,不可以超过256 |
illegal_null_argument | 必填参数为空 | 检查入参是否有为空的参数 |
open_form_template_not_exist | 领卡表单配置不存在 | 领卡表单配置不存在,请调用会员卡开卡表单配置接口‘alipay.marketing.card.formtemplate.set’进行配置 |