I need help on to clarify my mind about in app purchase googleplay.

i couldn’t really understand how the flow will work…

like for example.

i have 100 gems

i would like to buy a 50 gems.

so i have now 150 gems.

what/where/how should i make that whenever the i login with my googleplay acc. it will

automatically load the saved data on my account together with my 150 gems.

also. where should i store the data? like the gems,level,energy etc… i just want to know the flow and tips.