The story
This name for such a machine is attested since 1889. The concept of such a machine is centuries older (for more, see Wikipedia at vending machine § History).
Etymology from Wiktionary, CC BY-SA 4.0.
Today it means: An automatic machine that dispenses merchandise (often food or beverages) in return for payment (originally coins; now also often paper money, credit cards, and wirelessly via digital payment apps). Full definition →
This name for such a machine is attested since 1889. The concept of such a machine is centuries older (for more, see Wikipedia at vending machine § History).
Etymology from Wiktionary, CC BY-SA 4.0.