Verify and Acknowledge Android Purchases and Subscription
For Android, when a user initiates a transaction, it must be completed by first verifying then acknowledging the purchase. Once you've verified the purchase, your app is ready to grant the purchased item or subscription to the user. After granting entitlement, your app must then acknowledge the purchase. This acknowledgement communicates to Google Play that you have granted entitlement for the purchase and completes the transaction. If you fail to complete this acknowledgement step your subscriptions will revert in a period of 3 days from the time of purchase. The verification process can also be used to confirm that a users subscription status or purchase is still valid.
You must send a purchase/subscription to the appropriate endpoint to complete the transactions and verify the sale.
For this reason, we have simplified the process by creating 2 separate endpoints for Android. See how to find those below
Notice that the blocks are almost similar for these two. Thats because the response is handled the same way. We broke up the API calls in the code into "Subscription" and "One-Time Purchase" as they technically call different API's.


The Purchase or Subscription API Endpoint URLs
If you followed the directions for Android Subscriptions Code or Android Purchases Codes you will have a trigger URL.
Find the trigger URL by going to your function list and selecting the purchase or subscription function
Then click the trigger Tab and notice the included URL.

you will copy this url then go back into your Thunkable projects to the blocks page and create a new web api
Copy in the URL and add a header as shown in the image below

Note: in the above example, there are several references to "server logs." this is nothing more than saving data to firebase in order to see logs in a different manner. Error logging should occur during testing to allow for easier debugging.
Last updated
Was this helpful?