store.changeSubscriptionPlan()

Type Function
Return value none
Revision Release 2026.3728
Keywords Samsung, IAP, in-app purchases, subscription, changeSubscriptionPlan
See also store.purchase()
store.acknowledgePurchase()
store.*

Overview

Upgrades or downgrades an active subscription to another subscription product, then dispatches a storeTransaction event to the listener defined in store.init(). On success the event has a state of "purchased" for the new subscription and previousProductIdentifier set to the replaced one; acknowledge the new purchase with store.acknowledgePurchase().

Syntax

store.changeSubscriptionPlan( currentProductIdentifier, newProductIdentifier [,options] )
currentProductIdentifier (required)

String. The product identifier of the subscription the user currently owns.

newProductIdentifier (required)

String. The product identifier of the subscription to switch to.

options (optional)

Table. A table with the following optional keys:

  • prorationMode — A string telling Samsung IAP how to handle the remaining time of the current subscription:
    • "instantProratedDate" (default) — The change takes effect immediately; the remaining time is converted into time on the new plan based on the price difference.
    • "instantProratedCharge" — The change takes effect immediately; the price difference for the remaining period is charged.
    • "instantNoProration" — The change takes effect immediately; the new price is charged from the next renewal.
    • "deferred" — The change takes effect at the next renewal.
  • obfuscatedAccountId, obfuscatedProfileId, passThroughParam — Same as for store.purchase().

Example

store.changeSubscriptionPlan( "com.mycompany.mygame.premium.monthly", "com.mycompany.mygame.premium.yearly", {
    prorationMode = "instantProratedDate",
} )