Home

Shopify Integration Overview

memberr Shopify Shop Metafields

important: As of now monetary values are stored as integers. The follwoing table gives an overview on how to display them correctly and in which format:


_10
{% assign current_balance = 10000 %}
_10
{{ current_balance | money }}: $100.00
_10
{{ current_balance | money_with_currency }}: $100.00 USD
_10
{{ current_balance | money_without_currency }}: 100.00
_10
{{ current_balance | money_without_trailing_zeros }}: $10000

Customer Metafields:

Store Credit balance

current_balance -> $100.00


_10
{{ current_balance | money }}

Namespace: memberr-v1 Key: store_credit_balance Type: json


_10
{% assign balance = customer.metafields['memberr-v1'].store_credit_balance.value %}
_10
{% assign current_balance = balance.current | default: 0 %}
_10
{% assign upcoming_balance = balance.upcoming | default: 0 %}
_10
{% assign currency = balance.currency | default: 'USD' %}


_10
{
_10
"current": 10000,
_10
"upcoming": 0,
_10
"currency": "USD"
_10
}


_45
{
_45
version: 1,
_45
key: 'store_credit_balance',
_45
ownerId: customer_id,
_45
type: 'json',
_45
value: JSON.stringify({
_45
current: balance?.current_balance ?? 0,
_45
upcoming: balance?.upcoming_balance ?? 0,
_45
currency: balance?.currency_code ?? 'USD',
_45
}),
_45
},
_45
{
_45
version: 1,
_45
key: 'store_credit_transactions',
_45
ownerId: customer_id,
_45
type: 'json',
_45
value: JSON.stringify(transactions),
_45
},
_45
{
_45
version: 1,
_45
key: 'active_membership',
_45
ownerId: customer_id,
_45
type: 'json',
_45
value: JSON.stringify(activeMembership),
_45
},
_45
{
_45
version: 1,
_45
key: 'membership_history',
_45
ownerId: customer_id,
_45
type: 'json',
_45
value: JSON.stringify(membershipHistory),
_45
},
_45
_45
{
_45
"data": {
_45
"product": {
_45
"metafield": {
_45
"namespace": "instructions",
_45
"key": "wash",
_45
"value": "Machine wash cold.",
_45
"type": "single_line_text_field"
_45
}
_45
}
_45
}
_45
}

Shop Metafields

CategoryFieldDescription
membershipsmembership_idMemberships
membership_nameMembership ID
created_atMembership name
Created at
updated_atUpdated at
Free ShippingFree shipping for the referred customer.
Minimum order valueThe minimum order value for which the the referred customer must make a purchase for receiving the reward.
Only new customersWhether the referred customer must be a new customer.