订阅创建

使用此接口发起订阅请求。成功调用此接口后,您可以获取授权链接并将用户跳转到该链接以授权订阅。用户成功授权订阅后,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支付类型(请参考_支持订阅扣款支付方式列表_)
notifyUrlString订阅结果通知回调地址
returnUrlString用户授权后跳转地址
browserInfoObject浏览器信息
browserInfo.osTypeString操作系统类型(如 IOS, ANDROID,OTHER)
browserInfo.terminalTypeString终端类型(如 APP, WAP,WEB,MINI_APP)
{
  "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.applinkUrlString用户跳转授权的 URL用于外部浏览器跳转APP授权
data.action.schemeUrlString用户跳转授权的 URL用于APP内跳转链接
data.action.methodString请求方法(如 GET)
data.action.typeString跳转类型(如 redirect)
data.merchantReferenceString商户参考 ID
data.pspReferenceString支付平台参考 ID
data.resultCodeString结果代码(如 PENDING、FAILED)
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",
     "pspReference": "1864516583179857922",
    "resultCode": "PENDING"
  },
  "success": true
}

5. 错误码说明

错误码描述
0成功
400请求参数错误
401未授权访问
403权限不足
500服务器内部错误

6. 备注

  • notifyUrl 用于接收支付状态更新的通知。
  • returnUrl 用户完成支付后返回的页面。
  • 响应中的 action.url 需要引导用户跳转完成支付。

7.支持订阅扣款支付方式列表

支付方式枚举值描述
AlipayCNalipaycn支持支付宝中国
TrueMoney Wallettmn支持 TrueMoney 钱包支付
AlipayHKalipayhk支持支付宝香港
Touch ‘n Go eWallettng支持马来西亚 Touch ‘n Go 电子钱包
GCashgcash支持菲律宾 GCash 支付
Danadana支持印尼 Dana 钱包支付
Kakao Paykakaopay支持韩国 Kakao Pay 电子钱包支付
Rabbit LINE Payrabbitlinepay支持泰国 Rabbit LINE Pay 支付
Boostboost支持马来西亚 Boost 支付
NAVER Paynaverpay支持韩国 NAVER Pay 支付
Mpaympay支持中国澳门 MPay 支付
KPLUSkplus支持泰国 KPLUS 支付
Nigeria Cardsnigeriacards支持尼日利亚本地卡订阅支付

如果有任何问题,请联系 FuturePay 支持团队。