接口说明
接口英文名称:alipay.marketing.card.formtemplate.set
请求url:https://openapi.alipay.com/v3/alipay/marketing/card/formtemplate/set
请求方式:post
path指该参数为路径参数
query指该参数需在请求url传参
body指该参数需在请求json传参
通用场景
会员卡开卡、用户授权确认
公共请求参数
业务请求参数
body参数
template_id|会员卡模板id必选string[0,32]
【描述】会员卡模板id。调用alipay.marketing.card.template.create(会员卡模板创建接口)创建模板后同步返回。
【示例值】20170228000000000210102000300974
fields|表单字段必选openformfielddo
【描述】会员卡开卡时的表单字段配置信息,即用户开卡时需填写内容。可定义多个通用表单字段,最大不超过20个。 注意:required必须填一个
required|表单必填字段配置可选string[0,102400]
【描述】表单必填字段配置,common_fields属性定义一个表单字段数组,字段有效值如下列表所示:
open_form_field_mobile -- 手机号
open_form_field_gender -- 性别
open_form_field_name -- 姓名
open_form_field_birthday -- 生日
open_form_field_idcard -- 身份证
open_form_field_email -- 邮箱
open_form_field_address -- 地址
open_form_field_city -- 城市
open_form_field_is_student -- 是否学生认证
open_form_field_member_grade -- 会员等级
【示例值】{
"common_fields": [
"open_form_field_mobile"
]
}
optional|表单可选字段配置可选string[0,102400]
【描述】表单可选字段配置,common_fields属性定义一个表单字段数组,表单字段有效值列表与required字段有效值列表相同。
可选字段配置中不能含有必须字段配置的有效值。
【示例值】{
"common_fields": [
"open_form_field_gender"
]
}
常见请求示例
推荐示例
默认示例
curl -x post \
"https://openapi.alipay.com/v3/alipay/marketing/card/formtemplate/set" \
-h "authorization: alipay-sha256withrsa app_id=${appid},timestamp=${now},nonce=${uuid},expired_seconds=600,sign=${sign}" \
-h "alipay-request-id: ${requestid}" \
-h "content-type: application/json" \
-d '{
"fields":{
"required":"{\n\n \"common_fields\": [\n\n \"open_form_field_mobile\"\n\n ]\n\n }"
},
"template_id":"20170228000000000210102000300974"
}'
说明:本示例仅供参考。
公共响应参数
业务响应参数
无业务响应参数
响应示例
正常示例
异常示例
{}
说明:本示例仅供参考。
公共错误码
前往查看业务错误码
状态码 | 错误码 | 错误描述 | 凯发app官方网站的解决方案 |
---|---|---|---|
400 | system_error | 系统繁忙 | 服务器异常 可能发生了网络或者系统异常,导致服务调用失败,商户可以用同样的请求发起重试 |
400 | invalid_parameter | 参数有误 | 请根据接口返回的参数非法的具体错误信息,修改参数后进行重试 |
400 | card_template_not_exist | 会员卡模板不存在 | 请检查template_id参数的有效性 |
400 | duplicate_birthday_field | 不可同时配置两种类型的生日字段 | 不可同时配置两种类型的生日字段,请选择open_form_field_birthday和open_form_field_birthday_with_year之一 |
400 | duplicate_cert_no | 不可同时配置证件号和身份证号字段 | 不可同时配置证件号(open_form_field_cert_no)和身份证号(open_form_field_idcard)字段,请检查配置参数. |
400 | duplicate_form_field | 表单字段重复配置 | 请检查必填字段与可选字段是否配置了相同的表单字段名称 |
400 | form_field_invalid | 表单字段无效 | 请检查入参通用表单列表值的有效性 |
400 | illegal_null_argument | 有必填参数为空 | 请确认必填参数不为空 |
400 | invalid_cert_type_and_no | 证件类型和证件号两个字段需同时配置 | 证件类型(open_form_field_cert_type)和证件号(open_form_field_cert_no)需同时配置,请检查配置参数。 |
400 | open_form_set_fail | 表单配置失败 | 请稍后重试 |