订阅创建
使用此接口发起订阅请求。成功调用此接口后,您可以获取授权链接并将用户跳转到该链接以授权订阅。用户成功授权订阅后,FuturePay 会在每个订阅周期自动扣款,并将支付结果通知给您。
1.请求地址(POST)
实时 API: https://api.futurepay.global/auto/subscription
沙盒 API: https://api.futurepay-develop.com/auto/subscription
2.请求头参数
参数 | 类型 | 必填 | 描述 |
---|---|---|---|
Authorization | String | 是 | 认证 Token,用于身份验证,生成方式可参考该地址:https://doc.futurepay.global/docs/%E8%BA%AB%E4%BB%BD%E9%AA%8C%E8%AF%81#/ |
curTime | String | 是 | 当前时间,格式为 yyyy-MM-dd HH:mm:ss |
merchantId | String | 是 | 商户 ID |
appId | String | 是 | 应用 ID |
User-Agent | String | 是 | 发送请求的客户端信息 |
Content-Type | String | 是 | 请求数据类型,默认为 application/json |
{
"Authorization": "b8dfd126f5a787279dfe58b1f8889f096f1f7d473da7935c60fb245a58b8c25b",
"curTime": "2025-03-13 14:15:03",
"merchantId": "1864516583179857920",
"appId": "1864516583200808960",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36",
"Content-Type": "application/json"
}
3. 请求参数
参数 | 类型 | 必填 | 描述 |
---|---|---|---|
productsId | Long | 是 | 产品 ID |
productDetail | String | 是 | 产品详情 |
consumerId | String | 是 | 消费者 ID |
origin | String | 是 | 请求来源网站 |
referenceId | String | 是 | 参考 ID,用于唯一标识交易 |
customerName | String | 是 | 客户姓名 |
customerPhone | String | 是 | 客户手机号 |
countryCode | String | 是 | 国家代码(如 CN) |
customerEmail | String | 否 | 客户邮箱 |
paymentMethod | Object | 是 | 支付方式 |
paymentMethod.type | String | 是 | 支付类型(如 alipaycn) |
notifyUrl | String | 是 | 支付通知回调地址 |
returnUrl | String | 是 | 用户支付后跳转地址 |
browserInfo | Object | 是 | 浏览器信息 |
browserInfo.osType | String | 是 | 操作系统类型 |
browserInfo.terminalType | String | 是 | 终端类型(如 WEB) |
{
"productsId": 1899744808189210624,
"productDetail": "Premium Subscription Plan",
"consumerId": "USER-10008",
"origin": "https://merchant-website.com",
"referenceId": "1b8a9331-79d0-4b66-974b-ef9c43213e30",
"customerName": "John Doe",
"customerPhone": "+8613800000000",
"countryCode": "CN",
"customerEmail": "[email protected]",
"paymentMethod": {
"type": "alipaycn"
},
"notifyUrl": "https://merchant-website.com/notify",
"returnUrl": "https://merchant-website.com/return",
"browserInfo": {
"osType": "OTHER",
"terminalType": "WEB"
}
}
4. 响应示例
参数 | 类型 | 描述 |
---|---|---|
code | String | 返回代码,"0" 表示请求成功 |
msg | String | 返回信息 |
serverTime | Long | 服务器时间戳 |
data | Object | 响应数据对象 |
data.action | Object | 支付跳转相关信息 |
data.action.url | String | 用户跳转授权的 URL |
data.action.method | String | 请求方法(如 GET) |
data.action.type | String | 跳转类型(如 redirect) |
data.merchantReference | String | 商户参考 ID |
data.resultCode | String | 结果代码(如 PENDING) |
success | Boolean | 请求是否成功,true 表示成功 |
{
"code": "0",
"msg": "success",
"serverTime": 1741846578666,
"data": {
"action": {
"url": "https://g.alipayplus.com/page/aplus-linker/acwallet/qrcode.html?url=alipayconnect%3A%2F%2Fplatformapi%2Facwallet%2FsignContract&scopes=AGREEMENT_PAY%2CUSER_LOGIN_ID&bizContent=%7B%22acquirerId%22%3A%22Z02TE2404000000A%22%2C%22authClientDisplayName%22%3A%22seelife%22%2C%22authClientId%22%3A%221864516583179857920%22%2C%22authClientName%22%3A%22seelife%22%2C%22authRedirectUrl%22%3A%22https%3A%2F%2Fg.alipayplus.com%2Fpage%2Fac-auth-payment%2Fresult%2Fmobile%2Findex.html%3FloadMode%3D2%26callbackType%3DCommon%26terminalType%3DWEB%26referenceAgreementId%3D1900068379297972224%26authRequestId%3D2025031319091305000150000715707%26pspId%3D102208800000000000A%26clientId%3DT_305Y392YSG5VPU02102%22%2C%22authState%22%3A%221900068379297972224%22%2C%22customerBelongsTo%22%3A%22ALIPAY_CN%22%2C%22osType%22%3A%22OTHER%22%2C%22pspId%22%3A%22102208800000000000A%22%2C%22referenceAgreementId%22%3A%221900068379297972224%22%2C%22referenceMerchantId%22%3A%221864516583179857920%22%2C%22scopes%22%3A%5B%22AGREEMENT_PAY%22%2C%22USER_LOGIN_ID%22%5D%2C%22terminalType%22%3A%22WEB%22%7D&source=AlipayConnect&needCallback=false",
"method": "Get",
"type": "redirect"
},
"merchantReference": "1864516583179857920",
"resultCode": "PENDING"
},
"success": true
}
5. 错误码说明
错误码 | 描述 |
---|---|
0 | 成功 |
400 | 请求参数错误 |
401 | 未授权访问 |
403 | 权限不足 |
500 | 服务器内部错误 |
6. 备注
notifyUrl
用于接收支付状态更新的通知。returnUrl
用户完成支付后返回的页面。- 响应中的
action.url
需要引导用户跳转完成支付。
如果有任何问题,请联系 FuturePay 支持团队。
Updated about 13 hours ago