The first clearly modern coinage was developed in ancient Greece in Lydia (nowadays in Turkey) in approximately the 7th century BCE. They were made from a mixture of gold and silver which was  called electrum found in the silt of the River Pactolus. They wouldn’t have fitted in a vending machine,  the coins were valued by weight not shape.

The Lydian coins are generally accepted as the first modern coinage in form and style and marked a big step forward in transportability, standardization and institutionalization. After coinage was invented in Lydia, it spread through the Greek city-states and later was  adopted by the Romans too.

Metal coinage became the dominant form of currency in Western economies  into the 18th or 19th century. Number of permutations and combinations was amazing, so in one manual published in Amsterdam in 1606 there were listed 341 silver and 505 gold coins.

Coinage had a lot of advantages but also brought some problems in usage.

Coin issuers constantly tried to reduce the quantity of valuable metals in coins – in that way they debased coins . On the other side users of coins were also tempted to shave or clip coins. In that way they managed to make small benefit from every coin, but in the end that was highly profitable practice.

Third problem was that changes in the prices of the underlying metals change the effective value of the coin relative to its initial value. In other word were not stable as unit of account over time and it wasn’t attractive for saving.