Since you are consuming in-app products from google play which is connected with your gmail account, then it's all about your google play account.
Here is a sample method to give you an idea about how it works. I use it in one of my applications.
/**
* Gets the list of available inventories in GooglePlay for this application
*
* @param productIdList list of product id's in the store
* if null, will return owned items only
* @param inventoryListListener OnQueryInventoryFinishedListener
*/
public void getInventoryList(List<String> productIdList, InvetoryListInterface inventoryListListener) {
final InvetoryListInterface listener = inventoryListListener;
inAppBillingHelper.queryInventoryAsync(productIdList, new QueryInventoryFinishedListener() {
@Override
public void onQueryInventoryFinished(IabResult result, Inventory inventroy) {
if (result.isFailure()) {
// Failure getting inventory list.
listener.onInventoryListFailure(result.getMessage());
return;
} else {
// Success getting inventory list.
listener.onInventoryListSuccess(inventroy);
}
}
});
}