---
title: "Run for your money: Engineering a treadmill that prints store credit"
description: "For the 2025 NYC marathon weekend, Shopify and Endorphins Running built a gamified treadmill that awarded in-store credit for maintaining a self-selected pace. Participants had 30 seconds to reach their target, then earned credit for each second spent within a defined pace zone, with a personalized barcode receipt redeemable through a Shopify POS UI extension. The implementation used a curved, motorless TrueForm Trainer, FTMS messages, a Python relay, Socket.IO, a local Remix application, receipt printing, and a production-hosted POS integration. Interval timestamps were normalized because treadmill messages arrived irregularly, while a state machine coordinated warm-up, gameplay, operator controls, database updates, discounts, and printing. The resulting experience attracted new customers, with 63% of participants identified as new customers, and its patterns could support other sensor-driven in-store incentives."
---

# Run for your money: Engineering a treadmill that prints store credit

[Shopify](https://yomu.fyi/company/shopify) · 2023-10-18 · Nov 25, 2025

**Type:** Problem & solution

## Summary

For the 2025 NYC marathon weekend, Shopify and Endorphins Running built a gamified treadmill that awarded in-store credit for maintaining a self-selected pace. Participants had 30 seconds to reach their target, then earned credit for each second spent within a defined pace zone, with a personalized barcode receipt redeemable through a Shopify POS UI extension. The implementation used a curved, motorless TrueForm Trainer, FTMS messages, a Python relay, Socket.IO, a local Remix application, receipt printing, and a production-hosted POS integration. Interval timestamps were normalized because treadmill messages arrived irregularly, while a state machine coordinated warm-up, gameplay, operator controls, database updates, discounts, and printing. The resulting experience attracted new customers, with 63% of participants identified as new customers, and its patterns could support other sensor-driven in-store incentives.

## Context

Endorphins wanted to create a new customer experience for NYC Marathon weekend rather than rely on regular retail. The experience also needed to provide an even playing field by rewarding consistency within each runner’s chosen pace instead of simply rewarding speed. The initial treadmill prototype produced uniform speed data without awareness of whether someone was actively controlling the belt.

## Approach / What changed

The team used a curved manual TrueForm Trainer, which responds directly to a runner’s effort, and connected its FTMS data to a Python script and Socket.IO-based Remix application. A pace zone converted normalized treadmill intervals into in-store credit. A control-panel state machine managed sessions, while an Epson receipt printer produced barcodes. A production-hosted Shopify POS UI extension scanned those barcodes, fetched the runner’s record and discount, and added the customer and discount to the cart.

## Takeaways

- A curved manual treadmill was chosen because its belt is powered by the runner and responds immediately to pace changes, unlike a motorized treadmill that maintains a set speed.
- The credit calculation defined a target pace with padding on either side, then normalized irregular FTMS message intervals so runners earned credit for the actual time spent in the zone.
- The POS UI extension used a receipt barcode containing the user ID to retrieve the discount, add the customer to the cart, and apply the discount; hosting it separately kept checkout independent from the treadmill system.

**Tags:** [Architecture](https://yomu.fyi/topic/architecture), [Deployment](https://yomu.fyi/topic/deployment), [Python](https://yomu.fyi/topic/python), [Reliability](https://yomu.fyi/topic/reliability)

- Source: [Shopify](https://shopify.engineering/how-we-built-a-gamified-treadmill)
- Source URL: https://shopify.engineering/how-we-built-a-gamified-treadmill
- Ingested by Yomu: 2026-08-30T13:18:48.692Z

[Read original post](https://shopify.engineering/how-we-built-a-gamified-treadmill)
