According to numerous sources (including the Jelly Belly Company) the jelly bean was founded in 1861 by Bostonian William Schrafft who encouraged people to send soldiers jelly beans during the Civil War. Schrafft was the founder of Schrafft's, a candy, chocolate, and cake company based in Charlestown.
In case you are interested in how jelly beans are made, the National Confectioners Association (NCA) explains the process:
The manufacturing process starts with the center of the jelly bean. Sugar, corn syrup and other ingredients are cooked in large boilers and then piped to the starch casting area. During this time, machines coat trays with a layer of cornstarch. Each tray has an impression the size and shape of the center of a jellybean. Mix is squirted onto the trays and dried overnight. Then the cornstarch layer is removed and the middles are put through a moisture steam bath and sprayed with sugar. They are set aside for 24 to 48 hours.
The panning process is where the jelly bean comes to life. The centers are placed in a rotating drum called an “engrossing pan.” While the center is rotating, sugar is added gradually to build the shell. Colors and flavors are added to get the distinct look and taste of the bean. Confectioner’s glaze is added to give the beans a shiny look. After the beans are “polished” (a process that can take two to four days) they are ready to be shipped.
Although Schrafft's no longer exists, its factory still stands in Sullivan Square and is used as an office building. Recognizable for its neon Schrafft's sign, the building will be renovatedin 2015.
In the early 1900's, Schrafft's expanded its business and opened restaurants in NYC. In 1968, Schrafft's commissioned a 60 second television commercial from Andy Warhol. Although no known copy exists; two people, Katrina Dixon and Brian L Frye, recreated the commercial to the best of their abilities on Thanksgiving Day, 2014.