I'm looking into building a game for android devices that players can log in on with their accounts from a website I host. I want the app to connect to update the player's account with information from the game, such as their high score. Is it possible to verify that the game was purchased, and if it was not, prevent the app from logging the data to the user's account? I don't mind so much if people pirate the game and play it unconnected, but I want to have the account benefits only for legitimate purchases. The game will be made in Unity3D, but I doubt that particularly matters.
If this is possible, some links in the right direction of where to look for info would also be appreciated.