Skip to main content

Ecommerce & Retail · Loyalty & Retention

E-commerce Loyalty Engine

A custom Shopify application that converts cash refunds into store credit and provides merchants with a dynamic rules engine.

E-commerce Loyalty Engine
Focus
SHOPIFY, CUSTOM-WEB-APP
Delivered
08 Mar 2024
Location
United Kingdom

Outcome

25% of cash refunds turned into store credit; rules the merchant edits without a developer.

The Vision & Challenge

For direct-to-consumer brands, customer acquisition is only half the equation. A successful UK-based e-commerce business operating on Shopify understood that long-term growth depended on retention. Standard loyalty applications on the market offered a rigid, one-size-fits-all approach that failed to meet their specific operational needs.

The company faced two primary points of friction. First, every product return resulted in a direct cash refund, representing both a financial loss and a missed opportunity to retain that customer. Second, their promotional campaigns were broad and untargeted, unable to reward specific buying behaviors or incentivize high-value customer segments effectively.

They required a system built around their business logic. We were engaged to design and build a custom loyalty application that integrated directly with their Shopify store. The objective was to create a platform that reduces cash outflow from returns, rewards nuanced customer behavior, and gives their marketing team precise control over the entire rewards lifecycle.

The challenge

  • Existing loyalty platforms lacked the flexibility to create complex, conditional rules for earning and redeeming points.
  • The standard refund process resulted in direct cash outflows and lost opportunities to retain customers who returned products.
  • A new system needed to process years of historical order data to accurately assign loyalty points to the existing customer base without manual entry.

How we solved it

  • We built a custom rules engine with a dedicated admin panel, allowing the merchant to define and modify reward logic without developer support.
  • An integration with Shopify's refund API was developed to intercept cash refunds, converting them into a store-credit prize pool that never expires.
  • We developed a data processing module to perform a one-time migration of historical purchase data, mapping past orders to the new points system.
The same returned-item value shown twice. Before, every refund left the business as cash, which is both a loss and a lost customer. After, the application intercepts Shopify’s refund process and converts the value into non-expiring store credit deposited in the customer’s prize pool, with cash refunds retained only where they are genuinely required. Alongside it, a merchant-facing rules engine lets the marketing team define how points are earned and which behaviours are rewarded without asking a developer.

Technologies

What we built it with

Front-end
  • JavaScript
  • ReactJS
  • HTML5
  • CSS3
Back-end
  • PHP
  • Laravel
DevOps
  • Linux
  • Docker
  • Github CI
Database
  • MySQL
Integrations
  • Shopify
Project screen

Merchant Rules Engine

The core of the application is a control panel that gives the client's marketing team direct control over the loyalty program. Merchants can set granular rules for how customers earn points, define specific triggers for rewards, and launch targeted promotions for product categories or customer segments. This removes the dependency on developers for campaign management, allowing the business to react quickly to market trends.

Refund to Credit Ledger

To reduce cash outflows, we designed a system that intercepts the standard Shopify refund process. When a return is processed, the monetary value is automatically converted into a non-expiring store credit and deposited into the customer's prize pool. This keeps revenue within the business and provides a strong incentive for customers to make another purchase, turning 25% of cash refunds into a future sale.

How we built it

Intercepted the refund, and made the reward rules editable by the merchant rather than by us. Every cash refund was a customer walking out with the money. The engine hooks Shopify's refund API and turns the refund into non-expiring store credit, which kept 25% of that cash inside the store. The points logic lives in a custom rules engine with its own admin panel, so the merchant changes how points are earned and redeemed without a developer. A one-off migration mapped years of historical orders onto the new points system, so existing customers started with the balance they had earned.

In the client's words

“A quarter of refunds now stay as credit. I change the rules myself, which I did not expect to be allowed to do.”

NDA - Signed

Have a project like this in mind?

Tell us what you're building. We'll show you how we'd approach it and what it would take to ship.