Add Rules

Putting new rules will replace all existing rules associated with the specified strategy_name and item_id condition if there are any.

curl -X PUT -H "Content-Type: application/json" \
-d '{
"slot_rules": [
{
"rule": {
"item_id": "fiddos_food_item",
"position": 1
},
"active": true,
}
]
}' \
-u"[your token]:" "https://ac.cnstrc.com/refined_strategies?key=[your index key]&section=Products&strategy_name=complementary_items&item_id=fiddos_dog_toys"
info

The above command returns a 204 Success response on success. For simplicity sake, a 204 Success response will be returned even if the rule already exists.

HTTP Request#

PUT https://ac.cnstrc.com/refined_strategies?key=[your index key]&section=[section]&strategy_name=[strategy_name]&item_id=[item_id]

Query Parameters#

ParameterDescription
strategy_nameThe name of the strategy you'd like to searchandize for. Note that only complementary_items and alternative_items is supported at the moment.
item_idThe item_id you'd like to condition this searchandizing rule on.
sectionThe index section you'd like to retrieve results from (typically Products).
tip

Conditioning on a specific item_id will apply searchandizing rules when that specified item_id is passed as a parameter via the pods or strategies endpoint.

JSON Specifications#

Example JSON
{
"slot_rules": [
{
"rule": {
"item_id": "fiddos_food_item",
"position": 1
},
"active": true
}
],
"blacklist_rules": [
{
"rule": {
"item_ids": ["cat_floppy_fish_item"]
},
"active": true
}
]
}

Types of rules#

idDescription
slot_rulesWith slot rules, you can add an item to recall and pin it to a particular position. Provide item_id and a particular position for the item(s).
blacklist_rulesRemove matching items from recall.

Parameters#

ParameterRequired?Description
ruleYesRules can accept an object of the various rule specs as show in the above JSON example.
activeNoYour searchandizing rules can be defined but set to inactive if you wish by setting the active field to false.