Update Subscription
POST
Request Body Parameters
application/jsonCommon Request Parameters
bizContent
flatPriceObjectOptionalUpdated recurring amount and currency for each formal billing cycle.amountString(12)OptionalUpdated recurring amount for each billing cycle.currencyString(3)OptionalUpdated recurring billing currency.
periodObjectOptionalUpdated 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.
discountObjectOptionalSubscription discount change.- Omit: keep the current discount unchanged.
- Pass
null: remove the current discount. - Pass an object: replace the current discount configuration.
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. Can be omitted when the change does not alter goods, e.g. merely revoking a scheduled period-end cancellation (cancelAtPeriodEnd=false).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
previewQuoteIdString(64)OptionalPreview quote ID returned by the preview API. Note: when using the quote path, the requestId in subsequent subscription change notifications is attributed to the Preview request instead of this Update request (known issue).merchantSubscriptionIdString(64)ConditionalMerchant-defined unique subscription plan ID. At least one of this field or subscriptionId is required.subscriptionIdString(64)ConditionalPingPong subscription ID. At least one of this field or merchantSubscriptionId is required.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.cancelAtPeriodEndBooleanOptionalUsed to revoke a scheduled period-end cancellation. If a subscription has already been scheduled for period-end cancellation through the Cancel API, passfalseto cancel that schedule and keep the subscription active under the current plan. This field is not used to initiate cancellation; use the Cancel API for immediate or period-end cancellation. Setting this field totruethrough Update is currently not supported.descriptionString(256)RequiredUpdated subscription description. (Mandatory per gateway validation.)effectiveModeString(64)RequiredEffective 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)RequiredBilling 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)RequiredProration 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.CUSTOM: the merchant defines the proration adjustment amount and direction for this change instead of letting the system calculate the price difference based on the remaining cycle automatically.
customAmountString(12)ConditionalCustom amount passed when prorationMode isCUSTOM.customChargeDirectionString(32)ConditionalAmount direction passed when prorationMode isCUSTOM, used to indicate whether the change requires a charge or a refund. Example:REFUND.customCurrencyString(3)ConditionalRequired when prorationMode isCUSTOM: the currency of the custom amount (ISO 4217).customAmount,customChargeDirectionandcustomCurrencyare all mandatory in CUSTOM mode, otherwise910001is returned.expiresAtString(64)OptionalExpiration time for the payment related to this update. The user must complete the payment before this time to support the plan change.redirectUrlString(255)RequiredRedirect URL back to the merchant after checkout/3DS interaction completes during the update, typically the merchant's payment or subscription result page. (Mandatory per gateway validation.)refundNotifyUrlString(255)OptionalMerchant-defined asynchronous notification URL for refund results.
URL recommendation: use a complete URL with a publicly reachable domain name. Standard web ports are recommended (HTTPS defaults to 443 and HTTP defaults to 80). Ensure the URL can reliably receive PingPongCheckout asynchronous notifications.remarkString(255)OptionalMerchant extension field.
Request Body Example
{
"clientId": "2023121216311410287",
"accId": "2023121216311410287522",
"signType": "MD5",
"sign": "SIGN_VALUE",
"version": "1.0",
"bizContent": {
"merchantSubscriptionId": "autocaseSubMerId_178401881002391785",
"requestId": "AUTO988778009",
"billingAction": "IMMEDIATE_CHARGE_AND_KEEP_CYCLE",
"effectiveMode": "IMMEDIATE",
"flatPrice": {
"amount": "60.00",
"currency": "USD"
},
"description": "qa update template description",
"goods": {
"name": "Membership",
"description": "Monthly membership",
"sku": "SKU_SUB_001",
"unitPrice": "60.00",
"number": "1",
"imgUrl": "https://merchant.example.com/goods/sub.png",
"virtualProduct": "Y",
"itemType": "3"
},
"period": {
"count": 1,
"unit": "MONTH"
},
"totalPeriodCount": 12,
"discount": {
"type": "fixedAmount",
"amountOff": "5.00",
"durationCount": "3"
},
"prorationMode": "CUSTOM",
"customAmount": "58.06",
"customChargeDirection": "REFUND",
"customCurrency": "USD"
}
}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.
discountObjectOptionalCurrent effective subscription discount configuration after the update. 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.
actionObjectOptionalFollow-up payment action details.typeStringOptionalNext action type.qrCodeStringOptionalQR code content.qrUrlStringOptionalQR code URL.paymentRedirectUrlStringOptionalPayment redirect URL.jsSdkUrlStringOptionalJS SDK URL.
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)OptionalPreview quote ID associated with this subscription update.requestIdString(64)RequiredUnique merchant request ID.subscriptionIdString(64)RequiredPingPong subscription ID.merchantSubscriptionIdString(64)RequiredMerchant-defined unique subscription plan ID.statusString(32)RequiredSubscription plan status. Valid values include:PENDING: the subscription has been created but is not yet active.IN_TRIAL: the subscription is in the trial period and service is available, but the first formal charge has not completed yet.ACTIVE: the subscription is currently active and the user is entitled to the service.PAST_DUE: the subscription reached its charge time but the current charge failed, entering the dunning or retry stage.CANCELLED: the subscription has ended and will not renew automatically.
chargeResultString(32)RequiredProcessing result of the charge or refund caused by this update. Valid values include:SUCCEEDEDFAILEDNOT_REQUIREDPENDING
chargeAmountString(12)ConditionalCharge or refund amount involved in the change, returned as a positive number only.chargeCurrencyString(3)ConditionalCurrency 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)RequiredProration 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.CUSTOM: the merchant defines the proration adjustment amount and direction for this change instead of letting the system calculate the price difference based on the remaining cycle automatically.
effectivePlanVersionIntegerOptionalEffective subscription plan version after the update.startAtString(13)OptionalUpdated subscription start time as a 13-digit millisecond timestamp string. With KEEP_CYCLE the billing anchor does not change and this field is only a display value; usecurrentPeriodStartAtin subscription notifications as the real billing anchor.endAtString(13)OptionalUpdated subscription end time as a 13-digit millisecond timestamp string.updatedAtString(13)OptionalTime when this change was processed, as a 13-digit millisecond timestamp string.notifyUrlString(255)OptionalSubscription notification URL, echoed.cancelAtPeriodEndBooleanOptionalWhether the subscription remains scheduled for period-end cancellation after the change.currentPeriodIntegerOptionalCurrent subscription period;0represents the trial period.proratedCurrencyString(3)OptionalCurrency of the prorated amount.customAmountString(12)ConditionalEchoed custom amount when prorationMode isCUSTOM.customChargeDirectionString(32)ConditionalEchoed amount direction when prorationMode isCUSTOM.customCurrencyString(3)ConditionalEchoed custom currency when prorationMode isCUSTOM.resultCodeStringRequiredBusiness result code.resultMessageStringRequiredBusiness result message.
Request Body Example
{
"accId": "2023121216311410287522",
"clientId": "2023121216311410287",
"code": "910000",
"description": "success",
"sign": "5C3D9FF88B91C968ADFA8E834ACD59C9",
"signType": "MD5",
"bizContent": {
"period": {
"count": 1,
"unit": "MONTH"
},
"totalPeriodCount": 12,
"flatPrice": {
"amount": "60.00",
"currency": "USD"
},
"discount": {
"type": "fixedAmount",
"amountOff": "5.00",
"durationCount": "3"
},
"resultCode": "910000",
"billingAction": "IMMEDIATE_CHARGE_AND_RESET_CYCLE",
"requestId": "REQ_SUB_UPDATE_001",
"status": "ACTIVE",
"chargeAmount": "60.00",
"merchantSubscriptionId": "SUB_MER_001",
"effectiveMode": "IMMEDIATE",
"resultMessage": "success",
"chargeDirection": "CHARGE",
"effectivePlanVersion": 2,
"previewQuoteId": "SUPD-2607150336100000001000141522",
"chargeResult": "SUCCEEDED",
"chargeCurrency": "USD",
"subscriptionId": "SUB-1234567890abcdef",
"prorationMode": "NONE",
"proratedCurrency": "USD",
"currentPeriod": 1,
"cancelAtPeriodEnd": false,
"notifyUrl": "https://merchant.example.com/notify/subscription",
"startAt": "1792152613237",
"endAt": "1823688613237",
"updatedAt": "1792152608933",
"action": {
"type": "PAYMENT_REDIRECT_URL",
"paymentRedirectUrl": "https://sandbox-safepay.pingpongx.com?token=TOKEN",
"jsSdkUrl": "https://payssr-cdn.pingpongx.com/acquirer-checkout-web/sandbox/pp-checkout.js?token=TOKEN"
}
}
}