title: Google Play Developer API - Why linkedPurchaseToken is not found when user perform resubscribe?
body: <p>In our backend server, when user</p>
  <ol>
  <li>Cancel the subscription.</li>
  <li>Re-subscribe again after few days.</li>
  </ol>
  <p>It is crucial for us to know, the old purchase token, and the new purchase token, are both referring to the same user.</p>
  <p>Reason is that, previous, user had already created some data in server, using old cancelled subscription purchase token.</p>
  <p>When user cancelled the subscription, and re-subscribe again, we want to ensure the user still authorized to access the old data, using the new purchase token.</p>
  <p>We expect we can get the information from <code>linkedPurchaseToken</code>, where the new purchase token, will point to the old purchase token.</p>
  <p>This is described in <a href="https://medium.com/androiddevelopers/implementing-linkedpurchasetoken-correctly-to-prevent-duplicate-subscriptions-82dfbf7167da" rel="nofollow noreferrer">https://medium.com/androiddevelopers/implementing-linkedpurchasetoken-correctly-to-prevent-duplicate-subscriptions-82dfbf7167da</a></p>
  <p>However, based on our test result, this is not the case.</p>
  <h2>Google Play Developer API</h2>
  <pre><code>credentials = service_account.Credentials.from_service_account_file(
      constant.PATH_TO_SERVICE_ACCOUNT_JSON, 
      scopes = constant.SCOPES
  )
      
  androidpublisher = googleapiclient.discovery.build(
      'androidpublisher', 
      'v3', 
      credentials = credentials
  )
  
  product = androidpublisher.purchases().subscriptions().get(
      packageName = &quot;com.xxx.yyy&quot;,
      subscriptionId = product_id,
      token = token
  ).execute()
  
  return product
  </code></pre>
  <h2>Current active subscription</h2>
  <pre><code>{
     'startTimeMillis':'1619245597271',
     'expiryTimeMillis':'1619246015249',
     'autoRenewing':True,
     'priceCurrencyCode':'SGD',
     'priceAmountMicros':'6980000',
     'countryCode':'SG',
     'developerPayload':'',
     'paymentState':1,
     'orderId':'GPA.3314-4833-2752-47988',
     'purchaseType':0,
     'acknowledgementState':1,
     'kind':'androidpublisher#subscriptionPurchase'
  }
  </code></pre>
  <h2>Previous cancelled subscription</h2>
  <pre><code>{
     'startTimeMillis':'1619244776697',
     'expiryTimeMillis':'1619245074590',
     'autoRenewing':False,
     'priceCurrencyCode':'SGD',
     'priceAmountMicros':'6980000',
     'countryCode':'SG',
     'developerPayload':'',
     'cancelReason':3,
     'orderId':'GPA.3358-9904-1003-13416',
     'purchaseType':0,
     'acknowledgementState':1,
     'kind':'androidpublisher#subscriptionPurchase'
  }
  </code></pre>
  <hr />
  <p>We do not have <code>linkedPurchaseToken</code> information. Hence, there is no way for us to know, both subscriptions are referring to a same user.</p>
  <p>In Google Play Console, it is able to tell the subscriptions are from the same user, even the order id is different. <strong>However, there is no way to know such, via Google Play Developer API respond.</strong></p>
  <p><a href="https://i.stack.imgur.com/kycGn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kycGn.png" alt="enter image description here" /></a></p>
  <hr />
  <p>Our initial guess is that, this can due to <strong>Resubscribe</strong> feature is not enabled in our Google Play Console.</p>
  <p><a href="https://i.stack.imgur.com/h6iw8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h6iw8.png" alt="enter image description here" /></a></p>
  <p>But, currently, all our production/ beta/ tester APK have been upgraded to 3.0.1 long time ago. So, we are not sure whether there is such &quot;<strong>Resubscribe is not currently available for your users because your app does not use Billing Library 2.0 in all active APKs.</strong>&quot; message.</p>
  <p>Any idea, how we can find out, whether the latest active subscription, and cancelled inactive subscription, are in fact referring to the same user?</p>