Provides keyword and refinement-based search for products, returning only product ID, link, and name. Results are limited to products that are online and part of the site catalog.
Operation ID: productSearchProvide keyword and refinement search functionality for products. Only returns the product ID, link, and name in the product search hit. The search result only contains products that are online and assigned to the site catalog.
curl "https://{shortCode}.api.commercecloud.salesforce.com/search/shopper-search/v1/organizations/{organizationId}/product-search?siteId=RefArch"
An identifier for the organization the request is being made by
f_ecom_zzxy_prd
The property selector declaring which fields are included into the response payload. You can specify a single field name, a comma-separated list of names or work with wildcards. You can also specify array operations and filter expressions. The actual selector value must be enclosed within parentheses.
(name,id,variationAttributes.(**))
The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites
RefArch
The query phrase to search for. For example to search for a product "shirt", type q=shirt.
shirt
Parameter that represents a refinement attribute or values pair. Refinement attribute ID and
values are separated by '='. Multiple values are supported by a subset of refinement attributes and
can be provided by separating them using a pipe (URL
encoded = "|") i.e. refine=c_refinementColor=red|green|blue. Value ranges can be specified like this: refine=price=(100..500) .
Multiple refine parameters can be provided by using the refine as the key i.e refine=price=(0..10)&refine=c_refinementColor=green.
The refinements can be a collection of custom defined attributes IDs and the system defined attributes IDs but the search can
only accept a total of 9 refinements at a time.
The following system refinement attribute ids are supported:
cgid: Allows refinement per single category ID. Multiple category ids are not supported.
price: Allows refinement per single price range. Multiple price ranges are not supported.
pmid: Allows refinement per promotion ID.
htype: Allow refinement by including only the provided hit types. Accepted types are 'product', 'master', 'set', 'bundle', 'slicing_group' (deprecated), 'variation_group'.
orderable_only: Unavailable products are excluded from the search results if true is set. Multiple refinement values are not supported.
ilids: Allows refinement per inventory list IDs. Important Note:This API parameter is not GA and is currently a pilot/beta service as defined by the customer's main services agreement and provided as-is. If you are not part of the pilot/beta program, the API will throw an exception. Contact your customer success representative for more information.
Note: To refine a search using multiple promotion filters—for example, to find products in both the spring and summer campaigns—see Refining by Multiple Promotions.
refine=price=(0..10)&refine=c_refinementColor=green
The ID of the sorting option to sort the search hits.
brand
A three letter uppercase currency code conforming to the ISO 4217 standard, or the string N/A
indicating that a currency is not applicable.
USD
A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter Accept-Language
following RFC 2616 & RFC 1766. This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
en-US
A comma-separated list with allowed values - availability
, images
, prices
, represented_products
, variations
, promotions
, custom_properties
.
By default, the expand parameter includes availability, images, prices, represented_products, variations
.
Use none to disable all expand options.
The page_meta_tags expand value is optional and is available B2C Commerce version 25.2."
- none
- availability
- images
- prices
- represented_products
- variations
- promotions
- custom_properties
- page_meta_tags
When the images
expand parameter is used with this flag, the response includes the imageGroups property
, which contains an image model.
If this flag is true, the full image model is returned. If false, only matching images are included.
If no flag is passed, the imageGroups
property is omitted from the response.
true
When this flag is set to true
and is used with the prices
expand parameter, the response includes per PriceBook prices and tiered prices (if available).
true
The flag that determines which variation properties are included in the result. When set to true
with the variations
expand parameter, all variation properties (variationAttributes
, variationGroups
, variants
) are returned. When set to false, only the default property variationAttributes
is returned.
false
Maximum records to retrieve per request, not to exceed 200. Defaults to 25.
Used to retrieve the results based on a particular resource offset.
Product search successfully returned results.
{
"limit": 3,
"hits": [
{
"currency": "USD",
"hitType": "master",
"image": {
"alt": "Modern Dress Shirt, , large",
"disBaseLink": "https://edge.disstg.commercecloud.salesforce.com/dw/image/v2/ZZEU_006/on/demandware.static/-/Sites-apparel-catalog/default/dw7671b929/images/large/B0174501_GY9_0.jpg",
"link": "https://zzeu-006.sandbox.us01.dx.commercecloud.salesforce.com/on/demandware.static/-/Sites-apparel-catalog/default/dw7671b929/images/large/B0174501_GY9_0.jpg",
"title": "Modern Dress Shirt, "
},
"orderable": true,
"price": 135,
"productId": "74974310",
"productName": "Modern Dress Shirt",
"productType": {
"master": true
},
"representedProduct": {
"id": "74974310-1"
},
"representedProducts": [
{
"id": "74974310-1"
},
{
"id": "74974310-2"
},
{
"id": "74974310-3"
},
{
"id": "74974310-4"
}
],
"variationAttributes": [
{
"id": "color",
"name": "color",
"values": [
{
"name": "Blue",
"orderable": true,
"value": "002"
}
]
},
{
"id": "size",
"name": "size",
"values": [
{
"name": "15R",
"orderable": true,
"value": "15R"
},
{
"name": "15L",
"orderable": true,
"value": "15L"
},
{
"name": "16L",
"orderable": true,
"value": "16L"
}
]
}
]
},
{
"currency": "USD",
"hitType": "master",
"image": {
"alt": "The White Dress Shirt, , large",
"disBaseLink": "https://edge.disstg.commercecloud.salesforce.com/dw/image/v2/ZZEU_006/on/demandware.static/-/Sites-apparel-catalog/default/dw9368b001/images/large/70284588_100_0.jpg",
"link": "https://zzeu-006.sandbox.us01.dx.commercecloud.salesforce.com/on/demandware.static/-/Sites-apparel-catalog/default/dw9368b001/images/large/70284588_100_0.jpg",
"title": "The White Dress Shirt, "
},
"orderable": true,
"price": 135,
"productId": "78916783",
"productName": "The White Dress Shirt",
"productType": {
"master": true
},
"representedProduct": {
"id": "78916783-1"
},
"representedProducts": [
{
"id": "78916783-1"
},
{
"id": "78916783-2"
},
{
"id": "78916783-3"
},
{
"id": "78916783-4"
}
],
"variationAttributes": [
{
"id": "color",
"name": "Color",
"values": [
{
"name": "White",
"orderable": true,
"value": "white"
}
]
},
{
"id": "size",
"name": "size",
"values": [
{
"name": "15L",
"orderable": true,
"value": "15L"
},
{
"name": "15R",
"orderable": true,
"value": "15R"
}
]
}
]
},
{
"currency": "USD",
"hitType": "master",
"image": {
"alt": "Striped Shirt, , large",
"disBaseLink": "https://edge.disstg.commercecloud.salesforce.com/dw/image/v2/ZZEU_006/on/demandware.static/-/Sites-apparel-catalog/default/dw83b22281/images/large/PG.10213135.JJ9VSA5.PZ.jpg",
"link": "https://zzeu-006.sandbox.us01.dx.commercecloud.salesforce.com/on/demandware.static/-/Sites-apparel-catalog/default/dw83b22281/images/large/PG.10213135.JJ9VSA5.PZ.jpg",
"title": "Striped Shirt, "
},
"orderable": true,
"price": 40.99,
"productId": "25518484",
"productName": "Striped Shirt",
"productType": {
"master": true
},
"representedProduct": {
"id": "701642854760"
},
"representedProducts": [
{
"id": "701642854760"
},
{
"id": "701642854784"
},
{
"id": "701642854791"
},
{
"id": "701642854777"
}
],
"variationAttributes": [
{
"id": "color",
"name": "Color",
"values": [
{
"name": "Royal Multi",
"orderable": true,
"value": "JJ9VSA5"
}
]
},
{
"id": "size",
"name": "Size",
"values": [
{
"name": "S",
"orderable": true,
"value": "9SM"
},
{
"name": "M",
"orderable": true,
"value": "9MD"
},
{
"name": "L",
"orderable": true,
"value": "9LG"
},
{
"name": "XL",
"orderable": true,
"value": "9XL"
}
]
}
]
}
],
"pageMetaTags": [
{
"id": "robots",
"value": "index,follow"
},
{
"id": "title",
"value": "Find amazing products in Storefront Catalog - EN' today"
}
],
"query": "shirt",
"refinements": [
{
"attributeId": "cgid",
"label": "Category",
"values": [
{
"hitCount": 4,
"label": "New Arrivals",
"value": "newarrivals"
}
]
},
{
"attributeId": "c_refinementColor",
"label": "Color",
"values": [
{
"hitCount": 0,
"label": "Beige",
"presentationId": "beige",
"value": "Beige"
},
{
"hitCount": 0,
"label": "Yellow",
"presentationId": "yellow",
"value": "Yellow"
},
{
"hitCount": 7,
"label": "Miscellaneous",
"presentationId": "miscellaneous",
"value": "Miscellaneous"
}
]
},
{
"attributeId": "price",
"label": "Price",
"values": [
{
"hitCount": 14,
"label": "$20 - $49.99",
"value": "(20..50)"
},
{
"hitCount": 26,
"label": "$50 - $99.99",
"value": "(50..100)"
},
{
"hitCount": 6,
"label": "$100 - $499.99",
"value": "(100..500)"
}
]
},
{
"attributeId": "c_isNew",
"label": "New Arrival",
"values": [
{
"hitCount": 1,
"label": "true",
"value": "true"
}
]
},
{
"attributeId": "brand",
"label": "brand",
"values": [
{
"hitCount": 1,
"label": "Lacy-S",
"value": "Lacy-S"
}
]
}
],
"searchPhraseSuggestions": {
"suggestedPhrases": [
{
"exactMatch": true,
"phrase": "shirt"
}
],
"suggestedTerms": [
{
"originalTerm": "shirt",
"terms": [
{
"completed": false,
"corrected": false,
"exactMatch": true,
"value": "shirt"
}
]
}
]
},
"sortingOptions": [
{
"id": "best-matches",
"label": "Best Matches"
},
{
"id": "price-low-to-high",
"label": "Price Low To High"
}
],
"offset": 0,
"total": 46
}
A sorted array of search hits (ProductSearchHit
objects). The array can be empty.
Page Meta tags associated with the search result.
The query string that was searched for.
dresses
The sorted array of search refinements. This array can be empty.
The suggestion given by the system for the submitted search phrase.
A map of selected refinement attribute ID or value pairs. The sorting order is the same as in request URL.
The ID of the applied sorting option.
best-matches
The sorted array of search sorting options. This array can be empty.
Properties inherited from PaginatedResultBase.
The zero-based index of the first hit/data to include in the result.
0
Properties inherited from ResultBase.
The total number of hits that match the search's criteria. This can be greater than the number of results returned as search results are pagenated.
10