Liquid API
properties
Access custom customer properties and attributes stored on customer accounts.
Syntax
customer.metafields.lantern.propertiesDescription
The properties metafield contains custom customer properties and attributes collected through forms, surveys, or API calls. This is a JSON object where keys are property handles and values are the customer's responses.
The properties metafield contains JSON data that must be parsed using Liquid's parse_json filter before accessing individual properties.
Properties
Type: JSON Object
Namespace: lantern
Return Values
| Scenario | Value | Type |
|---|---|---|
| Customer has properties | Properties object | JSON Object |
| Customer has no properties | {} (empty object) | JSON Object |
| Logged out | null | null |
Object Structure
The properties object is a key-value store where each key represents a property handle:
Prop
Type
Examples
Basic Properties Display
{% assign properties_data = customer.metafields.lantern.properties %}
{% if properties_data %}
{% assign properties = properties_data | parse_json %}
{% if properties.birthday %}
<p>Birthday: {{ properties.birthday | date: '%B %d' }}</p>
{% endif %}
{% if properties.vip_status == 'true' %}
<span class="vip-badge">VIP Member</span>
{% endif %}
{% endif %}Check for Specific Property
{% assign properties_data = customer.metafields.lantern.properties %}
{% if properties_data %}
{% assign properties = properties_data | parse_json %}
{% if properties.favorite_category %}
<p>Favorite Category: {{ properties.favorite_category }}</p>
{% endif %}
{% endif %}