capabilities.work

Defer a Subscription Renewal

A 3-step recipe with Android. We can help you get access.

Recipe · 3 steps

Defer a Subscription Renewal

with Android · Entitlement Enforcement

Read the current subscription expiry, defer it to a desired future time, and confirm the new expiry.

  1. Read the subscription purchase to obtain the authoritative current expiry time, which the defer call requires as its expected expiry.
  2. Defer the subscription to the desired expiry time. The expected expiry is taken from the live read so Google Play can confirm no renewal or cancellation slipped in between the two calls.
  3. Read the subscription back to confirm the deferral landed and the subscriber now holds the extended expiry time.
What you'll need to have ready
  • packageName: The package name of the application (e.g. com.example.myapp).
  • subscriptionId: The subscription product id the purchase relates to.
  • purchaseToken: The subscription purchase token supplied to the app by Google Play.
  • desiredExpiryTimeMillis: The new expiry time in milliseconds since the Epoch. Must be later than the subscription's current expiry time.
For your developer

Arazzo workflow android:defer-subscription-renewal, 3 operations: getPurchaseSubscription → deferPurchaseSubscription → getPurchaseSubscription. Specs on APIs.io.