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

> ## Agent Instructions
> For new direct REST integrations, use the v2026-04 surfaces. The @fluid-app FairShare SDK continues to use its own published public-v2025-06 contract.
> Authenticate with the header Authorization: Bearer <token>; public storefront read endpoints require no auth.
> To sign a new merchant up for Fluid programmatically, call POST https://api.fluid.app/api/company with no credentials, as described in /api/agent-signup. Do not automate the signup form or book a demo. The merchant must open the emailed sign-in link and create an API token before authenticated calls are possible.
> Lists use cursor pagination via the page[cursor] and page[limit] query params; follow meta.pagination.next_cursor until it is null.
> When the same operation exists on more than one surface, use the newest: dated API versions are newer than unversioned ones, and later dates win (v2026-04 > v2025-06 > unversioned v0/v1.1). Fall back to a legacy or unversioned operation only when no newer versioned equivalent exists — the company-v0 notes below list the known superseded operations. /api/company/v1 and /api/v1/... paths are documented in no spec here and must never be used (/api/v1.1/... is distinct and documented in company-v0). Use page/per_page offset pagination only where a spec documents it — in practice the unversioned company-v0 admin surface; every versioned surface uses cursor pagination.
> Navigation menu management is documented in themes/navigation-menus. These unversioned admin endpoints (/api/menus and nested menu_items) are verified against the implementation but are not yet in the synced OpenAPI specs. Use that reference for menu payloads and its flat page/per_page pagination; missing spec coverage does not make these endpoints unavailable.
> The OpenAPI specs under api-reference/ are the authoritative contracts; prefer them over prose when in doubt. api-reference/storefront-v2026-04.yaml covers the v2026-04 storefront surface (/api/v202604/... paths); api-reference/checkout-v2026-04.yaml covers the v2026-04 checkout surface (/api/checkout/v2026-04/... paths — carts, cart auth, discounts, items, subscriptions, orders, enrollments, and store config); api-reference/public-v2025-06.yaml covers the Public SDK surface used by the @fluid-app FairShare SDK, including its parallel cart lifecycle, browser integrations, versioned payment callbacks, unversioned public utilities, and the cart price-override operation; api-reference/payment-v2026-04.yaml covers the v2026-04 payment gateway admin surface (/api/payment/v2026-04/... paths, bearer-authenticated — gateway CRUD, gateway purchase/authorize/$0-verify, transaction list/show and capture/void/credit, and merchant payment configuration); api-reference/payments-v2026-04.yaml covers the v2026-04 cart payment surface (/api/payments/v2026-04/carts/{cart_token}/... paths, authenticated by the cart token in the path with no bearer — payment-method selection, VGS card tokenization, 3D Secure verification, and PayPal/Braintree/Klarna/Apple Pay flows); api-reference/commerce-v2026-04.yaml covers the v2026-04 commerce order-editing surface (/api/v202604/orders/{order_id}/edits paths, bearer-authenticated — post-checkout order edits that atomically insert items and add adjustments/discounts, with an optional dry-run preview); api-reference/webhooks-v0.yaml covers the unversioned webhooks surface (/api/... paths — webhook registration, delivery payloads, callback registrations, company events, and webhook/callback schemas); api-reference/company-v0.yaml covers the legacy unversioned company admin surface (/api/... paths, bearer-authenticated — company settings and management, customers, users, roles, subscription plans, subscription bundles, subscriptions, media, pages, catch-ups, inventory levels, domains, agreements, and admin order actions). company-v0 caveats: it is the legacy v0 admin contract and its lists use flat page/per_page offset pagination, which is expected there despite the general cursor-pagination rule; where an operation exists in both company-v0 and a versioned spec, prefer the versioned spec — the subscriptions lifecycle (list/create/show/update, cancel, pause, reactivate, resume, retry, skip, failed-cycle-waiver, discounts) and subscription bundles are superseded by checkout-v2026-04, and company pages/media CRUD plus the public pages, categories, products, and media list endpoints are superseded by storefront-v2026-04. Subscription plan management (/api/subscription_plans, resource-wrapped {"subscription_plan": {...}} bodies) exists only in company-v0. api-reference/members-v2025-06.yaml covers the v2025-06 unified Member identity surface (/api/v2025-06/members/... paths, bearer-authenticated — member list/create/show/update, lookup by email/username/external_id/legacy_customer_id, member-type assignment, and the sponsor genealogy read). Prefer it over the customers and reps surfaces when the member type matters: /customers does not serialize member_type. api-reference/analytics-v2026-04.yaml covers the v2026-04 Home dashboard analytics surface (/api/v202604/analytics/dashboard/... paths, bearer-authenticated — read-only endpoints for the Home > Overview, Home > Live, and Home > Field tabs, each accepting an optional country ISO alpha-2 query param that scopes aggregations to a single country).
> api-reference/analytics-v0.yaml covers the unversioned analytics surface that backs the fluid-admin Traffic tab (/api/analytics/... and /api/analytics/traffic/... paths, bearer-authenticated — the legacy shares/views/visitors summary plus traffic overview, ranked campaigns, sources, geographies, flows, and per-rep breakdown, all sharing one reporting-period contract).
> Successful responses wrap the resource payload alongside a top-level integer status and a meta object.
> Portal Definition authoring edits and synchronizes the portal JSON resource graph. Widget Package authoring builds either a company-owned or Droplet-owned Remote DOM package. These are separate contracts; do not imply that one defines the other.
> For Widget Package worker code, use only @fluid-app/portal-sdk/widgets/worker. Use only the Portal Definition and Widget Package workflows and public entry points documented here; do not infer support for undocumented surfaces.
> Every portal function and declarative capability used by a widget must appear in that widget's uses array. Use the same typed function value in uses; do not invent capability-name strings.
> Widget styling must use the portal's semantic theme variables for colors, typography, spacing, radii, borders, focus, and charts whenever a token represents the visual decision. Do not create a separate light or dark palette or duplicate theme controls as widget properties.
> Prefer worker-safe Fluid UI components exported by @fluid-app/portal-sdk/widgets/worker when they fit the interaction. When no exported component fits, use semantic HTML, accessible behavior, and the portal theme variables.
> A Portal Definition push updates the remote working definition. A portal version is an immutable snapshot, and activation is a separate live release operation.

# Metadata Definitions

> Create metafield definitions to add your own fields to products, variants, orders, customers and other records in the admin.

A metafield definition adds a custom field to one kind of record, such as products or orders. You set the field's name, identifier and data type on this screen, then fill in a value on each record. The admin calls these both metadata definitions and metafield definitions.

## Where to find it

In the admin, click the **Settings** gear in the top bar. In the Settings sidebar, under **Commerce**, select **Metadata Definitions**.

## Permissions you need

What you can do here depends on your role's access to **Company Settings** and **Developer**. To see these permissions, open the role on the [Roles](/help/admin/settings/roles) screen. On the **Permissions** tab, click the **Settings** card to open it, then click **Company Settings** or **Developer**.

* To open this screen and browse definitions, the role needs at least **View only** for both areas.
* To add, edit, pin or delete definitions, the role also needs the **Company Settings** permission that starts with **Edit company-wide settings** and the **Developer** permission that starts with **Manage webhooks and API configuration**.

<Note>
  The **Developer** permissions also let a role view API keys and manage webhooks.
</Note>

## Metadata categories

The **Metadata Definition Categories** card lists the kinds of records you can add fields to. Click a category to open its definitions:

* **Product Metadata**
* **Variant Metadata**
* **Orders Metadata**
* **Customers Metadata**
* **Pages Metadata**
* **Posts Metadata**
* **Media Metadata**
* **Enrollments Metadata**
* **Collections Metadata**
* **Categories Metadata**
* **Playlists Metadata**

## Definitions list

The category screen's header names the category, for example **Settings** › **Metadata** › **Product Metadata**. Click **Add Definition** to create a definition.

* The **All** and **Pinned** tabs filter the list. **Pinned** shows only pinned definitions.
* Use the **Search...** box to find a definition by its name, namespace, key or description.

The list has five columns: **Definition Name**, **Type**, **Namespace**, **Used In** and **Pinned**.

* **Type** shows the field's data type, for example **Single Line Text Field**.
* **Namespace** shows the definition's full identifier, its namespace and key joined by a dot, for example `custom.care_instructions`.
* In the **Pinned** column, click the pin icon to pin or unpin the definition.

Click a row to open the definition.

## The definition form

For a new definition, the form's title names the category, for example **New Product Metafield Definition**. For a saved definition, the title shows its name. To return to the list, click the back link above the title, for example **Product Definitions**.

* **Name**: the field's label, up to 100 characters.
* **Namespace and key**: two boxes that together make the definition's unique identifier. The screen shows the identifier under the boxes as `namespace.key`. You can't change them after you create the definition.
  * The namespace starts as `custom`. It can use letters, numbers and underscores, up to 20 characters.
  * The key fills in from **Name** as you type, for example "Care instructions" becomes `care_instructions`. It can use lowercase letters, numbers and underscores, up to 30 characters.
  * You can use each namespace and key pair only once for the same kind of record, for example once among your **Product Metadata** definitions.
* **Description**: optional text that explains what the field is for.
* **Select Type**: the field's data type. It starts as **Single Line Text Field**. When you pick a type, a box shows what the type holds and which validations it supports. You can't change the type after you create the definition. See [Field types](#field-types).
* **Validations**: rules for the field's values. The options depend on the type. See [Validations](#validations).

The form also has these settings:

* **Pinned**: turn this on to list the definition on the **Pinned** tab.
* **Locked**: turn this on to make the field read-only on records once it has a value. A locked field that has a value shows a lock icon, and you can't change or clear it in the admin.
* **Position**: a whole number, 1 by default.
* **Category Assignments**: product categories from your catalog, not the metadata categories above. Click **Select Categories** to open **Assign Categories**. Search your product categories, select the ones you want, then click **Done**.

## Field types

The **Select Type** list includes these types, grouped here for reference.

| Group | Types |
| - | - |
| Text | **Single Line Text Field** (up to 5,000 characters), **Multi Line Text Field** (up to 65,535 characters), **Rich Text Field** (text with HTML formatting) |
| Numbers | **Number Integer** (whole numbers), **Number Decimal**, **Rating** (a value on a scale) |
| Dates | **Date** (no time), **Date Time** (date and time with time zone) |
| Other values | **Boolean** (true or false), **Json** (structured JSON data), **Color** (hex colors such as `#RRGGBB`), **Url** (HTTP or HTTPS addresses) |
| Measurements and money | **Weight**, **Volume** and **Dimension** (a value and a unit), **Money** (an amount and a currency) |
| References | **File Reference** (an uploaded file), **Page Reference**, **Product Reference**, **Variant Reference**, **Collection Reference**, **Mixed Reference** (any kind of record) |

Many types also have a list version that holds several values. Its name starts with **List Of**, for example **List Of Single Line Text Field**. List versions exist for **Single Line Text Field**, **Number Integer**, **Number Decimal**, **Date**, **Date Time**, **Color**, **Url** and every reference type.

## Validations

The **Validations** section shows only the rules the selected type supports.

* **Minimum** and **Maximum**: for text types, these read **Minimum character count** and **Maximum character count**. For number types, they read **Minimum value** and **Maximum value**. Text, number, measurement, rating and money types support them.
* **Limit to preset choices**: turn this on, then enter options under **Preset choices**. Click **Add choice** for each extra option. While it's on, the form hides the **Minimum**, **Maximum** and **Regular expression** rules. **Single Line Text Field**, **Multi Line Text Field**, **Number Integer**, **Number Decimal**, **Color** and **Url** support it, and so do their list versions. Before you turn it on, clear any **Minimum**, **Maximum** or **Regular expression** values. Before you turn it off, clear every preset choice.
* **Regular expression**: a pattern that values must match. **Single Line Text Field**, **Multi Line Text Field** and **List Of Single Line Text Field** support it.
* **Maximum decimal places**: for **Number Decimal** and its list version.
* **Accept specific file types**: for file reference types. Select one or more of **Images**, **Videos**, **Documents** or **Accept all file types**.
* **Required JSON keys** and **Allowed JSON keys**: for **Json**. Click **Add key** for each extra key.

**Boolean**, **Page Reference**, **Product Reference**, **Variant Reference**, **Collection Reference** and **Mixed Reference** have no validations.

## Where fields show up

Each definition appears as a field in the **Metafields** card on the matching record's page in the admin, for example on a product, an order or a customer. On a variant's page, the card is called **Variant metafields**. Enter a value there to fill in the field for that record.

If you can edit the record, the card also has a **Manage Definitions** button. It opens that category's definitions on this screen.

## Add a definition

<Steps>
  <Step title="Open the category">
    On the **Metadata Definitions** screen, click the category you want to add a field to, for example **Product Metadata**.
  </Step>

  <Step title="Start a new definition">
    Click **Add Definition**.
  </Step>

  <Step title="Name the field">
    Enter a **Name** and, if you want, a **Description**. If you need a different namespace or key, change it after you finish the name.
  </Step>

  <Step title="Choose the type and validations">
    In **Select Type**, choose the data type before you set any **Validations**. If you change the type after you set validations, go back to the list and start the definition again. You can't change the type or validations after you create the definition.
  </Step>

  <Step title="Set the options">
    Set **Pinned**, **Locked**, **Position** and **Category Assignments** if you need them.
  </Step>

  <Step title="Create the definition">
    Click **Create Definition**. You return to the category's list, where the new definition appears.
  </Step>
</Steps>

## Edit a definition

<Steps>
  <Step title="Open the definition">
    In the category's list, click the definition.
  </Step>

  <Step title="Make your changes">
    Change **Name**, **Description**, **Pinned**, **Locked**, **Position** or **Category Assignments** as needed. If the definition has validations, **Validation Rules** shows them as read-only code under **Current rules**.
  </Step>

  <Step title="Save">
    Click **Save Changes**. The button reads **Saved** when there's nothing new to save.
  </Step>
</Steps>

## Delete a definition

<Steps>
  <Step title="Open the definition">
    In the category's list, click the definition.
  </Step>

  <Step title="Choose Delete">
    Click **Delete**.
  </Step>

  <Step title="Confirm">
    In the **Delete Metafield Definition?** dialog, click **Delete Definition**. You can't undo this.
  </Step>
</Steps>

## FAQ

<AccordionGroup>
  <Accordion title="How do I change a definition's type or key?" id="change-type-or-key">
    Create a new definition with the type, namespace and key you want.
  </Accordion>

  <Accordion title="Why won't my definition save?" id="definition-save-fails">
    Check for these common causes:

    * The key is longer than 30 characters, or the namespace is longer than 20. A long name can make a long key, so shorten the key.
    * Another definition for the same kind of record already uses the same namespace and key.
    * You changed **Select Type** after you set validations. Start again and choose the type first, as in [Add a definition](#add-a-definition).
    * Your role doesn't have the **Developer** permission that starts with **Manage webhooks and API configuration**. See [Permissions you need](#permissions-you-need).
  </Accordion>

  <Accordion title="Why did my key change?" id="key-changed">
    On a new definition, the key fills in again from **Name** each time you edit the name. Finish the name first, then change the key.
  </Accordion>

  <Accordion title="Why don't I see Add Definition?" id="no-add-definition-button">
    Your role doesn't have the **Company Settings** permission that starts with **Edit company-wide settings**. Without it, you can open definitions but can't change them. See [Permissions you need](#permissions-you-need) for what your role needs, and ask an admin who manages roles to update your role.
  </Accordion>

  <Accordion title="Why doesn't the screen show any categories?" id="categories-dont-load">
    If the **Metadata Definition Categories** card is empty, or you see **Failed to load metadata categories**, your role may not have access to **Developer**. See [Permissions you need](#permissions-you-need) for what your role needs, and ask an admin who manages roles to update your role.
  </Accordion>
</AccordionGroup>

## Related pages

* [Settings](/help/admin/settings)
* [Roles](/help/admin/settings/roles)
* [Theme variables](/themes/theme-variables): read product and variant metafields in a storefront theme.
