Home

Shopify Shop Metafields

memberr uses Shopify shop metafields to store important configuration and settings. These metafields are accessible through the Shopify Admin API and Storefront API.

Accessing Shop Metafields

To access shop metafields in your Liquid templates, use the following code:


_10
{{ shop.metafields.app--60169453569--memberr_v2.FIELD_NAME }}

Organization Settings

These metafields store essential organization configuration data.

Organization ID


_10
{{ shop.metafields.app--60169453569--memberr_v2.organization_id }}

PropertyValue
Namespaceapp--60169453569--memberr_v2
Keyorganization_id
TypeText
AccessPublic Read
DescriptionUnique identifier for the organization in the memberr system

Organization Currency


_10
{{ shop.metafields.app--60169453569--memberr_v2.organization_currency }}

PropertyValue
Namespaceapp--60169453569--memberr_v2
Keyorganization_currency
TypeText
AccessPublic Read
DescriptionCurrency code used by the organization

Exchange Rate


_10
{{ shop.metafields.app--60169453569--memberr_v2.exchange_rate }}

PropertyValue
Namespaceapp--60169453569--memberr_v2
Keyexchange_rate
TypeMoney
AccessPublic Read
DescriptionExchange rate for currency conversion

Public Key


_10
{{ shop.metafields.app--60169453569--memberr_v2.public_key }}

PropertyValue
Namespaceapp--60169453569--memberr_v2
Keypublic_key
TypeText
AccessPublic Read
DescriptionPublic API key for memberr integration

Secret Key


_10
<!-- Not accessible in Liquid templates -->

PropertyValue
Namespaceapp--60169453569--memberr_v2
Keysecret_key
TypeText
AccessPrivate
DescriptionSecret API key for memberr integration (not accessible in storefront)

Access Levels

The metafields have different access levels depending on the context:

  • Public Read: Accessible in both Admin and Storefront APIs
  • Private: Only accessible through the Admin API
  • None: Not accessible

Best Practices

  1. Always check if metafields exist before accessing:

_10
{% if shop.metafields.app--60169453569--memberr_v2.organization_id %}
_10
<!-- Use organization ID -->
_10
{% endif %}

  1. Handle money values appropriately:

_10
{% if shop.metafields.app--60169453569--memberr_v2.exchange_rate %}
_10
{{ shop.metafields.app--60169453569--memberr_v2.exchange_rate.value | money }}
_10
{% endif %}

  1. Never expose or display the secret key in your templates
  2. Use appropriate error handling when accessing metafields that might not be set