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

# Filter by Sales Channel

> Return only products published on specific Shopify sales channels, such as Point of Sale or a headless storefront.

By default, search returns products that are published to your **Online Store**. If you also sell through other Shopify sales channels, such as **Point of Sale (POS)** or a **headless** storefront, you can ask the search APIs to return only the products published on one of those channels instead.

This takes two steps: enable the channels in the app, then pass their ids on the API.

## 1. Enable the channels you want to filter by

#### Open Settings → Sales channels

In the Glood AI Search & Merchandising app, go to **Settings → Sales channels**. The section lists every sales channel installed on your store (Online Store, Point of Sale, Headless, Google & YouTube, and so on).

#### Select channels and save

Tick the channels you want to be able to filter by and click **Save**.

> [!NOTE]
>
> Saving a new selection re-indexes the publication ids of every product. This runs in the background and can take a few minutes on large catalogs. The **Jobs** page shows its progress. Requests that pass a publication id for a channel that is not enabled here are rejected with `400`.

## 2. Pass the publication ids on the API

Every search endpoint accepts an optional list of publication ids. The field is named in the same case as the rest of that API's fields:

| API | Endpoints | Field |
| - | - | - |
| Headless (snake\_case) | `init`, `config`, `instant-search`, `filters`, `filter-aggregations`, `search`, `image-search` | `publication_ids` |
| Theme storefront (camelCase) | The endpoints the storefront search widget calls, such as `/instant/results` | `publicationIds` |

A headless request that sends `publicationIds` is rejected with `400` (`"publicationIds" is not allowed`).

A publication id is the numeric part of a Shopify publication GID (`gid://shopify/Publication/30085840999` → `30085840999`). You can read it from the Shopify Admin GraphQL `publications` query, and POS and headless integrations can store it once per shop.

```json POST /api/storefront/v1/headless/search theme={null}
{
  "query": "running shoe",
  "locale": "en-US",
  "publication_ids": ["30085840999"]
}
```

```bash GET /api/storefront/instant/results (theme storefront) theme={null}
?q=running+shoe&locale=en-US&publicationIds=30085840999
```

A single id may be sent without the array wrapper. Up to 50 ids are accepted; a product matches if it is published on **any** of them.

## What the filter does

| Request | Products returned |
| - | - |
| No publication ids | Published to the Online Store (unchanged behaviour) |
| Publication ids present | Published on at least one of the given channels; the Online Store condition no longer applies |
| Publication ids with `market` | Both apply: on the channel **and** in the market's catalog |
| Id not enabled in Settings | `400` naming the field you sent, for example `publication_ids not configured for this shop: <id>` |

Facet counts, filter aggregations, trending products and the semantic search fallbacks all honour the same filter, on both the default host and Edge Delivery regions.

## Good to know

* The filter applies to **products**. Collections, pages and articles in instant search are not channel-filtered.
* Products published to a channel but **not** to the Online Store are not indexed yet, so a POS filter returns the products that are on both. Ask us if you need channel-only products indexed.
* Publishing or unpublishing a product on a channel in Shopify updates the index through the normal product webhooks; no re-save is needed in the app.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.