The first known vending machine dates back to the 1st Century AD. It accepted a coin, then dispensed holy water.