订阅创建

使用此接口发起订阅请求。成功调用此接口后,您可以获取授权链接并将用户跳转到该链接以授权订阅。用户成功授权订阅后,FuturePay 会在每个订阅周期自动扣款,并将支付结果通知给您。

1.请求地址(POST)

实时 API: https://api.futurepay.global/auto/subscription

沙盒 API: https://api.futurepay-develop.com/auto/subscription

参数类型必填描述
AuthorizationString认证 Token,用于身份验证,生成方式可参考该地址:https://doc.futurepay.global/docs/%E8%BA%AB%E4%BB%BD%E9%AA%8C%E8%AF%81#/
curTimeString当前时间,格式为 yyyy-MM-dd HH:mm:ss
merchantIdString商户 ID
appIdString应用 ID
User-AgentString发送请求的客户端信息
Content-TypeString请求数据类型,默认为 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. 请求参数

参数类型必填描述
productsIdLong产品 ID
productDetailString产品详情
consumerIdString消费者 ID
originString请求来源网站
referenceIdString参考 ID,用于唯一标识交易
customerNameString客户姓名
customerPhoneString客户手机号
countryCodeString国家代码(如 CN)
customerEmailString客户邮箱
paymentMethodObject支付方式
paymentMethod.typeString支付类型(如 alipaycn)
notifyUrlString支付通知回调地址
returnUrlString用户支付后跳转地址
browserInfoObject浏览器信息
browserInfo.osTypeString操作系统类型
browserInfo.terminalTypeString终端类型(如 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. 响应示例

参数类型描述
codeString返回代码,"0" 表示请求成功
msgString返回信息
serverTimeLong服务器时间戳
dataObject响应数据对象
data.actionObject支付跳转相关信息
data.action.urlString用户跳转授权的 URL
data.action.methodString请求方法(如 GET)
data.action.typeString跳转类型(如 redirect)
data.merchantReferenceString商户参考 ID
data.resultCodeString结果代码(如 PENDING)
successBoolean请求是否成功,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 支持团队。