Visibility Fields

Visibility Fields

These fields control whether products and other documents appear in search results, category listings, and other views.

Overview

FieldTypeEffectApplied When
activebooleanHidden if falseAlways
hiddenbooleanHidden if trueAlways
hideOnListsbooleanHidden from lists if trueCategory/list requests
searchablebooleanHidden from search if falseSearch requests only
onstockbooleanHidden if falseWhen USE_STOCK enabled

Field Details

active

The primary visibility flag. Products with active: false are completely invisible in all contexts.

{
  "id": "product-123",
  "active": true
}

Use case: Disable products that are discontinued or not yet ready for sale.


hidden

Manual override to hide a product from all results, regardless of other settings.

{
  "id": "product-123",
  "hidden": true
}

Use case: Temporarily hide a product without deactivating it (e.g., during a price update).


hideOnLists

Hides products from category pages and listing views, but they remain findable via search.

{
  "id": "product-123",
  "hideOnLists": true
}

Use case: Products that should only be found through direct search (e.g., spare parts, accessories).


searchable

Controls visibility in search results only. Products with searchable: false won't appear in search but will appear in category listings.

{
  "id": "product-123",
  "searchable": false
}

Use case: Products that should be browsable but not searchable (e.g., gift cards in certain categories).


onstock

Stock availability filter. Only applied when the USE_STOCK constraint is enabled in the API request.

{
  "id": "product-123",
  "onstock": true
}

Use case: Hide out-of-stock products from results.

Visibility Logic Flow

Is active = true?
    └── No  → HIDDEN
    └── Yes → Is hidden = true?
                  └── Yes → HIDDEN
                  └── No  → Is this a list/category request?
                              └── Yes → Is hideOnLists = true?
                                          └── Yes → HIDDEN
                                          └── No  → VISIBLE
                              └── No (Search) → Is searchable = false?
                                                  └── Yes → HIDDEN
                                                  └── No  → VISIBLE

Stock Visibility

The onstock filter is only applied when:

  1. USE_STOCK constraint is enabled in the API request
  2. EVERYTHING constraint is NOT enabled

When USE_STOCK is active, products with onstock: false are filtered out.

Constraint Override

When EVERYTHING constraint is enabled in the API request, all visibility filters are bypassed. This is useful for admin views or debugging.

Group-Specific Overrides

All visibility fields support group-specific overrides:

{
  "id": "product-123",
  "active": true,
  "groups": {
    "wholesale": {
      "active": false
    },
    "retail": {
      "active": true
    }
  }
}

When a GROUP constraint is set, Makaira checks for group-specific values first.

See B2B / Customer Groups for more details.