Yes, purchasing a thing at a store and resale it on Amazon is perfectly legal. There is no requirement for a permit or to be an authorized reseller. When you buy something, it becomes yours, and you can resell it if you want.