Loyalty
Cashback loyalty program with persistent coupon codes, tier unlock gifts, and Shopify-native checkout integration.
Overview
The Loyalty app turns repeat shoppers into ambassadors. Customers earn cashback on every purchase, climb through tiers as they spend, and unlock gifts at higher tiers — all without ever leaving your shop. Adverfly mints one persistent discount code per customer that tracks their live balance, so checkout is one click instead of a maze.
What's included
- Cashback Engine — Percentage-based cashback on every purchase, with per-product / per-category overrides.
- Persistent Customer Coupon — One Shopify discount code per customer; its value tracks the live balance via the Admin GraphQL API. No code rotation.
- Tier System — Bronze / Silver / Gold / Platinum (configurable). Each tier sets its own cashback multiplier and can grant a one-time gift.
- Tier Unlock Gifts — Automatic Shopify discount + storefront snippet that auto-adds the gift product to the cart.
- Custom Earn Webhooks — One webhook URL per earn rule. Plug TrustPilot / TrustedShops / Yotpo / Zapier / your own CRM into Adverfly's
webhooks/loyalty/earnendpoint. - Mails — Balance / after-earn / monthly summary templates with live editor preview.
- Customer Preferences — Public preferences page (no login) for subscription opt-in/out + birthday/locale.
- Storefront SDK —
window.adverfly.loyalty.*for custom widgets.
How it works
- Customer makes a purchase. Cashback accrues live (no row written — computed on the fly).
- On the first balance change, Adverfly mints a persistent Shopify discount code scoped to that customer. The code value = current balance.
- Customer goes to checkout, pastes the code → Shopify deducts their balance from the cart.
- Shopify fires the
orders/createwebhook → Adverfly debits the actual discount amount → PUTs the new value to Shopify. - Customer can use the same code again on the next checkout, with the updated value.
Tier gifts work in parallel: when a customer crosses a tier threshold, Adverfly creates an automatic Shopify discount (no code entry) for that customer + the gift product. The storefront snippet shows a "Claim" button in the cart drawer; one click adds the product, the discount fires at checkout, the line drops to €0.
Getting Started
- Open Loyalty from the sidebar
- Program Basics — set your default cashback rate (3–5% is typical) and currency
- Tiers — define your tier ladder + optional unlock gifts
- Custom Earn (optional) — wire signup / review / birthday webhooks
- Integration — copy the Liquid snippets into your Shopify theme; install the Shopify Order webhook
- Mails — review and customize the three lifecycle templates
Developer docs
- Loyalty API Overview — Architecture, data model, terminology
- Authentication — API keys, session tokens, webhook signing
- Public API Reference — REST endpoints
- Incoming Webhooks — Custom Earn + Shopify Order
- Shopify Setup — End-to-end wiring
- Data Model — All tables
- Loyalty SDK — Headless JS for custom storefronts