The purchase which you make within an app either it is in Google play itself is an in-app purchase. These in-app purchases are tracked by Google. Some of the apps can be installed on a new device but some are enabled after you purchase them.
For the restoration of any purchased app, just visit the Google play and re-install the app. If using your current Google account you have already purchased the app, you will be able to re-download it.
Consumable VS non-consumable purchases:
Google is tracking all the in-app purchases. When an in-app is purchased from the Google, it notes down that now you have owned the in-app purchase. Some of the purchases can be consumed by the app. When some app consumed all in-app purchases Google marks that in-app purchase as the un-owned.
A consumable in-app can be in the form of currency, lives, energy or any sort of credit which can be used by the app.
A non-consumable purchase cannot be consumed by the app. This can be in the form of unlocking the full version, removal of ads from an app or it can be in the form of some level which can be purchased and get played as many times as you can. Non-consumable can be in any form which can be accessed permanently.
How to restore non-consumable purchases:
All those in-app purchases which cannot be consumed have restoration capability. In the case you just restore your android device or purchased the new one, you can reinstall the app or can regain access to the in-app purchases.
All your in-app purchases are tied to your Google account. To restore, sign in using the same Google account you used to buy in-app purchases.
Next step is launching the app, you made the in-app purchases. Most of the app automatically check for the in-app purchases and restore them for you after querying the Google play.
This is somewhat different from the restoration of Apple iOS in-app purchases. In iOS, you have to restore the in-apps by clicking the buttons manually and using Apple Id and password. Apps can be restored automatically in the background, anytime without the need of a password.
How to restore consumable purchases:
Unlike the non-consumable in-app purchases, you may get in trouble while restoring consumable in-app purchases. Now, each of the consumable purchase is the ‘managed’ purchase as the Google will track down for you. The app will immediately tell the Google play that purchase is ‘consumed’ when the currency is given to you. If you have purchased an in-app and app is unable to provide you that purchase for some reason, this purchase can be automatically restored itself on a device which you are using.
For example, if some in-app is purchased in the form of currency, lives, coins that data cannot be stored by the Google Play but the app can track it itself. There is no guarantee that this data can be restored on the new device or the same device which you have restored.