Subscribe with Google


Newsletter


Survey


Rewarded Ads


Custom CTA


Reader Registration


Using Extended Access


Syncing Publisher Entitlements to Google


Receiving Entitlements from Google


Cancelling Entitlements Plans or Making Refunds


Content examples

Update subscription (Upgrade/Downgrade)

To upgrade or downgrade a subscription, you first need to identify the user's current active subscription. This can be done using the Publication API.

1. Check Eligibility (Publication API)

Sign in with Google to retrieve your current entitlements. If an active subscription is found, the update buttons below will be enabled.

Button Details

Sign-in with Google button to check your active subscriptions.

Please sign in to check your eligibility for an update.

2. Upgrade/Downgrade Flows

showUpdateOffers()

The showUpdateOffers() method displays an offers carousel specifically for existing subscribers. It requires an oldSku parameter to identify the subscription being replaced.

In this demo, we'll use your current active SKU (retrieved above) as the oldSku and offer SWGPD.3391-5185-7663-76625 and SWGPD.9541-3600-4891-30479 as alternatives.

updateSubscription()

The updateSubscription() method initiates a direct purchase flow for a new SKU, replacing an existing one. It also requires an oldSku.

In this demo, we'll trigger an update from your current SKU to SWGPD.3391-5185-7663-76625.

Implementation

showUpdateOffers

  1. Identify the user's current SKU (e.g., from getEntitlements()).
  2. Call showUpdateOffers() with the current SKU as oldSku and a list of available skus to upgrade/downgrade to.
subscriptions.showUpdateOffers({
  oldSku: 'SWGPD.2773-7054-3310-59985',
  skus: ['SWGPD.3391-5185-7663-76625', 'SWGPD.9541-3600-4891-30479'],
  isClosable: true
});

updateSubscription

If you want to trigger a specific upgrade/downgrade directly (e.g., from a custom button), use updateSubscription().

subscriptions.updateSubscription({
  skuId: 'SWGPD.3391-5185-7663-76625',
  oldSku: 'SWGPD.2773-7054-3310-59985'
});

Proration Modes

By default, SwG uses IMMEDIATE_WITH_TIME_PRORATION. You can explicitly set this in the SubscriptionRequest.

subscriptions.updateSubscription({
  skuId: 'new_sku_id',
  oldSku: 'current_sku_id',
  replaceSkuProrationMode: 'IMMEDIATE_WITH_TIME_PRORATION'
});
Fork me on GitHub