Skip to content

Latest commit

 

History

History
67 lines (52 loc) · 4.34 KB

catalog-query.md

File metadata and controls

67 lines (52 loc) · 4.34 KB

Catalog Query

A query composed of one or more different types of filters to narrow the scope of targeted objects when calling the SearchCatalogObjects endpoint.

Although a query can have multiple filters, only certain query types can be combined per call to SearchCatalogObjects. Any combination of the following types may be used together:

When a query filter is based on an attribute, the attribute must be searchable. Searchable attributes are listed as follows, along their parent types that can be searched for with applicable query filters.

  • Searchable attribute and objects queryable by searchable attributes **
  • name: CatalogItem, CatalogItemVariation, CatalogCategory, CatalogTax, CatalogDiscount, CatalogModifier, 'CatalogModifierList,CatalogItemOption,CatalogItemOptionValue`
  • description: CatalogItem, CatalogItemOptionValue
  • abbreviation: CatalogItem
  • upc: CatalogItemVariation
  • sku: CatalogItemVariation
  • caption: CatalogImage
  • display_name: CatalogItemOption

For example, to search for CatalogItem objects by searchable attributes, you can use the "name", "description", or "abbreviation" attribute in an applicable query filter.

Structure

Catalog Query

Fields

Name Type Tags Description
sorted_attribute_query Catalog Query Sorted Attribute Hash Optional The query expression to specify the key to sort search results.
exact_query Catalog Query Exact Hash Optional The query filter to return the search result by exact match of the specified attribute name and value.
set_query Catalog Query Set Hash Optional The query filter to return the search result(s) by exact match of the specified attribute_name and any of
the attribute_values.
prefix_query Catalog Query Prefix Hash Optional The query filter to return the search result whose named attribute values are prefixed by the specified attribute value.
range_query Catalog Query Range Hash Optional The query filter to return the search result whose named attribute values fall between the specified range.
text_query Catalog Query Text Hash Optional The query filter to return the search result whose searchable attribute values contain all of the specified keywords or tokens, independent of the token order or case.
items_for_tax_query Catalog Query Items for Tax Hash Optional The query filter to return the items containing the specified tax IDs.
items_for_modifier_list_query Catalog Query Items for Modifier List Hash Optional The query filter to return the items containing the specified modifier list IDs.
items_for_item_options_query Catalog Query Items for Item Options Hash Optional The query filter to return the items containing the specified item option IDs.
item_variations_for_item_option_values_query Catalog Query Item Variations for Item Option Values Hash Optional The query filter to return the item variations containing the specified item option value IDs.

Example (as JSON)

{
  "sorted_attribute_query": null,
  "exact_query": null,
  "set_query": null,
  "prefix_query": null,
  "range_query": null,
  "text_query": null,
  "items_for_tax_query": null,
  "items_for_modifier_list_query": null,
  "items_for_item_options_query": null,
  "item_variations_for_item_option_values_query": null
}