Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to get the price of subscriptionPurchaseV2 from google api?

I have the same problem as described here https://support.google.com/googleplay/android-developer/thread/262071136/how-to-get-the-actual-payment-amount-in-subscriptions-v2?hl=en

In subscriptions V1 the subscription object had a field priceAmountMicros. In subscriptions V2, according to documentation, this field has been removed. This information can be found in the basePlan/offer for each of the subscriptions purchased. - from documentation. But field SubscriptionPurchaseV2.offerDetails.offerId is empty on most cases. According to documentation, the field contains value only for discounted offers. But I need the amount of each subscriptions, not only discounted. How I can get this value for each subscription?

But I still can't find out from the answer, which method I should use to retrieve price for particular purchase.

From documentation I tried to use methods to get information about base plans or offers https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers, but prices returned there are independent, they are not linked to particular transaction.

like image 377
stranger_ Avatar asked Jan 22 '26 22:01

stranger_


1 Answers

My team and I have been bumping up against this problem as well with the Subscription Purchases V2. We were able to get around this by continuing to use the Subscription Purchases V1 get method. It's working for us even for subscription purchases made through V2.

Admittedly, I'm not positive what the ramifications are for continuing to use V1, but this at least got me the information I needed for a one-time script. I hope this helps or you're able to find a better way to accomplish this! The Google forums/docs have been completely useless.

like image 102
Alex Hoopes Avatar answered Jan 25 '26 22:01

Alex Hoopes