Bevor
Bevor

Reputation: 8605

In-App Billing: Is ProductID and SubscriptionID the same?

I currently design my implementation strategy for possible status updates (from status purchased to status cancelled and so on) in in-app billing which is a real headache, and there is a confusion:

I fetch getPurchases() in the app. This gives me INAPP_PURCHASE_DATA which contains Table 6 with the following fields:

autoRenewing, orderId, packageName, productId, purchaseTime, purchaseState, developerPayload, purchaseToken.

I want to send some of these variables to my server (although just purchaseToken seems to be useful), but there is something unclear to me:
On the server side, I want to continuously check if the purchases are valid. I plan to do this with https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/get

But this request needs, packageName, subscriptionId, and token. Token is the purchaseToken from getPurchases() but is the subscriptionId the productId from getPurchases()?

When you invoke the manual for creating a product list in Google Play, you see here at the header of this manual Adding items one at a time to a product list at step 4 Click Create managed product or Create subscription as appropriate. and there you have to set a productId at step 5.

If productId == subscriptionId, why are there two Google Play Developer API requests then, one for "products", one for "subscriptions", so is a subscription not a product then? See:

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

The first request takes the productId, but the second request the subscriptionId which I don't have, except, that productId and subscriptionId is the same. This is very confusing.

Upvotes: 8

Views: 3235

Answers (1)

Bevor
Bevor

Reputation: 8605

After almost 5(!) months I finished the whole in-app-billing implementation in my app and on my backend server. I can confirm now that productId == subscriptionId == sku.

Upvotes: 28

Related Questions