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

# App integrations

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

Third-party apps (product feeds, search, filters) read Shopify's native availability by default. That ignores safety stock, so products held back appear "in stock" to shoppers. Point each app at the `charlie_inventory.available` metafield instead.

<Info>
  Reference: [`charlie_inventory.available`](/inventory/metafields-reference#charlie_inventory-public) (Product, Boolean, public namespace, same key on every store).
</Info>

## Generic recipe

Every supported app exposes some form of attribute mapping. Find it and override it.

<Steps>
  <Step title="Open the app's product attribute mapping">
    Look for the rule that sets `availability`, `stock`, or `in_stock`.
  </Step>

  <Step title="Switch the source">
    Change the source from Shopify's native `product.available` (or `inventory_quantity`) to the product metafield `charlie_inventory.available` (Boolean).
  </Step>

  <Step title="Map the values">
    | Metafield value | Feed/filter value |
    | --------------- | ----------------- |
    | `true`          | `in stock`        |
    | `false`         | `out of stock`    |
  </Step>

  <Step title="Re-sync">
    Trigger a full re-sync so existing entries pick up the new mapping.
  </Step>
</Steps>

<Warning>
  If the app filters products before mapping (e.g. "only sync available products"), update that filter too. Otherwise products held back by safety stock leak through with stale availability.
</Warning>

## Product feeds

Use a feed app or feed manager that supports sourcing the `availability` attribute from a custom product metafield, then apply the [generic recipe](#generic-recipe) with `charlie_inventory.available` as the source.

### Recommended app

[Multiple Google Shopping Feeds (Multifeed)](https://apps.shopify.com/multiple-google-shopping-feeds) supports Google, Meta (Facebook & Instagram), Bing, Pinterest, Bol, and custom feeds, with metafield-based attribute mapping. One app covers most needs.

### Other feed apps and managers

The same recipe applies to any feed app or external feed manager (Simprosys, Flexify, Lengow, etc.) that exposes a custom product metafield as a source for `availability`. If an app doesn't expose that option, it can't reflect safety stock. Switch to one that does.

## Storefront search and filters

### Shopify Search & Discovery

Replace the native **Availability** filter with a custom metafield filter.

<Steps>
  <Step title="Open the Search & Discovery app">
    Open the Search & Discovery app from the Shopify Admin and go to its **Filters** section.
  </Step>

  <Step title="Add a metafield filter">
    Add a new filter sourced from the product metafield `charlie_inventory.available` (True or false).
  </Step>

  <Step title="Set the label">
    Display label: **In stock** (or your preference).
  </Step>

  <Step title="Remove the native filter">
    Remove the standard **Availability** filter so shoppers don't see two.
  </Step>

  <Step title="Save">
    Save. Applies to all collection pages immediately.
  </Step>
</Steps>

<Note>
  `charlie_inventory.available` is product-level only. If you need variant-level "in stock" filtering, check whether your search app supports variant metafield filters. Search & Discovery currently doesn't.
</Note>

#### URL parameter change

The URL parameter changes when you swap filters:

| Filter                        | URL parameter                               |
| ----------------------------- | ------------------------------------------- |
| Native Availability           | `?filter.v.availability=1`                  |
| `charlie_inventory.available` | `?filter.p.m.charlie_inventory.available=1` |

This affects existing links: paid ads, email campaigns, indexed search results, social posts. Links using the old parameter will silently no-op once the native filter is removed.

#### Redirect old links (optional)

Add a synchronous script at the very top of `<head>` in `layout/theme.liquid` to rewrite old URLs before paint. No flash, no extra back-button entry.

```liquid theme={"system"}
<script>
  (function () {
    var u = new URL(location.href);
    if (u.searchParams.has('filter.v.availability')) {
      var v = u.searchParams.get('filter.v.availability');
      u.searchParams.delete('filter.v.availability');
      u.searchParams.set('filter.p.m.charlie_inventory.available', v);
      location.replace(u.toString());
    }
  })();
</script>
```

Place this **before** any CSS or content tags so the redirect fires before the browser renders anything.

### Third-party search apps

For other search/merchandising apps (Boost, Searchanise, etc.), apply the same idea in the app's filter or facet configuration:

1. Add a filter sourced from the product metafield `charlie_inventory.available`
2. Label it **In stock**
3. Disable the native availability facet
4. Re-index if the app requires it

Exact menu paths vary by app. Check the app's documentation for how to expose a product metafield as a filter.

## Smart collections

The same metafield works as a smart collection condition. Create a smart collection and add a condition matching the product metafield `charlie_inventory.available` equal to `true`.

## Verifying

After configuring any of the above, pick at least one product currently held back by safety stock and confirm:

* Feed exports show it as **out of stock**
* Collection filter excludes it when "In stock" is selected
* Smart collection excludes it

The Shopify product page may still show "available" via native fields. That's expected. The integration reads the metafield, not the native field.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Metafield doesn't appear in Search & Discovery filter list">
    Search & Discovery only surfaces metafields that have been written at least once. Trigger an inventory update on any product, then refresh the Search & Discovery filter screen.
  </Accordion>

  <Accordion title="Feed still shows products as in stock after safety stock is applied">
    1. Confirm the feed app actually reads `charlie_inventory.available`, not Shopify's native `product.available`. Check the attribute mapping.
    2. Trigger a full re-sync in the feed app. Partial syncs may not pick up the new attribute source.
    3. Spot-check the product in **Shopify Admin → Products → \[Product] → Metafields** and confirm `charlie_inventory.available` is `false` for products held back.
  </Accordion>
</AccordionGroup>

## Related

<CardGroup cols={2}>
  <Card title="Metafields reference" icon="tag" href="/inventory/metafields-reference">
    All Charlie metafields and access methods
  </Card>

  <Card title="Theme integration" icon="palette" href="/inventory/theme-integration">
    Display sellable inventory in your theme's Liquid
  </Card>
</CardGroup>
