# channels.json

The channels a merchant sells in, and the context keys requests may carry.

## `channels`

array of objects

A market or storefront with its locales, currency and assortment.

- `id` (string · required): A channel's id, such as `de` or `ch`: a market or storefront.

- `label` (string or map of strings): A plain value, or a map from locale to value such as \{ "de": "Farbe", "en": "Color" \}.

- `locales` (array of strings · required): The locales the channel serves; the first is its default.

- `currency` (string · required): An ISO 4217 currency code, such as `EUR`.

- `countries` (array of strings)

- `assortment` (object): An enforced filter on everything the channel shows, such as `{ "not": { "b2b_only": true } }`. Shoppers cannot remove it. A product is in the assortment when it has an offer in the channel and matches this selector.
  
  Picks entities (`where`). Attribute codes and the built-in fields `brand`, `price`, `on_sale`, `availability` and `delivery_days` are keys of the same object; `category` takes `is` or `within`.
  
  `{ "any": [{ "brand": "bosch" }, { "quality": "oe" }], "not": { "availability": "out_of_stock" } }`
  
  - `category` (object): The entity is in this category, or below it with `within`.
    
    A category, exactly or including everything below it.
    
    - `is` (string or array of strings): One value, or a list meaning any of them.
    
    - `within` (string or array of strings): One value, or a list meaning any of them.
  
  - `any` ([array of objects](#assortment) · at least 1 item): At least one of these holds.
  
  - `all` ([array of objects](#assortment) · at least 1 item): All of these hold; useful inside `any`.
  
  - `not` ([object](#assortment)): This does not hold.
  
  - `<key>` (boolean, number, string, array of (boolean, number or string) or object): A plain value (equal), a list (any of them), or an operator object such as \{ "lt": 20 \}.
    
    - `lt` (boolean, number or string): A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as `2026-10-01`.
    
    - `lte` (boolean, number or string): A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as `2026-10-01`.
    
    - `gt` (boolean, number or string): A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as `2026-10-01`.
    
    - `gte` (boolean, number or string): A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as `2026-10-01`.
    
    - `between` (array of (boolean, number or string) · 2 items): From the first value to the second, both included.
    
    - `exists` (boolean): True: the field has a value. False: it has none.

## `context`

map of arrays of strings

The context keys a request may carry and the values each allows, such as `{ "customer_group": ["b2c", "b2b"] }`. A key or value not declared here is a validation error, not a rule that never fires. Context never carries personal data.

## `$schema`

string

The JSON Schema an editor checks this file against; kept as written.

## Example

```json title="tests/fixtures/home/channels.json (trimmed)"
{
  "$schema": "../../../contracts/schema/channels.json",
  "channels": [
    {
      "id": "de",
      "label": { "de": "Deutschland", "en": "Germany" },
      "locales": ["de", "en"],
      "currency": "EUR",
      "countries": ["DE"]
    }
  ]
}
```

**Guide:** [Channels](/docs/channels)
