Pace, persistence, and POS: inside the treadmill that pays
For NYC Marathon weekend 2025, Shopify partnered with running brand Endorphins to build something unusual: a manual treadmill that rewards runners with in-store credit. The catch? It wasn’t about speed. Runners had to hold a steady, self-selected pace to earn rewards.
The build brought together Bluetooth fitness sensors, a local Socket.IO network, and a custom Shopify POS UI extension. The result gave Endorphins an entirely new way to engage customers—and a working model for turning physical activity into a checkout-ready discount.
Designing for even ground
Endorphins is no small operation. With 25,000 global members, weekly runs in major cities, and drops that sell out fast, they’ve grown from a grassroots run club into a full lifestyle brand and training app. For the marathon weekend popup, they wanted an experience that stood apart from typical retail interactions.
The concept: participants choose their pace, then try to maintain it for 30 seconds on a manual treadmill. The longer they stay within a target “zone,” the more in-store credit they accrue. Because the treadmill is manual, runners must actively adjust their speed in response to real-time feedback—no motor doing the work for them.
At the end of each session, a receipt prints with a unique barcode. Scanning that barcode in Shopify POS applies the earned discount automatically, and if the runner isn’t already a customer, the system creates a new customer record with session metadata attached.
The design intentionally avoids rewarding raw speed. Endorphins wanted the challenge to be about consistency and self-awareness—qualities that map more naturally to marathon running than pure sprinting.
From motor to muscle
The team’s first prototype relied on a standard motorized treadmill and a Runn sensor, which tracks reflective strips on the belt and broadcasts Bluetooth FTMS data. A Python script listened for those events and relayed them for processing. It worked technically, but exposed a conceptual flaw: the treadmill was controlling the pace, not the runner.
The second prototype swapped in a TrueForm Trainer, a curved manual treadmill powered entirely by the runner’s stride. A series of rollers arranged in an arc let the belt respond instantly to changes in pace—exactly the behavior needed for the zone-checking game logic. The TrueForm also broadcasts FTMS data through its own display, keeping the software stack consistent with the first attempt.
The full hardware list included:
- Shopify POS terminal and iPad
- Epson TM-m30III Bluetooth receipt printer
- Three 4K TVs for audience-facing real-time data
- One MacBook Pro running the server, web app, and Python listener
- An ambassador-facing iPad for queue management, and another iPad attached to the treadmill so runners could monitor their own performance
Three software pieces, one local network
The software architecture splits cleanly into the treadmill server, a Remix web app, and the POS UI extension. Each ran on iOS tools where necessary, but the core loop stayed on a single MacBook Pro communicating over a local network.
Treadmill data relay
On the MacBook, a Python script paired with the treadmill received FTMS messages and pushed them to a Socket.IO server. Updating game state, rendering displays, and handling control-panel actions all happened in the Remix app running on the same machine.
The Remix app used an Express server with WebSocket handlers for events like treadmill_data. The parent route managed the socket events and shared state with child routes through Outlet context, so displays received speed and timer updates without rebuilding connections.
Earning credit by the millisecond
The core earning logic, implemented in a function called checkEarned, compared the runner’s real-time pace against a target with padding on either side. Stay in that zone for a second, and the credit accumulated. The team normalized FTMS message intervals because data arrives on an irregular schedule: instead of assuming steady ticks, they measured the time delta between the latest interval and the previous one, calculating credit as a fraction of that interval.
One sample calculation run showed a runner earning 1/30th of a $75 maximum per in-zone second—roughly $2.50 for every perfectly-held second.
Control panel workflow
The control panel managed a state machine: warm-up, active session, results, printing. An operator queued runners from a database, toggling state through a WebSocket event called state_update. They could also edit or discard sessions as needed.
When a session finished, the Remix route action handled creating both the customer record and a discount in the Shopify admin. Session metadata was stored on customer metafields, enabling Endorphins to build audience segments later. That discount code, tied to a user ID, was then passed to a <Receipt/> component that rendered output via the Epson ePOS JavaScript SDK for the receipt printer. The barcode on that receipt encodes the user ID for later scanning.
For printing, the team wrapped the printer connection in a React Context hook called usePrinter, making the printer object and its status available anywhere in the Remix app without repeated instantiation. The approach is printer-specific, but the pattern works with most receipt printers—or could swap entirely for a digitally-rendered QR code.
POS extension for instant redemption
At checkout, retail associates tap a custom “Pay with Pace” tile that opens a barcode scanner inside Shopify POS. Scanning the receipt barcode triggers a lookup that:
- Fetches the runner’s record by user ID from the database, including email and discount code
- Adds the customer to the cart
- Applies the discount code to the cart
The workflow is fast for the associate and updates customer records automatically, feeding Endorphins’ CRM with useful data from the event. A deliberate architectural decision was hosting the POS extension logic on the production server, separate from the treadmill’s local setup. That decoupling meant a treadmill debug session couldn’t interfere with checkout operations. The experience and the transaction stayed independent—like runners and pacers on the same track, each keeping their own lane.
Why it worked
The project wasn’t a serious bet on treadmill-based retail. It was an exercise in what Shopify calls unserious exploration — deliberately playing with technology that might seem too quirky or niche to ship, as a way to keep engineering curiosity alive. Partnering with Endorphins checked those boxes completely.
Under the hood, the setup combined a smart treadmill, a lightweight Remix application, and POS UI extensions. The resulting experience was memorable enough that it pulled in real results for the store: 63% of participants were new customers.
Patterns worth reusing
The more interesting takeaway is the platform flexibility. The same patterns used here could support entirely different experiences without much rework:
- Different hardware inputs — any sensor or trigger that can measure in-store activity
- New game modes or incentive structures
- Rewards mapped to exclusive products, gifts with purchase, or discounts
That’s the key insight: almost any measurable physical action in a store can be translated into a commerce reward. The treadmill was just one unusual instance of a much broader pattern.
The project was built for runners, for people chasing mastery, and for the builders willing to try something unconventional just to see what happens.



