Patch Existing Rules

Patching rules will only change the rules that are specified in the request.

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

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

HTTP Request#

PATCH 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 patch searchandizing rules for. Note that only complementary_items and alternative_items is supported at the moment.
item_idThe item_id condition you'd like to patch searchandizing rules for.
sectionThe index section you'd like to retrieve results from (typically Products).

JSON Specifications#

Example JSON:

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

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 active field to false.