Liquid API
loyalty_spend
Access the current period spending amount for tier progression tracking.
Syntax
customer.metafields.lantern.loyalty_spendDescription
The loyalty_spend metafield contains the customer's spending amount for the current tier period. This value tracks spending toward tier advancement or maintenance and resets based on your loyalty program's tier period configuration (monthly, yearly, or lifetime).
Spend tracking periods vary by loyalty program configuration. Common periods include annual (January-December), rolling 12 months, or lifetime spending.
Properties
Type: Number
Namespace: lantern
Return Values
| Scenario | Value | Type |
|---|---|---|
| Logged in with spending | Spending amount (e.g., 450.50) | Number |
| Logged in without spending | 0 | Number |
| Not eligible for loyalty | null | null |
| Logged out | null | null |
Examples
Basic Spend Display
{% assign spend = customer.metafields.lantern.loyalty_spend %}
{% if spend != nil %}
<div class="loyalty-spending">
<h4>Period Spending</h4>
<span class="spend-amount">${{ spend | money_without_currency }}</span>
</div>
{% endif %}