Founder and owner Candace Nelson said her company rolled out the first high-tech vending machine this week, with three more in the works for New York City by the summer.

The ATM-like machine features a touchscreen and a robotic arm that pulls the right flavoured cupcake from a wall of single-serving boxes inside the store.

Nelson said the custom-built gadget is in response to demand for increased hours at the popular store.

"After dinner people want a cupcake. But we can’t be open all night long because of our poor employees. So we’ll just stock it fresh before they leave for the evening and it’ll be good to go," she said.

The machines will be restocked constantly throughout the day so the goods stay fresh.

Nelson said she was inspired to make the sugary treats available 24-7 when she realized that she couldn’t satisfy her own late-night cravings.

"I was pregnant with my second child and I thought, I’m the owner of a cupcake bakery and even I can’t get a cupcake in the middle of the night," she said.

Customers think the vending machines are a sweet idea. "You can never have too much access to your cupcakes," said Patrick Swope of Rogers, Ark., who was visiting the Sprinkles New York City shop with his family.

The machines charge $4 for a boxed cupcake. The same sweet sells for $3.25 in the store, with no box.