The first known vending machine was invented by the Greek engineer and mathematician Hero of Alexandria around 215 BC. These first vending machines were located in Egyptian temples and dispensed holy water in exchange for coins.
Gumball machine

The first known vending machine was invented by the Greek engineer and mathematician Hero of Alexandria around 215 BC. These first vending machines were located in Egyptian temples and dispensed holy water in exchange for coins.