Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Verify Google Subscription on backend - get base plan

Recently Google introduces base plans to subscriptions. Base plans are used to introduce different billing period (you end up with single subscription and couple of base plans for example: monthly, weekly, yearly) https://support.google.com/googleplay/android-developer/answer/12154973?hl=en

When I verify subscription on backend I would like to know which base plan user selected but I cannot find any way to get that. Previously I was getting all necessary informations from:

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

when Google introduced Base plans they also released purchases.subscriptionsv2:

https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2

but both only returns productId which is subscription id and no base plan id. Any idea how to get that with service account authentication?

On the other hand I can see on Google Play Console under order details productId and selected base plan, so I know subscription is configured correctly

like image 202
marekk Avatar asked Apr 07 '26 23:04

marekk


1 Answers

Google added new field offerDetails with basePlanId, offerId and offerTags into lineItems (https://developer.android.com/google/play/billing/compatibility#subscriptionpurchasev2-fields). Fields not documented yet in https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2, but already come in response.

like image 149
Arthur Tagirov Avatar answered Apr 09 '26 12:04

Arthur Tagirov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!