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.
To access shop metafields in your Liquid templates, use the following code:
_10{{ shop.metafields.app--60169453569--memberr_v2.FIELD_NAME }}
These metafields store essential organization configuration data.
_10{{ shop.metafields.app--60169453569--memberr_v2.organization_id }}
Property | Value |
---|
Namespace | app--60169453569--memberr_v2 |
Key | organization_id |
Type | Text |
Access | Public Read |
Description | Unique identifier for the organization in the memberr system |
_10{{ shop.metafields.app--60169453569--memberr_v2.organization_currency }}
Property | Value |
---|
Namespace | app--60169453569--memberr_v2 |
Key | organization_currency |
Type | Text |
Access | Public Read |
Description | Currency code used by the organization |
_10{{ shop.metafields.app--60169453569--memberr_v2.exchange_rate }}
Property | Value |
---|
Namespace | app--60169453569--memberr_v2 |
Key | exchange_rate |
Type | Money |
Access | Public Read |
Description | Exchange rate for currency conversion |
_10{{ shop.metafields.app--60169453569--memberr_v2.public_key }}
Property | Value |
---|
Namespace | app--60169453569--memberr_v2 |
Key | public_key |
Type | Text |
Access | Public Read |
Description | Public API key for memberr integration |
_10<!-- Not accessible in Liquid templates -->
Property | Value |
---|
Namespace | app--60169453569--memberr_v2 |
Key | secret_key |
Type | Text |
Access | Private |
Description | Secret API key for memberr integration (not accessible in storefront) |
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
- Always check if metafields exist before accessing:
_10{% if shop.metafields.app--60169453569--memberr_v2.organization_id %}
_10 <!-- Use organization ID -->
- 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 }}
- Never expose or display the secret key in your templates
- Use appropriate error handling when accessing metafields that might not be set