Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using an old token to query Purchases.subscriptions in the Google Play Developer API

Let's say I have saved the token from when a user has purchased an automatically renewing subscription via Google Play. When that subscription is automatically renewed, can I still use that older, initial token to get the current status of that subscription (via Purchases.subscriptions: get)?

like image 348
Patrick Stankard Avatar asked Apr 22 '15 15:04

Patrick Stankard


People also ask

What is purchase token?

A successful purchase also generates a purchase token, which is a unique identifier that represents the user and the product ID for the in-app product they purchased.


2 Answers

Yes, you can. That token does not change. You will pass this token in your request to find out if the subscription has renewed or not. Make sure you do not lose that token otherwise it will be a nightmare to figure out if the user has renewed or not.

like image 89
Dimitar Darazhanski Avatar answered Oct 23 '22 03:10

Dimitar Darazhanski


The purchase token changes when user cancels the auto-renewal and restarts the subscription before the current period ends ( turns the auto-renew back on from play store), does upgrades/downgrades, purchases new subscription after an old subscription lapsed + for SOME cases when the order is on hold and the subscription is recovered. Almost sure Purchases.subscriptions: get response will not contain the new receipt when using the old token in this cases.

Resignup refers to when a user subscribes, cancels their subscription, and then re-subscribes before the original subscription has expired. Although they have not lost entitlement and the new subscription will be the same as the previous one, they will go through another purchase flow as they are committing to future payments. They will receive a new purchase token and the linkedPurchaseToken field will be set, as in the case of an upgrade or downgrade.

You can read more at Medium post here.

like image 44
vasmarg Avatar answered Oct 23 '22 03:10

vasmarg