A vending machine that rewarded die-hard fans

September

2026

What is it?

A vending machine that dispenses products based on how deep your history is with a merchant. Instead of tapping your card to pay, just sign in with Shop and scan your phone.

This post is a little more technical and dives into some of the challenges we faced while creating the experience. For more about our partnership with Hobbiesville and the overall event, check out this case study.

Why?

Our team gets to explore "the future of commerce." That could mean online, in store, or any other aspect of the customer experience.

As an exercise, we prototyped a number of fun in-store "delivery" mechanisms that add some flair to when a customer actually receives their goods at checkout. Think of your purchase falling down from the ceiling attached to a parachute or emerging on a conveyor belt behind the checkout.

Some of those delivery mechanisms started feeling like Rube Goldberg vending machines, so we stepped back and said, "Could we just power a vending machine entirely with Shopify?"

Hardware

There are vending machines for products of just about every size and shape you can imagine. We were mostly interested in a machine that would give us full control of the hardware and interface. We looked at traditional vending machines where you saw the product and watched it fall down, big machines, little machines, refrigerated machines, you name it.

Though ours was a very off-label use case, we found a Shopify merchant called VTMVending that distributes smaller, screen-based vending machines that seemed like a promising starting point.

Tower Machine
The 'Slim Tower' machine that we ultimately used

We had some theories about how we could integrate with the machine, but until it arrived, we weren't sure if we'd be able to integrate as fully as we wanted to. These machines were sold as part of a plug-and-play ecosystem, so they didn't really advertise any extensibility.

Through reading some docs, we knew that parts of the vending machine were driven by some device running Android. When we received the actual hardware, we were lucky to find that it was an Android SoC driving the vending motors via a simple serial protocol. That meant that, in theory, we would be able to write our own app that triggers the actual dispensing.

Machine Internals
Seeing how we can integrate with the motor driver (top green board) and Android SoC (bottom red board)

After some poking and prodding (more on that below), we were able to create a custom Android app that gave us full control of the vending mechanism and the screen.

Screenshot of the raw Android app
A screenshot of our barebones Android control app

Shopify Shines

Now that we had the ability to control the hardware at a low level, we needed two things: an interface for customers to use and a way to manage the machine's inventory. How about that? That's exactly what Shopify does!

Even though we're presenting it in a non-traditional way, the entire vending machine is driven by a standard Shopify setup.

Every product in the vending machine is a product in our Shopify admin; it just gets one extra metafield that says which physical "aisle" it lives in.

Products loaded in the coils
Test event showing different stickers in each 'aisle'

So, when a customer is supposed to receive product X, the machine looks at the metafield and knows to dispense from the proper aisle. These can be existing products that you happen to be allocating to the machine as well as to your other sales channels - no duplication!

Product metafield in the admin
The 'Shopify Sticker' being set to VendingMachineAisle 7

Additionally, we create a "vending machine" location in Shopify for the machine so that inventory can be allocated specifically to it. Again, all standard Shopify functionality so your existing workflows and reporting function as normal. The vending machine essentially just shows up as a new sales channel.

Location-specific inventory in the admin
Vending machine inventory

All of this allows us to fully manage inventory and availability of products in the vending machine via Shopify. Any time that we vend a product, we actually create an order for that product. That means that inventory is automatically updated and we know when the machine is out of stock.

Hydrogen Powered

In addition to managing inventory, we needed a way to create a user interface on the machine and allow customers to authenticate with Shop on their phone. We also needed to look up their order history to determine what reward tier they qualify for.

One Hydrogen storefront serves all of these purposes. It drives the on-machine UI and provides a spot for customers to land on their phone to sign in with Shop.

When you create a new Hydrogen storefront, it automatically comes with Sign in with Shop functionality and is connected to your store inventory, so we just had to create the two different views.

When customers go to our Hydrogen site, they land on a page that explains how everything works and has one call to action: "Sign in with Shop." After they tap that and sign in, they see a screen with a QR code on it and instructions to scan it at the vending machine. That QR code is their "ticket" and it securely lets the customer ID themselves to the vending machine.

Sign in with Shop
Sign in with Shop on our custom Hydrogen storefront

The vending machine loads the same Hydrogen site, but it gets a view that is the entire vending experience. In its idle state, it prompts a customer to scan their QR code. When it reads a scan it:

  1. Looks up the customer.
  2. Makes sure they haven't received their reward yet.
  3. Checks the customer's order history and decides what customer "tier" they belong to.
  4. Queries the store for what products are available in the machine for that customer tier.
  5. Chooses a product and creates a draft order for the customer and that product.

The machine then shows its reveal animation and vends the product. After we confirm that the product was successfully delivered (via a physical drop sensor) we convert the draft order into a real order and update the customer's record. This way, if the machine jams or fails somehow, the customer is still eligible and can try again.

Nerdy Stuff

The vending machine is a simple Android SoC from Rockchip that communicates with a motor driver via serial. That means that the machine is theoretically accessible, but the vendor we purchased it from sells their own management and control software. They didn't want people messing around with it. We wanted to mess around with it.

Since there was a pre-installed app from the vendor on the machine, we planned to just listen to the commands on the wire and decode the messages from the Android app to the motor driver. We were able to trace the connections and hook up a serial cable, and just as we started listening, we remembered our new AI buddies.

Multi-protocol serial cable
The multi-protocol serial cable we were about to spend a lot of time with

The existing vendor app already knows how to talk to the motor controller. Could we just grab it off the device, analyze it, and document the communication protocol? And by we, I mean Claude?

It turns out, we could. A few prompts later, Claude had fully documented the serial protocol and built a reference Android app that we could use.

Vending machine serial protocol
The serial protocol Claude documented for the motor controller

The Android app allowed us to easily communicate with the motor controller, but how could our Hydrogen (web) application talk to the Android app?

We created a webview in our Android app that allows us to load our Hydrogen site. We then created a "bridge" in our webview that allows the Hydrogen site to call something like window.vend(SLOT_ID) in order to pass a message back to the Android app.

Android side of the 'Vending Bridge'
Snippet of the 'Vending Bridge' code on the Android side

This way our Hydrogen site was free to do anything it wanted with the UI/UX, and it could call the lower-level machine vend calls anytime that it wanted.

There is actually a bit more back and forth than simply "Vend from aisle X" — the machine also has a "drop sensor" that fires after a vend when it detects that the item actually dropped. Our app and Hydrogen need to wait for that verification before actually completing the order. If we don't get that verification, we show an error message to the customer and notify support.

We use the same "bridge" functionality to send those messages from the Android app to the Hydrogen app.

Conclusions and Caveats

Yes, we can drive a vending machine entirely via Shopify. The same high-level objects and models that "normal" Shopify workflows are based on apply directly to our simple vending machine.

We took some educated guesses when purchasing the hardware that turned out well. That could have easily gone the other way — the machines could have been more locked down or inaccessible.

More traditional machines use MDB (multi-drop bus), which has a long history of being "creatively adapted." All of that is to say, there's no guarantee that your vending hardware will be as easy or even possible to integrate with.

Similarly, the way we are using our machine is completely unsupported and not endorsed by the vendor or manufacturer.

Technology Used

Further Reading