But vending machines have a much more humble origin. The first recorded history of a vending device dates back to first century Greece and the Alexandrian mathematician Hero, who reportedly invented a coin-operated device in 215 BC to sell holy water in Egyptian temples. It was a crude device that used a pan, counterweights, and levers to open and shut a water valve.

After that period, Hero’s idea of self-service merchandising seems to have been lost in the annals of history, until more than a dozen centuries later in England, when the first vending machines of modern history were used to sell postcards in the 1880s. English bookstore owner Richard Carlisle began selling books in a machine he invented during the same decade, and by 1888, tutti-frutti flavored gum was being sold in bulk candy vending machines on the New York City subway platforms by the Thomas Adams Gum Company.

Within a few short years, vending machines in the United States were selling a variety of items ranging from cigars to animated figures and postage stamps. The early 1920s saw several vending innovations, including machines that dispensed soft drinks into paper cups and the cigarette vending machine invented by American William Rowe.