Is there any way to validate google play transaction with REST?

I want to make transactions and validate them through backendless. How can I do that?

I found this article but it only works with Java SDK

Hi Timur,

I am still checking if there is REST API. Out of curiosity, could you please describe why the implementation in our SDK for Android would not work for you?

Regards,
Mark

Hi Timur,

Sure there is a REST API.

Here are the routes for v4:

Validate Purchase: GET /<app_id>/&lt;rest_api_key&gt;/commerce/googleplay/validate/&lt;package_name&gt;/inapp/&lt;product_id&gt;/purchases/&lt;token&gt;
Get Subscription Status: GET /<app_id>/&lt;rest_api_key&gt;/commerce/googleplay/&lt;package_name&gt;/subscription/&lt;subscription_id&gt;/purchases/&lt;token&gt;
Cancel Subscription: POST /<app_id>/&lt;rest_api_key&gt;/commerce/googleplay/&lt;package_name&gt;/subscription/&lt;subscription_id&gt;/purchases/&lt;token&gt;/cancel

And for v3:

Validate Purchase: GET /&lt;version_name&gt;/commerce/googleplay/validate/&lt;package_name&gt;/inapp/&lt;product_id&gt;/purchases/&lt;token&gt;
Get Subscription Status: GET /&lt;version_name&gt;/commerce/googleplay/&lt;package_name&gt;/subscription/&lt;subscription_id&gt;/purchases/&lt;token&gt;
Cancel Subscription: POST /&lt;version_name&gt;/commerce/googleplay/&lt;package_name&gt;/subscription/&lt;subscription_id&gt;/purchases/&lt;token&gt;/cancel

Hello! I don’t want to implement any additional sdks in my project. They makes app bigger and slower in some way

Thanks! But where can I find the explanation of mechanism “under the hood”? For example, I want to check any in-app purchases though Backenless. After payment I want to increase some value in table. What should I do?

Hello,

call

Validate Purchase: GET /<app_id>/&lt;rest_api_key&gt;/commerce/googleplay/validate/&lt;package_name&gt;/inapp/&lt;product_id&gt;/purchases/&lt;token&gt;
Get Subscription Status: GET /<app_id>/&lt;rest_api_key&gt;/commerce/googleplay/&lt;package_name&gt;/subscription/&lt;subscription_id&gt;/purchases/&lt;token&gt;

the response will be:

{ "kind": "androidpublisher#productPurchase", 
"purchaseTimeMillis": long, 
"purchaseState": integer, 
"consumptionState": integer, 
"developerPayload": string, 
"orderId": string}
consumptionState - integer - The consumption state of the inapp product. Possible values are:
<ol>Yet to be consumed</ol> 
 

<ol>Consumed</ol>developerPayload - string - A developer-specified string that contains supplemental information about an order.
 
 

<ol>Purchased</ol> 

<ol>Cancelled</ol>purchaseTimeMillis - long - The time the product was purchased, in milliseconds since the epoch (Jan 1, 1970).
 
 
 



kind - string - This kind represents an inappPurchase object in the androidpublisher service.
orderId - string - The order id associated with the purchase of the inapp product.
purchaseState - integer - The purchase state of the order. Possible values are:

more details here: https://developers.google.com/android-publisher/api-ref/purchases/products
then depends on your business logic you can change your data.