Carta della Cultura for Shopify

Home > Documentation > Carta della Cultura for Shopify > Managing App Settings via Shopify Metafields

Managing App Settings via Shopify Metafields

Managing App Settings via Shopify Metafields

All configuration for the ilGhera Carta della Cultura app is stored and managed using Shopify’s private app metafields. This system ensures your settings are securely saved within your Shopify store and are automatically synchronized across the app’s functions.

How Metafields Store Your Settings

The app uses a dedicated namespace within your shop’s metafields to save all configuration data. This includes:

  • Your uploaded certificate file and its password.
  • The app’s operational mode (Sandbox or Production).
  • The current billing subscription status (e.g., active, cancelled, expired).
  • Your premium license key and its expiration date.
  • The associated Shopify subscription charge ID.

When you install or configure the app, these values are written to your shop’s metafields. The app then reads from these metafields whenever it needs to validate a voucher, check your subscription status, or determine which API endpoint to use.

Viewing and Managing Your Metafields

As a merchant, you do not need to directly interact with these metafields. The app’s admin interface provides forms to manage all settings. However, the underlying data structure is as follows:

  • Namespace: carta_della_cultura
  • Key for Certificate Content: certificate_content (stores the .pem file as a base64-encoded string)
  • Key for Certificate Password: certificate_password
  • Key for Sandbox Mode: sandbox_mode (a boolean value)
  • Key for Billing Status: billing_status
  • Key for Premium License: premium_key

Note: These metafields are private and can only be accessed by the app itself. They are automatically removed by Shopify if you uninstall the app.

Automatic Updates via Webhooks

Your shop’s metafields are automatically updated in two key scenarios:

  • Subscription Changes: When your billing subscription status changes (e.g., from active to cancelled), Shopify sends a webhook to the app. The app processes this webhook and immediately updates the billing_status and expirationDate in your shop’s metafields to reflect the new state.
  • App Uninstallation: When you uninstall the app, Shopify triggers a GDPR redact webhook. The app is designed to store all data within Shopify metafields, so no external data cleanup is required. The metafields are automatically deleted by Shopify.

Data Persistence and Security

Using Shopify Metafields provides several benefits:

  • No External Database: Your sensitive certificate data and configuration are stored within your Shopify store’s ecosystem, not in a separate, external database.
  • Automatic Cleanup: If you uninstall the app, all related data is automatically removed by Shopify, ensuring compliance with data privacy regulations.
  • Direct Integration: Settings are instantly available to all parts of the app, including the checkout extension and order processing webhooks, without any delay.

Note: The certificate file you upload is converted to a base64 string before being saved to the certificate_content metafield. The original file is not stored on any external server.

Need more help?

Please open a support ticket using the links below.