A vending machine is an automated machine that provides items such as snacks, beverages, alcohol, cigarettes and lottery tickets to consumers after money, a credit card, or specially designed card is inserted into the machine. The first modern vending machines were developed in England in the early 1880s and dispensed postcards. Vending machines exist in many countries, and in more recent times, specialized vending machines that provide less common products compared to traditional vending machine items have been created and provided to consumers.
The earliest known reference to a vending machine is in the work of Hero of Alexandria, an engineer and mathematician in first-century Roman Egypt. His machine accepted a coin and then dispensed holy water. When the coin was deposited, it fell upon a pan attached to a lever. The lever opened a valve which let some water flow out. The pan continued to tilt with the weight of the coin until it fell off, at which point a counterweight snapped the lever up and turned off the valve.
Coin-operated machines that dispensed tobacco were being operated as early as 1615 in the taverns of England. The machines were portable and made of brass. An English bookseller, Richard Carlile, devised a newspaper dispensing machine for the dissemination of banned works in 1822. Simeon Denham was awarded British Patent no. 706 for his stamp dispensing machine in 1867, the first fully automatic vending machine.
The first modern coin-operated vending machines were introduced in London, England in the early 1880s, dispensing postcards. The machine was invented by Percival Everitt in 1883 and soon became a widespread feature at railway stations and post offices, dispensing envelopes, postcards, and notepaper. The Sweetmeat Automatic Delivery Company was founded in 1887 in England as the first company to deal primarily with the installation and maintenance of vending machines. In 1893, Stollwerck, a German chocolate manufacturer, was selling its chocolate in 15,000 vending machines. It set up separate companies in various territories to manufacture vending machines to sell not just chocolate, but cigarettes, matches, chewing gum and soap products.
The first vending machine in the U.S. was built in 1888 by the Thomas Adams Gum Company, selling gum on New York City train platforms. The idea of adding games to these machines as a further incentive to buy came in 1897 when the Pulver Manufacturing Company added small figures, which would move around whenever somebody bought some gum from their machines. This idea spawned a whole new type of mechanical device known as the "trade stimulators".
After payment has been tendered, a product may become available by:
Some products need to be prepared to become available. For example, tickets are printed or magnetized on the spot, and coffee is freshly concocted. One of the most common form of vending machine, the snack machine, often uses a metal coil which when ordered rotates to release the product.
The main example of a vending machine giving access to all merchandise after paying for one item is a newspaper vending machine (also called vending box) found mainly in the U.S. and Canada. It contains a pile of identical newspapers. After a sale the door automatically returns to a locked position. A customer could open the box and take all of the newspapers or, for the benefit of other customers, leave all of the newspapers outside of the box, slowly return the door to an unlatched position, or block the door from fully closing, each of which are frequently discouraged, sometimes by a security clamp. The success of such machines is predicated on the assumption that the customer will be honest (hence the nickname "honor box"), and need only one copy.
An entirely mechanical coin operated vending machine at a hotel
Filling and servicing a vending machine
A change machine is a vending machine that accepts large denominations of currency and returns an equal amount of currency in smaller bills or coins. Typically these machines are used to provide coins in exchange for paper currency, in which case they are also often known as bill changers.
In the past, cigarettes were commonly sold in the United States through these machines, but this is increasingly rare due to concerns about underage buyers. Sometimes a pass has to be inserted in the machine to prove one's age before a purchase can be made. In the United Kingdom, legislation banning them outright came into effect on 1 October 2011. In Germany, Austria, Italy, Czech Republic and Japan, cigarette machines are still common.
Since 2007, however, age verification has been mandatory in Germany and Italy - buyers must be 18 or over. The various machines installed in pubs and cafés, other publicly accessible buildings and on the street accept one or more of the following as proof of age: the buyer's identity card, bank debit card (smart card) or European Union driver's license. In Japan, age verification has been mandatory since 1 July 2008 via the Taspo card, issued only to persons aged 20 or over. The Taspo card uses RFID, stores monetary value, and is contactless.
A birth control machine is a vending machine for the sale of birth control, such as condoms or emergency contraception. Condom machines are often placed in public toilets, subway stations, airports or schools as a public health measure to promote safe sex. Many pharmacies also keep one outside, for after-hours access. Rare examples exist that dispense female condoms or the morning after pill.
Various types of food and snack vending machines exist in the world. Food vending machines that provide shelf-stable foods such as chips, cookies, cakes and other such snacks are common. Some food vending machines are refrigerated or frozen, such as for chilled soft drinks and ice cream treats, and some machines provide hot food. Some unique food vending machines exist that are specialized and less common, such as the French fry vending machine and hot pizza vending machines, such as Let's Pizza.
The profit margins in the bulk candy business can be quite high – gumballs, for instance, can be purchased in bulk for around 2 cents per piece and sold for 25 cents in gumball machines in the U.S., and other countries. Gumballs and candy have a relatively long shelf life, enabling vending machine operators to manage many machines without too much time or cost involved. In addition, the machines are typically inexpensive compared to soft drink or snack machines, which often require power and sometimes refrigeration to work. Many operators donate a percentage of the profits to charity so that locations will allow them to place the machines for free.
Bulk vending may be a more practical choice than soft drink/snack vending for an individual who also works a full-time job, since the restaurants, retail stores, and other locations suitable for bulk vending may be more likely to be open during the evening and on weekends than venues such as offices that host soft drink and snack machines.
The Bulk vending Machines of today provide many different vending choices with the use of adjustable gumball and candy wheels. Adjustable gumball wheels allow an operator to not only offer the traditional 1-inch gumball, but they can also vend toy capsules, bouncy balls and larger gumballs. Adjustable candy wheels on the other hand allow an operator to offer a variety of pressed candies, jelly candy, and even nuts. 
A full-line vending company may set up several types of vending machines that sell a wide range of products. Products may include candy, cookies, chips, fresh fruit, milk, cold food, coffee and other hot drinks, bottles, cans of soda, and even frozen products like ice cream. These products can be sold from machines that include hot coffee, snack, cold food, 20-oz. bottle machines, and glass-front bottle machines. In the United States, almost all machines accept bills with more and more machines accepting $5 bills. This is an advantage to the vendor because it virtually eliminates the need for a bill changer. Larger corporations with cafeterias will often request full line vending with food service.
A newspaper vending machine or newspaper rack is a vending machine designed to distribute newspapers. Newspaper vending machines are used worldwide, and they can be one of the main distribution methods for newspaper publishers. According to the Newspaper Association of America, in recent times in the United States, circulation via newspaper vending machines has dropped significantly: in 1996, around 46% of single-sale newspapers were sold in newspaper boxes, and in 2014, only 20% of newspapers were sold in the boxes.
A photo booth is a vending machine or modern kiosk that contains an automated, usually coin-operated, camera and film processor. Today, the vast majority of photo booths are digital. Traditionally, photo booths contain a seat or bench designed to seat the one or two patrons being photographed. The seat is typically surrounded by a curtain of some sort to allow for some privacy and help avoid outside interference during the photo session. Once the payment is made, the photo booth will take a series of photographs and the customer is then provided with prints. Older photo booth vending machines used film and involved the process of developing the film using liquid chemicals.
A stamp vending machine is a mechanical, electrical or electro-mechanical device which can be used to automatically vend postage stamps to users in exchange for a pre-determined amount of money, normally in coin.
A ticket machine is a vending machine that produces tickets. For instance, ticket machines dispense train tickets at railway stations, transit tickets at metro stations and tram tickets at some tram stops and in some trams. The typical transaction consists of a user using the display interface to select the type and quantity of tickets and then choosing a payment method of either cash, credit/debit card or smartcard. The ticket or tickets are then printed and dispensed to the user.
From 2000-2010, the specialization of vending machines became more common. Vending extended increasingly into non-traditional areas like electronics, or even artwork or short stories. Machines of this new category are generally called Automated retail kiosks. When using an automated retail machine, consumers select products, sometimes using a touchscreen interface, pay for purchases using a credit or debit card and then the product is dispensed, sometimes via an internal robotic arm in the machine. The trend of specialization and proliferation of vending machines is perhaps most apparent in Japan where vending machines sell products from toilet paper to hot meals and pornography, and there is 1 vending machine per 23 people.
Book vending machines dispense books, which may be full-sized. Some libraries use book vending machines. GoLibrary is a book lending vending machine used by libraries in Sweden and the U.S. state of California.
A French fry vending machine is a vending machine that dispenses hot French fries, also known as chips. The first known french fry vending machine was developed circa 1982 by the defunct Precision Fry Foods Pty Ltd. in Australia. A few companies have developed and manufactured French fry vending machines and prototypes. Furthermore, a prototype machine was also developed at Wageningen University in the Netherlands.
Let's Pizza is the name of a vending machine that makes fresh pizza from scratch. It was developed in 2009 by Italian company Sitos srl. The machine combines water, flour, tomato sauce, and fresh ingredients to make a pizza in approximately three minutes. It includes windows so customers can watch the pizza as it is made. The pizza is cooked in an infrared oven. The device was invented by Claudio Torghele, an entrepreneur in Rovereto, Italy. The vending machine began in Italy and is now spreading into the United Kingdom and becoming popular there.
From the 1950s until the 1970s, vending machines were used at American airports to sell life insurance policies covering death, in the event that the buyer's flight crashed. However, this practice gradually disappeared due to the tendency of American courts to strictly construe such policies against their sellers, such as the Fidelity and Casualty Company of New York (which later became part of CNA Financial).
A marijuana vending machine is a vending machine for selling or dispensing cannabis. As of the 2010s, they are in use in the United States and Canada.. The primary challenge faced in selling restricted or controlled merchandise like cannabis is to verify the identity of the user in front of the vending machine making the purchase, which is overcome by the application of biometrics and smart vending software technology.
The Mold-A-Rama is a brand name for a type of vending machine that makes blow-molded plastic figurines. Mold-A-Rama machines debuted in late 1962  and grew in prominence at the 1964 New York World's Fair. The machines can still be found operating in dozens of museums and zoos.
With the rise of the social networks, vending machine has been integrated to social media in order to proliferate the interaction of the vending machine with the users from the physical machine to the social networks. The common application of social-networked vending machine is that the user can connect his/her social account to a specific social media designated by the vending machine, the user will be getting some rewards in return, normally in the form of free gift dispensed from the vending machine.
Vending machines are a common sight in Japan. There are more than 5.5 million throughout the nation. It is the highest ratio for any country with one machine for every twenty-three people.
Apparently similar to the development of traditional mobile phones into smartphones, vending machines have also progressively, though at a much slower pace, evolved into smart vending machines. Newer technologies at a lower cost of adoption, such as the large digital touch display, internet connectivity, cameras and various types of sensors, more cost-effective embedded computing power, digital signage, various advanced payment systems, and a wide range of identification technology (NFC, RFID, etc) have contributed to this development. These smart vending machines enable a more interactive user experience, and reduce operating costs while improving the efficiency of the vending operations through remote manageability and intelligent back-end analytic. Integrated sensors and cameras also represent a source of such data as customer demographics, purchase trends, and other locality-specific information. It also enables better customer-engagement for the brands through interactive multimedia and social media connectivity. Smart vending machines were #79 by JWT Intelligence on its list of 100 Things to Watch in 2014. According to market research by Frost & Sullivan, global shipments of smart vending machines are forecasted to reach around 2 million units by 2018, and further to 3.6 million units by 2020 with penetration rate of 20.3 percent.