Skip to main content
Many products come in more than one configuration: a shirt in several colors and sizes, a shoe in multiple widths, a phone in different storage tiers. Channel3 models these as variants, and exposes them on the variants field of a Product. The variant model follows the UCP catalog lookup specification: a product carries a set of options (the dimensions a shopper can choose, like Color and Size), each option has a set of values (Blue, Red, XL), and every value carries the two availability signals UCP defines — exists and available. The selected array reflects the effective selection after the server resolves your request.

The variant data model

Product.variants is either null (the product has no variations) or a Variants object:
These fields map directly onto a product page — each VariantOption renders as a selector row, selected marks the active configuration, and every value’s exists/available state styles its swatch or pill: How the variant fields map to a product page: each VariantOption renders as a selector row, SelectedOption reflects the active Color and Size, and each OptionValue's exists/available state styles its swatch or pill

Variants

VariantOption

OptionValue

SelectedOption

AvailabilityStatus

available is one of the following stock statuses:

Search vs. product detail

The same variants shape is returned by both endpoints, but available is only populated on product detail. This is the single most important difference to design around. Search is optimized for breadth — it returns the full option matrix so you can render selectors immediately, but it does not compute per-value stock. When you display a product for purchase, refetch it with GET /v1/products/{id} to get live available values (this call is free).
Python

Selecting a variant

To resolve a specific configuration, pass each chosen value to GET /v1/products/{id} as an option_<OptionName>=<Label> query parameter. The option name and label are taken verbatim from VariantOption.name and OptionValue.label.
cURL
The response reflects your selection in two places:
  • product fields (title, price, image, offers) update to the matching variant.
  • variants.selected echoes the effective selection.

Always read selected after relaxation

If the exact combination you requested doesn’t exist, the server relaxes your selection to the closest valid variant instead of returning nothing. Relaxation tries to satisfy the values you sent, but there is no guarantee every selection is honored — when a combination can’t be satisfied, some of your selections may be dropped to land on a real variant. Because the outcome isn’t guaranteed to match what you sent, detect what actually happened by diffing your request against variants.selected:
Python
Always render selectors from variants.selected, not from the values you sent — it’s the source of truth for what’s actually on screen. Some option values point at a separate product rather than reconfiguring the current one. These values have a non-null product_id (and usually a thumbnail_url). When a shopper picks one, navigate to that product ID instead of appending an option_* param:

available vs. exists

exists and available describe two different kinds of “not quite,” and they should look different in the UI. Conflating them misleads shoppers — one means “you can’t buy this,” the other means “I’ll adjust your other choices to make this work.” Render values in three emphasis tiers, from full strength to faintest:
  1. Purchasable (exists: true, in stock) — full emphasis. Solid border; the selected value gets a colored border and tint.
  2. Out of stock (exists: true, available is SoldOut / OutOfStock / Discontinued) — dimmed. It’s a real, offered variant you simply can’t buy right now, so a muted/strike-through treatment is the right signal. (available is only meaningful on product detail; it’s null from search.)
  3. Not offered with current selection (exists: false) — faintest of all. This does not mean the value is unavailable; it means this exact combination isn’t offered (e.g. you’ve selected Color: Forest Green and the green shirt was never made in XL). Make it the lightest element on screen — greyed text, muted fill, dashed border — so it clearly reads as “not a real option for what you’ve picked.” Crucially, keep it selectable: clicking it relaxes your other selections to land on a real variant.
The hierarchy matters: a non-existent value should look even lighter than an out-of-stock one, because it’s the weakest signal of the three — not “you can’t have this,” just “picking this will rearrange your other choices.” This mirrors hardware configurators like Apple’s, where incompatible options are greyed out with a placeholder yet remain clickable. Map each value to one of the tiers, then style from a lookup — no value is ever disabled:
Key conventions in this example:
  • Three tiers, never disabledvalueState collapses exists + available into one of four labels, and the PILL / SWATCH lookups give each tier its own weight. Every value stays clickable so server-side relaxation can do its job.
  • Faintest = not offeredborder-dashed + bg-muted/30 + text-muted-foreground/40 (and a placeholder) make non-existent values the lightest thing on screen, clearly weaker than the dimmed out-of-stock tier.
  • Swatches vs. pills — values with a thumbnail_url render as image swatches; everything else is a text pill. Driven entirely by thumbnail_url, so you never need to know the underlying option type.

Summary

  • Product.variants carries options (dimensions → values) and selected (the effective configuration).
  • Each OptionValue exposes exists (is this combination offered?) and available (is it in stock?) — design your UI around both.
  • available is only hydrated on GET /v1/products/{id}; it’s null on POST /v1/search.
  • Select a configuration with option_<Name>=<Label> query params on product detail; the server relaxes invalid combinations, so always trust variants.selected.
  • A value with product_id set points to a different product — navigate to it instead of re-resolving in place.
  • Render thumbnail_url values as swatches, others as pills; dim non-existent (exists: false) and out-of-stock values while keeping them clickable.