> ## Documentation Index
> Fetch the complete documentation index at: https://docs.supercycle.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Metafields

> The Shopify metafields Supercycle writes on products, variants, and customers, and how to read them in Liquid

Supercycle writes metafields to your Shopify products, variants, and customers so your theme can tell which methods a product offers, whether a variant has stock, and what a customer's membership allows. They all live in the `supercycle` namespace, and you can see their definitions under <Icon icon="shopify" iconType="solid" /> **[Custom data](https://admin.shopify.com/settings/custom_data)** in the Shopify admin.

<Note>
  Supercycle sets these metafields and overwrites them when it syncs. Don't edit them by hand.
</Note>

***

## Product metafields

Product metafields say whether a product is in Supercycle and how each of its methods is configured.

### Product configuration

<ResponseField name="supercycle.supercycle_enabled" type="boolean">
  Whether the product is in Supercycle. `true` once a product is imported, `false` when it's removed.
</ResponseField>

<ResponseField name="supercycle.total_uncommitted_inventory" type="integer">
  The total uncommitted inventory available across all variants.
</ResponseField>

### Method configuration

<ResponseField name="supercycle.methods" type="list.single_line_text_field">
  The methods turned on for the product, as an array of names: `["Calendar", "Membership", "Subscription", "Resale"]`. The app blocks read it to decide which methods to show.
</ResponseField>

<ResponseField name="supercycle.calendar_configuration" type="json">
  The calendar method's configuration, including its rental periods and fixed fees.
</ResponseField>

<ResponseField name="supercycle.membership_configuration" type="json">
  The membership method's configuration, including its credit costs.
</ResponseField>

<ResponseField name="supercycle.subscription_configuration" type="json">
  The subscription method's configuration, including its pricing groups.
</ResponseField>

<ResponseField name="supercycle.resale_configuration" type="json">
  The resale method's configuration.
</ResponseField>

***

## Variant metafields

Variant metafields track availability and membership pricing per variant.

### Inventory

<ResponseField name="supercycle.uncommitted_inventory" type="boolean">
  Whether the variant has inventory that isn't committed to an active rental. Used to filter collections by stock.
</ResponseField>

<ResponseField name="supercycle.uncommitted_inventory_count" type="number_integer">
  The number of items on the variant that are visible, so not hidden or retired, and not committed to an active rental.
</ResponseField>

<ResponseField name="supercycle.future_availability_inventory" type="boolean">
  Whether the variant has availability on future dates. Used by the calendar availability filter.
</ResponseField>

### Membership

<ResponseField name="supercycle.credit_cost" type="number_integer">
  The credit cost of the variant when it's rented on a membership.
</ResponseField>

<ResponseField name="supercycle.credit_allowance" type="number_integer">
  The credit allowance a membership plan variant grants.
</ResponseField>

***

## Customer metafields

Customer metafields carry membership status and payment information.

### Membership

<ResponseField name="supercycle.membership" type="json">
  The customer's membership information and quotas.
</ResponseField>

### Payment

<ResponseField name="supercycle.vaulted_payment_method" type="boolean">
  Whether the customer has a vaulted payment method. Used to validate the payment method in the cart.
</ResponseField>

***

## Read metafields in Liquid

Check which methods a product offers before rendering method-specific markup:

```liquid Check for a method theme={null}
{% if product.metafields.supercycle.methods contains "Calendar" %}
  {% comment %} The product can be rented for set dates {% endcomment %}
{% endif %}

{% if product.metafields.supercycle.methods contains "Membership" %}
  {% comment %} The product can be rented with membership credits {% endcomment %}
{% endif %}

{% if product.metafields.supercycle.methods contains "Subscription" %}
  {% comment %} The product can be rented on a subscription {% endcomment %}
{% endif %}

{% if product.metafields.supercycle.methods contains "Resale" %}
  {% comment %} The product can be bought {% endcomment %}
{% endif %}
```

Read a logged-in customer's membership to show membership-only content:

```liquid Check the customer's membership theme={null}
{% assign membership = customer.metafields.supercycle.membership.value %}
{% if membership.quotas.credits.allowance > 0 %}
  {% comment %} The customer has a credit allowance {% endcomment %}
{% endif %}
```

***

## Merchandising with metafields

Metafields also work as conditions in Shopify's [automatic collections](https://help.shopify.com/en/manual/products/collections/automated-collections). For example, a collection with the condition `supercycle.uncommitted_inventory` is true shows only products with an item available today.
