Skip to main content
Charlie writes safety-stock–adjusted inventory data to two metafield namespaces. Use the right one for your integration.

Which namespace to use

IntegrationNamespaceWhy
Themes (Liquid or Storefront API)app--{APP_ID}--inventoryVariant-level fields are only here
Product feeds (GMC, Meta, Lengow, etc.)charlie_inventoryPublic, same key on every store
Search & Discovery filterscharlie_inventorySmart collection conditions + admin filterable
Smart collectionscharlie_inventorySame as above
Admin API integrations (other apps)charlie_inventoryOther apps can’t read app-reserved namespaces

Finding your app namespace

The app--{APP_ID}--inventory namespace is unique per store. Find your app ID once and reuse it everywhere.
1

Open metafield definitions

Shopify Admin → Settings → Custom data → Metafields → Variants.
2

Open a Charlie metafield

Click any metafield with key inventory.available or inventory.fulfillable.
3

Copy the namespace

Copy the full namespace, e.g. app--303723511809--inventory.

app--{APP_ID}--inventory (app-reserved)

Use for themes. Includes variant-level fields.

Shop

KeyTypeValue
safety_stock_enabledbooleanMaster switch. true when safety stock is active for this shop

Variant

KeyTypeValue
availablebooleantrue if sellable quantity > 0 for this variant
fulfillablenumber_integerTotal sellable quantity across fulfillable locations

Product

KeyTypeValue
availablebooleantrue if any variant has sellable quantity > 0
fulfillablenumber_integerTotal fulfillable across all variants
first_available_variantvariant_referenceFirst variant with sellable quantity > 0

charlie_inventory (public)

Use for feeds, filters, smart collections, and any non-theme integration. Same namespace on every store. No app ID lookup needed. Themes can read either namespace. Other apps cannot read the app--{APP_ID}--inventory (app-reserved) namespace. That’s why Charlie mirrors product-level availability to a public namespace. Anything that runs as a Shopify app (Search & Discovery, product feed apps, smart collection metafield conditions, third-party search) can only see charlie_inventory.

Product

KeyTypeValue
availablebooleantrue if any variant has sellable quantity > 0
fulfillablenumber_integerTotal fulfillable across all variants
Variant-level fields are not mirrored to charlie_inventory. For variant-level data, use the app-reserved namespace.

Access

Liquid:
{% assign is_available = product.metafields.charlie_inventory.available.value %}
{% assign sellable = product.metafields.charlie_inventory.fulfillable.value %}
Storefront API:
query ($handle: String!) {
  product(handle: $handle) {
    available: metafield(namespace: "charlie_inventory", key: "available") { value }
    fulfillable: metafield(namespace: "charlie_inventory", key: "fulfillable") { value }
  }
}

Update timing

Charlie writes both namespaces whenever Shopify sends a products/update webhook (which fires on inventory changes). Updates are queued and applied within a few seconds, max ~10 seconds.

After uninstalling Charlie

Charlie does not delete charlie_inventory.* metafield values when uninstalled. The values stay on each product so you can export or migrate the data. To remove them, delete the metafield definitions manually in Shopify Admin → Settings → Custom data → Products (look for charlie_inventory.available and charlie_inventory.fulfillable).

Theme integration

Liquid recipes for variant pickers, badges, and price display

App integrations

Wire product feeds, search, and filter apps to respect safety stock

Safety Stock

How sellable inventory is calculated
Last modified on May 11, 2026