Lantern
Liquid API

Overview

Access Lantern loyalty data in your Shopify themes using the Liquid templating language

Lantern stores all customer loyalty data as Shopify metafields and metaobjects, making it accessible through Shopify's Liquid templating language. This allows you to build custom loyalty experiences directly in your theme.

All data is automatically updated by Lantern and cached for optimal storefront performance.

Available Metafields

The following metafields are available for accessing Lantern data:

Customer Profile

FieldDescriptionExample Value
activity_feedRecent customer activity eventsLoyalty actions, purchases, referrals
birth_dateCustomer's birthday"1989-12-13"
is_testerTest account flagHide from analytics, enable debug features
propertiesCustom customer properties{"favorite_category": "electronics"}
walletAll available rewards & creditsActive discounts, gift cards, product rewards, store credit balances
wishlistCustomer's wishlist itemsArray of product variant GIDs

Loyalty Program

FieldDescriptionExample Value
loyalty_tierCurrent tier name"Gold"
loyalty_pointsAvailable points balance1250
loyalty_spendCurrent period spend249.99
is_eligibleCan participate in loyaltytrue
is_blockedBlocked from rewardsfalse

Referral Program

FieldDescriptionExample Value
referral_codeUnique referral code"6b577dd5288"
is_advocateHas referred otherstrue
is_referredJoined through referraltrue

Usage Example

All Lantern metafields are accessed through the customer.metafields object in Liquid. Most use the lantern namespace.

{% assign points = customer.metafields.lantern.loyalty_points %}
{% assign tier = customer.metafields.lantern.loyalty_tier %}

{% if points and tier %}
  <div class="loyalty-status">
    <h3>Welcome {{ tier | capitalize }} Member!</h3>
    <p>You have {{ points }} points available</p>
  </div>
{% endif %}

Authentication

Metafields are only available for logged-in customers. When a customer is not logged in, all metafields will return null or be undefined.

Learn more about accessing metafields in Liquid on Shopify.