LoyaltyLionLoyaltyLionHelp center
Developer docs (opens in a new tab)Sign in
Contents

Metafields

The loyalty data we sync to Shopify customer metafields and tags, and how to use it in your theme

ShopifyAll plansUpdated Oct 20, 2026
On this page

What are metafields?

LoyaltyLion pushes customer properties to Shopify customer metafields when a customer changes. When a customer earns points or their tier changes, we update the metafields on that customer in Shopify.

LoyaltyLion fields

The following fields are pushed as Customer metafields, and the Loyalty Tier is also pushed as a customer tag.

Metafield nameTypeExampleDescription
loyaltylion.points_totalInteger1000Approved and pending points
loyaltylion.points_approvedInteger800Points approved
loyaltylion.points_pendingInteger200Points pending
loyaltylion.points_spentInteger1000Points spent
loyaltylion.points_lifetimeInteger2000Approved, pending and spent points
loyaltylion.rewards_claimedInteger5Number of rewards claimed
loyaltylion.rewards_usedInteger3Number of rewards used
loyaltylion.enroll_dateSingle line text2024-03-23T14:05:00.000ZDate and time the customer enrolled in your program (ISO 8601, UTC)
loyaltylion.referral_urlSingle line textReferral URL
loyaltylion.receipt_upload_urlSingle line texthttps://uploads.loyaltylion.net/47921/954250ad40ff42d1cc008962031ac93cReceipt upload URL
loyaltylion.loyalty_pass_urlSingle line textLoyalty pass URL
loyaltylion.loyalty_tierSingle line textSilverLoyalty Tier
loyaltylion.birthdaySingle line text1970-03-15T09:00:00+00:00Birthday, as a date and time in your store’s time zone (ISO 8601)
loyaltylion.blockedTrue or falseFalseCustomer is blocked

Tier Eligibility Fields

If your program has Loyalty Tiers, we will also push tier eligibility metafields as Customer metafields:

Metafield nameTypeExampleDescription
loyaltylion.tier_expiration_dateSingle line text2027-03-23When the customer's current tier ends
loyaltylion.tier_progress_valueDecimal800The customer's current progress toward maintaining or upgrading their tier
loyaltylion.tier_progress_value_at_expirationDecimal200The customer's projected progress when their current tier expires
loyaltylion.tier_progress_needed_for_renewalDecimal300How much more progress the customer needs to keep their current tier when it expires
loyaltylion.tier_progress_needed_for_upgradeDecimal500How much more progress the customer needs to reach the next tier
loyaltylion.tier_upgrade_tier_nameSingle line textGoldThe next tier the customer would reach if they upgrade
loyaltylion.tier_forecasted_tier_nameSingle line textSilverThe tier the customer is forecasted to be in when their current tier expires

The loyalty tier customer tag

Alongside the loyaltylion.loyalty_tier metafield, we add your customer's tier to their Shopify profile as a tag. The tag is written in the form tier: Tier name, so a customer in your Gold tier carries the tag tier: Gold.

We update the tag in real time as your customers move between tiers, and remove the old one, so each customer only ever carries the tag for the tier they are in. The first sync can take a couple of hours, depending on how many customers you have.

To find every customer in a tier, go to Customers in your Shopify admin, click Filter customers, select Tagged with, and enter the tag.

Steps for filling in the metafields

You will need to fill in the Customer metafields to show the customer's LoyaltyLion data in Shopify.

  1. Go to Settings in Shopify -> Custom data -> Customers and select View unstructured metafields

    Viewing unstructured customer metafields in Shopify

  2. After clicking Add definition for one of the LoyaltyLion fields :

    1. Add a Name

    2. Click Select Type, and select the correct type for the field as per the Type in LoyaltyLion fields section

      Selecting the metafield type

    3. Do not add any Validations

    4. Make sure the Storefronts access under Options is set to Read

    5. The metafield should then look like the below screenshot

      A correctly configured metafield definition

    6. Save the metafield

    7. Repeat these steps for each of the remaining LoyaltyLion unstructured metafields

Once saved, each metafield appears under Definitions.

Using metafields

Within Liquid templates

You can reference metafields in most Liquid templates like so:

{{ customer.metafields.loyaltylion.points_total }}

For example, to display the customer's unique referral link:

 referral url: {{ customer.metafields.loyaltylion.referral_url }} 

Things to be aware of: sync timing.

Although we generally sync metafields straight away, usually within a few minutes of a customer changing in LoyaltyLion, the sync can be delayed, particularly if many customers change at once, due to Shopify API rate limit restrictions.

If you're using metafields in an integration or in a template, you should account for their values being slightly out of date, or, in the case of new customers, blank.

If a customer has reported that their values look out of date, you can perform a singular sync for that specific customer, by going to their customer profile in your LoyaltyLion program, clicking Actions, and selecting Sync metafields

The Sync Metafields action on a customer profile

References

FAQ

Q. What's the difference between the loyalty tier metafield and the tier tag?

The loyaltylion.loyalty_tier metafield can be referenced in your Shopify theme.

The tier: tag appears on the customer profile in your Shopify admin, and you can filter customers by it. We sync both. You don’t need to choose between them.

Loyalty Tier metafield and customer tag settings

Was this helpful?

Related

Type at least two characters.