Preview Subscription Update
POST
Request Body Parameters
application/jsonCommon Request Parameters
bizContent
flatPriceObjectOptionalUpdated recurring amount and currency for each formal billing cycle.amountString(12)RequiredUpdated recurring amount for each billing cycle.currencyString(3)RequiredUpdated recurring billing currency.
periodObjectRequiredUpdated subscription billing cycle.countIntegerRequiredNumber of units in one formal billing cycle. Must be at least1. For example, unit =MONTHand count =1means monthly billing. This is not the total number of billing cycles.unitStringRequiredSubscription period unit type. Valid values include:YEAR: the subscription cycle is measured in years.MONTH: the subscription cycle is measured in months.WEEK: the subscription cycle is measured in weeks.DAY: the subscription cycle is measured in days.
discountObjectOptionalDiscount configuration for the proposed subscription plan. Applies only to formal billing cycles and not to the trial period.typeString(32)RequiredDiscount type. Valid values:fixedAmount: fixed-amount discount.percentage: percentage discount.
amountOffString(12)ConditionalFixed discount amount. Provide only when type isfixedAmount; mutually exclusive with percentOff.percentOffString(12)ConditionalPercentage discount value. Provide only when type ispercentage; mutually exclusive with amountOff.durationCountString(12)RequiredNumber of formal billing cycles for which the discount applies, excluding the trial period.
goodsObjectOptionalUpdated goods information.nameString(128)RequiredProduct name.descriptionString(255)OptionalProduct description.skuString(255)OptionalProduct number, product SKU.unitPriceString(12)RequiredUnit price of the product. Note: the sum ofunitPrice × numbermust equalflatPrice.amount, otherwise301012is returned.unitTaxAmountString(12)ConditionalTax per item, mandatory when the total order amount includes tax.taxRateStringOptionalTax rate.totalDiscountAmountStringConditionalTotal discount amount per item, mandatory when the total order amount involves discounts.numberString(12)RequiredQuantity of the product purchased.imgUrlString(255)RequiredMain image link of the product.virtualProductString(1)OptionalWhether it is a virtual product, virtual goods (Y/N).itemTypeString(1)OptionalProduct type, enumerated values:1/2/3, corresponding meanings are as follows:1DIGITAL: Digital products2PHYSICAL: Physical products3SERVICE: Services
merchantSubscriptionIdString(64)RequiredMerchant-defined unique subscription plan ID.subscriptionIdString(64)RequiredPingPong subscription ID.requestIdString(64)RequiredUnique merchant request ID.totalPeriodCountIntegerOptionalTotal number of formal billing cycles in the subscription plan. Must be at least1and excludes the trial period. If omitted, the number of formal billing cycles is unlimited.startAtString(64)OptionalUpdated subscription start time as a 10-digit second-level timestamp string.endAtString(64)OptionalUpdated subscription end time as a 10-digit second-level timestamp string.descriptionString(256)OptionalUpdated subscription description.effectiveModeString(64)OptionalEffective mode of the subscription change. Defaults toIMMEDIATEif not provided. IfNEXT_CYCLEis specified, another update is not allowed before the change takes effect in the next billing cycle. Valid values include:IMMEDIATE: the subscription change takes effect immediately.NEXT_CYCLE: the subscription change takes effect at the beginning of the next billing cycle.
billingActionString(64)OptionalBilling action. Valid values include:IMMEDIATE_CHARGE_AND_KEEP_CYCLE: charge or refund immediately and keep the current billing anchor, frequency, and schedule.IMMEDIATE_CHARGE_AND_RESET_CYCLE: charge or refund immediately and reset the billing anchor to the current time, allowing the billing frequency to change.NEXT_CYCLE_CHARGE_KEEP_CYCLE: charge or refund on the next billing date while keeping the current billing frequency and schedule.
prorationModeString(64)OptionalProration mode. Defaults toPRORATEDif not provided. Valid values include:PRORATED: considers the residual value of the unused service time and calculates any extra charge or refund based on the remaining time.NONE: does not consider the residual value of the unused service time.
remarkString(255)OptionalMerchant extension field.
Request Body Example
{
"clientId": "2025050971820281024",
"accId": "2025050971820281024001",
"signType": "MD5",
"sign": "SIGN_VALUE",
"version": "1.0",
"bizContent": {
"merchantSubscriptionId": "SUB_MER_001",
"subscriptionId": "SUB-1234567890abcdef",
"requestId": "REQ_SUB_PREVIEW_001",
"flatPrice": {
"amount": "19.99",
"currency": "USD"
},
"period": {
"count": 1,
"unit": "MONTH"
},
"totalPeriodCount": 12,
"discount": {
"type": "percentage",
"percentOff": "10",
"durationCount": "3"
},
"startAt": "1785152760",
"description": "updated monthly membership plan",
"goods": {
"name": "subscription plan",
"description": "qa template goods",
"sku": "QA-SUB-001",
"unitPrice": "19.99",
"number": "1",
"imgUrl": "https://merchant.example.com/goods/subscription-plan.png",
"virtualProduct": "Y",
"unitTaxAmount": "1.60",
"taxRate": "0.08",
"totalDiscountAmount": "0.00",
"itemType": "3"
},
"effectiveMode": "IMMEDIATE",
"billingAction": "IMMEDIATE_CHARGE_AND_KEEP_CYCLE",
"prorationMode": "PRORATED",
"remark": "preview-update"
}
}Responses Body Parameters
application/jsonCommon Response Parameters
bizContent
periodObjectRequiredUpdated subscription billing cycle.countIntegerRequiredNumber of units in one formal billing cycle. Must be at least1. For example, unit =MONTHand count =1means monthly billing. This is not the total number of billing cycles.unitStringRequiredSubscription period unit type. Valid values include:YEAR: the subscription cycle is measured in years.MONTH: the subscription cycle is measured in months.WEEK: the subscription cycle is measured in weeks.DAY: the subscription cycle is measured in days.
flatPriceObjectRequiredUpdated recurring amount and currency for each formal billing cycle.amountString(12)RequiredActual recurring amount for each formal billing cycle of the subscription plan.currencyString(3)RequiredBilling currency for formal subscription cycles, as a 3-letter ISO 4217 currency code.
discountObjectOptionalDiscount configuration in the previewed subscription plan. Not returned when no discount is configured.typeString(32)RequiredDiscount type. Valid values:fixedAmount: fixed-amount discount.percentage: percentage discount.
amountOffString(12)ConditionalFixed discount amount. Provide only when type isfixedAmount; mutually exclusive with percentOff.percentOffString(12)ConditionalPercentage discount value. Provide only when type ispercentage; mutually exclusive with amountOff.durationCountString(12)RequiredNumber of formal billing cycles for which the discount applies, excluding the trial period.
currentFlatPriceObjectOptionalCurrently effective recurring amount and currency before the change.amountString(12)RequiredCurrent recurring billing amount.currencyString(3)RequiredCurrent recurring billing currency.
currentPeriodObjectOptionalCurrent subscription cycle. Note: this API returns an object{unit, count}, unlike the integer period number returned by the subscription query API.unitStringRequiredCycle unit.countIntegerRequiredNumber of units.
totalPeriodCountIntegerOptionalTotal number of formal billing cycles in the subscription plan. Must be at least1and excludes the trial period. If omitted, the number of formal billing cycles is unlimited.previewQuoteIdString(64)RequiredPreview quote ID for the subscription update, which can be used in the subsequent update request.requestIdString(64)RequiredUnique merchant request ID.subscriptionIdString(64)RequiredPingPong subscription ID.merchantSubscriptionIdString(64)RequiredMerchant-defined unique subscription plan ID.chargeResultString(32)OptionalResult of the related charge or refund caused by the change. Example:PENDING.chargeAmountString(12)OptionalCharge or refund amount involved in the change.chargeCurrencyString(3)OptionalCurrency of the charge or refund involved in the change.chargeDirectionString(32)OptionalCharge direction. Example:CHARGEorREFUND.effectiveModeString(32)OptionalEffective mode of the subscription change. Defaults toIMMEDIATEif not provided. IfNEXT_CYCLEis specified, another update is not allowed before the change takes effect in the next billing cycle. Valid values include:IMMEDIATE: the subscription change takes effect immediately.NEXT_CYCLE: the subscription change takes effect at the beginning of the next billing cycle.
billingActionString(64)OptionalBilling action. Valid values include:IMMEDIATE_CHARGE_AND_KEEP_CYCLE: charge or refund immediately and keep the current billing anchor, frequency, and schedule.IMMEDIATE_CHARGE_AND_RESET_CYCLE: charge or refund immediately and reset the billing anchor to the current time, allowing the billing frequency to change.NEXT_CYCLE_CHARGE_KEEP_CYCLE: charge or refund on the next billing date while keeping the current billing frequency and schedule.
prorationModeString(32)OptionalProration mode. Defaults toPRORATEDif not provided. Valid values include:PRORATED: considers the residual value of the unused service time and calculates any extra charge or refund based on the remaining time.NONE: does not consider the residual value of the unused service time.
effectivePlanVersionIntegerOptionalEffective subscription plan version after preview.proratedAmountString(12)OptionalProrated price difference calculated from the remaining time (unrounded).proratedCurrencyString(3)OptionalCurrency of the prorated amount.currentDescriptionString(256)OptionalSubscription description before the change.startAtString(13)OptionalUpdated subscription start time as a 13-digit millisecond timestamp string.endAtString(13)OptionalUpdated subscription end time as a 13-digit millisecond timestamp string.expireAtString(13)OptionalExpiration time of this preview quote as a 13-digit millisecond timestamp string. Preview again after it expires.resultCodeStringRequiredBusiness result code.resultMessageStringRequiredBusiness result message.
Request Body Example
{
"accId": "2023121216311410287522",
"clientId": "2023121216311410287",
"code": "910000",
"description": "success",
"sign": "3DD05643B2CF10B3B675A02D0152EBEF",
"signType": "MD5",
"bizContent": {
"period": {
"count": 1,
"unit": "MONTH"
},
"totalPeriodCount": 12,
"flatPrice": {
"amount": "19.99",
"currency": "USD"
},
"discount": {
"type": "percentage",
"percentOff": "10",
"durationCount": "3"
},
"resultCode": "910000",
"billingAction": "IMMEDIATE_CHARGE_AND_KEEP_CYCLE",
"requestId": "REQ_SUB_PREVIEW_001",
"chargeAmount": "4.84",
"merchantSubscriptionId": "SUB_MER_001",
"effectiveMode": "IMMEDIATE",
"resultMessage": "success",
"chargeDirection": "CHARGE",
"effectivePlanVersion": 2,
"previewQuoteId": "SUPD-2607150312100000000900141522",
"chargeResult": "PENDING",
"chargeCurrency": "USD",
"proratedAmount": "9.677419",
"proratedCurrency": "USD",
"subscriptionId": "SUB-1234567890abcdef",
"prorationMode": "PRORATED",
"currentFlatPrice": {
"amount": "10.00",
"currency": "USD"
},
"currentDescription": "Monthly membership subscription",
"currentPeriod": {
"count": 1,
"unit": "MONTH"
},
"startAt": "1792152180824",
"endAt": "1823688180824",
"expireAt": "1792153080828"
}
}