Product search criteria in Pega CDH

We are trying to implement product search criteria in the Web channel

ProductSearchCriteria Data transform is updated with Brand with Samsung and Apple like below

Default products are associated and ProductSearchCriteria like below

When I trigger the API with ProductSearchCriteria still it retun the same defult product

API Request :

{

“SubjectID”: “2222222222”,

“ContextName”: “Subscription”,

“ContainerName”: “Web_InboundCC”,

“Channel”: “Web”,

“Direction”: “Inbound”,

“AppID”: “SyncUp”,

“Contexts”: [

{

  "Type": "ProductSearchCriteria",

  "Key": "Brand",

  "Value": "Apple"

},

{

  "Type": "ProductSearchCriteria",

  "Key": "Colour",

  "Value": "Black"

}

]

}

API Response

{

"Status": "OK",

"ContainerList": \[

    {

        "Status": "OK",

        "ContainerName": "Web_InboundCC",

        "RankedResults": \[

            {

                "Group": "Mobile",

                "Issue": "Retain",

                "InteractionID": "-8873131193767940964",

                "Discount": 0,

                "ProductName": "Samsung S26 Blue 256GB",

                "SubjectName": "2222222222",

                "pyCampaignCode": "",

                "ContentFormat": "",

                "Label": "Upgrade mobile",

                "MRP": 0,

                "Benefits": "New Mobile  Upgrade",

                "Direction": "Inbound",

                "Name": "UpgradeMobile",

                "ShortDescription": "New Mobile  Upgrade",

                "GroupID": "",

                "Colour": "Blue",

                "Identifier": "/Retain/Mobile/UpgradeMobile",

                "BundleType": "",

                "Placement": "Tile",

                "Propensity": 1.0,

                "Priority": 4.99999999E8,

                "Channel": "Web",

                "BundleName": "",

                "ImageURL": "",

                "Rank": 1,

                "ProductID": "PO-4029",

                "BundleParent": "false",

                "Brand": "Samsung",

                "Treatment": "Mobile Upgrade Web",

                "CampaignID": "",

                "Price": 0,

                "ProductCategory": "Mobile",

                "ClickThroughURL": "",

                "ProductDescription": "Small but mighty black when folded",

                "SubjectID": "2222222222",

                "DecisionTime": "20260304T104431.457 GMT",

                "ContextName": "Subscription"

            }

        \]

    }

\]

}

image

How can we achieve the use case based on search product criteria that need to return the associated product data?

@JAGADEESHG8839 First thing is,productsearch criteria is not depended on contexts passed in the API request.
Even though you associated default product in CDH and enbaled Product search criteria option, since You did not selected any values for Brand and Colour for the action, container call will not return any search criteria for you in the response.

  1. So first configure the Brancd and colour in CDH for the action.(ProductSearchCriteria DT you overrided will act as source for configuring the required values in action).
  2. If you are using v3 container, then you should be getting productsearch criteria configured for the action once you completed above step.
  3. If you are using v4 container then make sure you map productsearchcriteria in ExtendedContainerProperties DT for the web channel, so that API response includes the value.

Hi @kimpd thanks for suggesting. Added the Brand colour in ProductSearchCriteria and updated the Action with Samsung and Black colour like below, but still it returns the default action

ExtendedContainerProperties updated like this but still it retun the defult one

API Response:

My use case is, when the user selects the brand and colour from UI, Respective Mobiles need to display

Brand, Colour, and Other Product information are available. Attached the CSV file for reference, Let me know if you need any additional information

Thanks & Regards,

Jagadeesh

ProductSummaries_20260311T143104.606 GMT.csv (2.3 KB)

in the ProductSummaries

@JAGADEESHG8839 In the API response, I can see that the ProductSearchCriteria value is the same as what has been configured.

The reason you are getting the default values (for example, Color = Orange and Brand = Apple) is that these values are present in the ProductSummaries DDR for the product Apple‑002.

CDH does not have logic to consider the ProductSearchCriteria configured in the action when returning product details. It always returns the details of the default product. This is because ProductSearchCriteria is primarily meant to describe the required product characteristics (such as color, brand, storage, etc.), while the actual product information is expected to reside in an external product catalog system.

Therefore, when the CDH Container API returns the ProductSearchCriteria, the implementation application is expected to make a REST call to the product catalog system and fetch the corresponding product details.

For example, let us assume CDH returns
ProductSearchCriteria = “Category=Mobile Device, Storage=256GB, Color=Gold”
in the container response. The product catalog system may have multiple products matching this criteria, as shown in the screenshots. For testing purposes, we built an API that retrieves product details by passing the ProductSearchCriteria.

The ProductOffering API is internal to Pega. It is expected that the client builds their own API to integrate with external product catalog systems.

How we normally test this

Internal REST API to catalog system when we pass Category=Mobile Device,Storage=256GB,Color=Gold as ProductSearchCriteria

https://crmc25-1-dev.pegademo.com/prweb/api/productCatalogManagement/v1/productOffering?facetSearch=Category=Mobile Device,Storage=256GB,Color=Gold –> This is built only for testing and its not exposed.

API Response with product details

[
{
“isBundle”: false,
“prodSpecCharValueUse”: ,
“productSpecification”: {
“name”: “iPhone 12 Gold 256GB”,
“href”: “http://hostid:port/prweb/api/productCatalogManagement/v1/productSpecification/PS-8116”,
“id”: “PS-8116”,
“version”: “01”
},
“lifecycleStatus”: “Available now”,
“validFor”: {
“startDateTime”: “20230223T153400.000 GMT”,
“endDateTime”: “”
},
“description”: “Battery losts for 20 hours on calls and 13 hours on web browsing or video playback.”,
“isSellable”: true,
“productOfferingPrice”: [
{
“name”: “Onetime $180 Recurring cost $65”,
“totalProductOfferingPrice”: {
“totalWeeklyCharge”: 0,
“totalMonthlyCharge”: 65,
“totalOneTimeCharge”: 180,
“totalAnnualCharge”: 0
},
“href”: “http://hostid:port/prweb/api/productCatalogManagement/v1/productOfferingPrice”,
“id”: “PE-7017”
}
],
“version”: “01”,
“lastUpdate”: “20230228T073848.940 GMT”,
“name”: “iPhone 12 Gold 256GB”,
“href”: “http://hostid:port/prweb/api/productCatalogManagement/v1/productOffering/PO-8116”,
“id”: “PO-8116”
},
{
“isBundle”: false,
“prodSpecCharValueUse”: ,
“productSpecification”: {
“name”: “iPhone 13 Gold 256GB”,
“href”: “http://hostid:port/prweb/api/productCatalogManagement/v1/productSpecification/PS-8112”,
“id”: “PS-8112”,
“version”: “01”
},
“lifecycleStatus”: “Available now”,
“validFor”: {
“startDateTime”: “20230223T144700.000 GMT”,
“endDateTime”: “”
},
“isSellable”: true,
“description”: “offers Dolby Vision HDR video at a higher frame rate”,
“productOfferingPrice”: [
{
“totalProductOfferingPrice”: {
“totalWeeklyCharge”: 0,
“totalMonthlyCharge”: 70,
“totalOneTimeCharge”: 190,
“totalAnnualCharge”: 0
},
“name”: “Onetime $190 Recurring cost $70”,
“href”: “http://hostid:port/prweb/api/productCatalogManagement/v1/productOfferingPrice”,
“id”: “PE-7012”
}
],
“version”: “01”,
“lastUpdate”: “20230228T073919.976 GMT”,
“name”: “iPhone 13 Gold 256GB”,
“href”: “http://hostid:port/prweb/api/productCatalogManagement/v1/productOffering/PO-8112”,
“id”: “PO-8112”
}
]

How product info looks like in external product catalog system

Filtered based on Color=Gold

Products based on ProductSearchCriteria that API returned

Hope this answers your queries

1 Like