And/Or Filtering

If your e-commerce site supports filtering that uses the and/or functionality, CitrusAd can support this with additional parameters in your request. This accommodates to e-commerce sites that allow users to select brands to filter by brand, categories, and more.

In the request, you will need to specify:

"options": {
"filterMode": "AndOr"
},

This will enable you to request multiple product filter arrays like below:

"productFilters": [
["category:smartphones", "brandName:brandA" ],
["category:smartphones", "brandName:brandB"]
],

In this scenario, you will receive ads for products that belong to category:smartphones as well as Brand A or Brand B.

An example request is below;

HTTP
cURL
HTTP
POST $BASE_URL/v1/ads/generate HTTP/1.1
accept: application/json
content-type: application/json
Authorization: Basic 4ww25f70-b52s-40de-8f29-07b139b5cdc8
{
"pageType": "Category",
"catalogId": "628dbe95-2ec9-4e07-881d-3e9f92ab2e0b",
"productFilters": [
["category:smartphones", "brandName:brandA" ],
["category:smartphones", "brandName:brandB"]
],
"options": {
"filterMode": "AndOr"
},
"maxNumberOfAds": 3
}
cURL
curl -iX POST "$BASE_URL/v1/ads/generate" \
-H "accept: application/json" \
-H "content-type: application/json" \
-H "Authorization: Basic 4ww25f70-b52s-40de-8f29-07b139b5cdc8" \
-d \
'{
"pageType": "Category",
"catalogId": "628dbe95-2ec9-4e07-881d-3e9f92ab2e0b",
"productFilters": [
["category:smartphones", "brandName:brandA" ],
["category:smartphones", "brandName:brandB"]
],
"options": {
"filterMode": "AndOr"
},
"maxNumberOfAds": 3
}'

‚Äč