Skip to content
开发者工具
使用AI助手和工具加速开发

订阅更新预览 ​

  • Endpoint: POST /aggregate-pay/api/gateway/subscriptionUpdatePreview
  • Tags: 收单/订阅计划管理

Description ​

订阅计划被激活后,在后续阶段商户可自助对该已激活的订阅计划进行更新,包括从低阶产品升级到高阶产品、从高阶产品降级到低阶产品、月付/年付周期切换,以及团队席位增减等场景。 第一步:先进行更新预览(本接口) 第二步:再对预览结果进行更新确认,参见subscriptionUpdate接口

Parameters ​

FieldInTypeRequiredConstraintsDescription
Content-TypeheaderstringYes
signheaderstringYes签名信息请参考技术文档

Parameter Examples ​

  • Content-Type: "application/json"
  • sign: "FPFVT3o227JrFRbqu19boZCpVVTF9KznxyRawUmxpfXilHV/0yK46haPhAjNu1hPUMy7Vw/ILXhfzffNm4Fj0apWknlTY9OJxnSoQxS9BTFtc61tn5yV1q69x/kkBl82/qwg+XTJ4fOzy7Mar3VaC1E2PlDA6RkkKBUyNE6RYgsdB+Su7an4+4HVTNAnoe74WyvBgxTLMNg28igBTdqxaO3w/UBY6ObVp7vkqkQGdL1Y+HgmMYaAVwrM3+ALWGId0sJ+YqTY4WJ+0xCRGhaSnybiIjZsQEYyID68WNUfuavDLDsEhaMm/HfQvf5p0R1Ltovp3wwJnEbQcjY458iX5A=="

Request Body ​

Content-Type: application/json

FieldTypeRequiredConstraintsDescriptionEnum
versionstringYesmaxLength: 8接口版本 当前值为:1.5
keyVersionstringYesmaxLength: 8密钥版本 当前值为:1
requestTimestringYesmaxLength: 32请求时间,符合rfc3339规范,格式:yyyy-MM-dd'T'HH:mm:ss.SSSXXX 时间需要在当前时间两分钟内
appIdstringYesmaxLength: 64商户应用Id,PayerMax分配给商户应用的唯一标识
merchantNostringNomaxLength: 32商户号,商户与PayerMax业务签约时生成的唯一标识
dataobjectYes
data.subscriptionNostringYesmaxLength: 64PMX生成的订阅单号。subscriptionRequestId和subscriptionNo至少填其一
data.userIdstringYesmaxLength: 64用户id。
data.effectiveModestringYesmaxLength: 32生效方式。IMMEDIATE立即生效、NEXT_CYCLE下周期生效
data.billingCycleAnchorstringNomaxLength: 32账单周期处理方式。UNCHANGED按原计划(维持原账单日)、NOW重新计算周期
data.frontCallbackUrlstringYesmaxLength: 1024前端跳转地址。用户完成支付后的前端跳转地址
data.mitManagementUrlstringNomaxLength: 1024Mit管理地址。 注:当原计划的支付方式是APPLEPAY/GOOGLEPAY时,该字段是必传的
data.subscriptionPlanobjectYes
data.subscriptionPlan.subjectstringYesmaxLength: 256标题
data.subscriptionPlan.descriptionstringNomaxLength: 256描述
data.subscriptionPlan.totalPeriodsnumberYes变更后的计划要执行的周期数
data.subscriptionPlan.pricesarray[object]Yes价格和坐席列表
data.subscriptionPlan.prices[].priceIdstringYesmaxLength: 64价格ID
data.subscriptionPlan.prices[].quantitynumberYes坐席或数量

Example ​

json
{
  "version": "1.5",
  "keyVersion": "1",
  "requestTime": "2026-04-10T05:00:00+00:00",
  "appId": "6666c8b036a245799744912345a123456",
  "merchantNo": "P00213827211234",
  "data": {
    "subscriptionNo": "SUB20250417120949065211234",
    "userId": "testUserId",
    "effectiveMode": "IMMEDIATE",
    "billingCycleAnchor": "UNCHANGED",
    "frontCallbackUrl": "http://yourDomain2.com/xxxx2",
    "subscriptionPlan": {
      "subject": "subjectTest",
      "description": "descriptionTest",
      "totalPeriods": 12,
      "prices": [
        {
          "quantity": 1,
          "priceId": "PRICE00291776859198820136500001"
        }
      ]
    }
  }
}

Responses ​

200 ​

FieldTypeRequiredConstraintsDescriptionEnum
codestringYes返回码,’APPLY_SUCCESS’代表成功
msgstringYes返回描述,’Success.’
dataobjectYes
data.previewIdstringYesmaxLength: 64PMX 生成的唯一的预览单号
data.subscriptionNostringYesmaxLength: 64PMX生成的订阅单号。
data.userIdstringYesmaxLength: 64用户号
data.currentSubscriptionPlanobjectYes当前订阅计划信息
data.currentSubscriptionPlan.periodAmountobjectYes当前期扣款金额
data.currentSubscriptionPlan.periodAmount.amountnumberYes金额
data.currentSubscriptionPlan.periodAmount.currencystringYesmaxLength: 3币种
data.currentSubscriptionPlan.periodRuleobjectYes扣款规则
data.currentSubscriptionPlan.periodRule.periodCountnumberYes扣款频次。
data.currentSubscriptionPlan.periodRule.periodUnitstringYesmaxLength: 8周期。
data.currentSubscriptionPlan.pricesarray[object]Yes价格和坐席列表
data.currentSubscriptionPlan.prices[].priceIdstringYesmaxLength: 64价格 id
data.currentSubscriptionPlan.prices[].quantitynumberYes坐席或数量
data.targetSubscriptionPlanobjectYes目标订阅计划信息
data.targetSubscriptionPlan.periodAmountobjectYes扣款金额
data.targetSubscriptionPlan.periodAmount.amountnumberYes金额
data.targetSubscriptionPlan.periodAmount.currencystringYesmaxLength: 3币种
data.targetSubscriptionPlan.periodRuleobjectYes扣款规则
data.targetSubscriptionPlan.periodRule.periodCountnumberYes扣款频次。
data.targetSubscriptionPlan.periodRule.periodUnitstringYesmaxLength: 8周期。
data.targetSubscriptionPlan.pricesarray[object]Yes价格和坐席列表
data.targetSubscriptionPlan.prices[].priceIdstringYesmaxLength: 64价格 id
data.targetSubscriptionPlan.prices[].quantitynumberYes坐席或数量
data.billingPeriodobjectYes不折算场景下,不返回该字段
data.billingPeriod.periodStartTimestringYesmaxLength: 64当前账单开始时间
data.billingPeriod.periodEndTimestringYes当前账单结束时间
data.billingPeriod. previewTimestringYesmaxLength: 64本次预览时间
data.billingPeriod.remainingDaysnumberYes当前周期剩余天数
data.billingPeriod.totalPeriodDaysnumberYes当前周期总天数
data.billingPeriod.remainingRationumberYes当前周期剩余比例(4位小数)
data.prorationobjectYes折算信息,不折算场景下,不返回该字段
data.proration.billingCycleAnchorstringYesmaxLength: 64账单周期处理方式。UNCHANGED按原计划(维持原账单日)、NOW重新计算周期
data.proration.unusedCurrentAmountnumberYes当前计划未使用金额,可用于折扣
data.proration.remainingTargetAmountnumberYes目标计划剩余周期费用
data.proration.netProrationAmountnumberYes折算后的净额
data.proration.currencystringYesmaxLength: 3币种
data.amountSummaryobjectYes金额摘要
data.amountSummary.subTotalAmountnumberYes本次目标计划产生的费用小计
data.amountSummary.creditAmountnumberYes当前计划未使用金额抵扣
data.amountSummary.payableAmountnumberYes本次需要支付金额
data.amountSummary.currencystringYesmaxLength: 3币种
data.nextInvoiceobjectYes下期账单信息
data.nextInvoice.amountnumberYes下期预计应付金额
data.nextInvoice.currencystringYesmaxLength: 3下期预计应付币种
data.nextInvoice.periodStartTimestringYesmaxLength: 64下期账单周期开始时间
data.nextInvoice.periodEndTimestringYesmaxLength: 64下期账单周期结束时间

Response Example ​

json
{
  "code": "APPLY_SUCCESS",
  "msg": "Success.",
  "data": {
    "previewId": "PVI202504171209490652111234",
    "subscriptionNo": "SUB20250417120949065211234",
    "userId": "xxx",
    "currentSubscriptionPlan": {
      "periodAmount": {
        "amount": 3000,
        "currency": "KRW"
      },
      "periodRule": {
        "periodCount": 1,
        "periodUnit": "M"
      },
      "prices": [
        {
          "quantity": 1,
          "priceId": "PRICE0029177685919882013650001"
        }
      ]
    },
    "targetSubscriptionPlan": {
      "periodAmount": {
        "amount": 4200,
        "currency": "KRW"
      },
      "periodRule": {
        "periodCount": 1,
        "periodUnit": "M"
      },
      "prices": [
        {
          "quantity": 2,
          "priceId": "PRICE0029177685919882013650002"
        }
      ]
    },
    "billingPeriod": {
      "periodStartTime": "2026-04-10T00:00:00+0000",
      "periodEndTime": "2026-05-10T23:59:59+0000",
      "previewTime": "2026-04-20T15:59:59+0000",
      "remainingDays": 20,
      "totalPeriodDays": 30,
      "remainingRatio": 0.6667
    },
    "proration": {
      "billingCycleAnchor": "UNCHANGED",
      "unusedCurrentAmount": 2000,
      "remainingTargetAmount": 2800,
      "netProrationAmount": 800,
      "currency": "KRW"
    },
    "amountSummary": {
      "subTotalAmount": 2800,
      "creditAmount": 2000,
      "payableAmount": 800,
      "currency": "KRW"
    },
    "nextInvoice": {
      "periodStartTime": "2026-05-10T00:00:00+0000",
      "periodEndTime": "2026-06-10T23:59:59+0000",
      "amount": 4200,
      "currency": "KRW"
    }
  }
}

此页面的内容有帮助吗?

感谢您帮助改进 PayerMax 产品文档!

Released under the MIT License.