Search code examples
androidin-app-billing

Google Play Developer API: get Subscription: what is subscriptionId?


In documentation for the Get API

https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/get

It states:

subscriptionId string The purchased subscription ID (for example, 'monthly001').

However, I can not find exactly that name in any of the Json returns of the Google's Billing Client.

I see: productid field (and a corresponding getSKU method) in SkuDetails.java (part of billing client)

 /** Returns the product Id. */
  public String getSku() {
    return mParsedJson.optString("productId");
  }

But there is no subscriptionId. Is productId in SkuDetail the right value for the 'subscriptionId' that the API above expects?


Solution

  • Yes, productId. I think productId is the general term; when referring to subscriptions in particular, it is subscriptionId.

    Happy coding :)