younifyd
Menu

Create Category Rules

Create rules and conditions for a catalog and category.

POST/organizations/{organizationId}/catalogs/{catalogId}/categories/{categoryId}/rules

Use it in a workflow

  1. Add a step and choose the Salesforce Commerce Cloud connector.
  2. Pick the Create Category Rules action (under Catalogs (Data API)).
  3. Fill in the fields below, then reference the result from later steps as {{createCategoryRules.response.data}}.

Request

Path parameters

categoryIdstringrequired

The ID of the category to be created.

catalogIdstringrequired

The ID of the requested catalog.

organizationIdstringrequired

An identifier for the organization the request is being made by

Request body

Enter the body as JSON in the step's Body field.

dataarray<object>

The list of rules. This can be empty.

idanyrequired

The ID of the rule.

enabledbooleanrequired

A flag indicating whether this rule is enabled.

Default false

exclusionbooleanrequired

A flag indicating whether this rule is an exclusion.

Default false

categorizationLocaleIdstring

This field indicates the locale to be used for evaluating rules/conditions for the entire category. Note: this applies to all the rules for that category, and the last modification for this field will apply to the entire ruleset for that category.

categorizationClassificationFlagboolean

This field indicates if the matching products assigned as a result of the rules run will be given the tag for classification category. Note: this applies to all the rules for that category, and the last modification for this field will apply to the entire ruleset for that category.

Default false

categorizationPrimaryFlagboolean

This field indicates if the matching products assigned as a result of the rules run will be given the tag for primary category. Note: this applies to all the rules for that category, and the last modification for this field will apply to the entire ruleset for that category.

Default false

conditionsarray<object>5 fields

The list of conditions for the rule.

json
{
  "data": [
    {
      "id": "VHRule",
      "enabled": false,
      "exclusion": false,
      "categorizationLocaleId": "en-US",
      "categorizationClassificationFlag": true,
      "categorizationPrimaryFlag": true,
      "conditions": [
        {
          "id": "NameCondition",
          "attributeKey": "name",
          "attributeValue": [
            "Shirt"
          ],
          "operator": "starts_with",
          "attributeName": "name"
        }
      ]
    }
  ]
}

Response

Returns 200 with an object. Read it in later steps with {{createCategoryRules.response.data.<field>}}.

dataarray<object>

The list of rules. This can be empty. *Note* - If the exclusion attribute is set to true, the rule is designated as an Exclusion rule. Any item matching an Exclusion rule is omitted from the final result set.

idanyrequired

The ID of the rule.

enabledbooleanrequired

A flag indicating whether this rule is enabled.

Default false

exclusionbooleanrequired

A flag indicating whether this rule is an exclusion.

Default false

categorizationLocaleIdstring

This field indicates the locale to be used for evaluating rules/conditions for the entire category. Note: this applies to all the rules for that category, and the last modification for this field will apply to the entire ruleset for that category.

categorizationClassificationFlagboolean

This field indicates if the matching products assigned as a result of the rules run will be given the tag for classification category. Note: this applies to all the rules for that category, and the last modification for this field will apply to the entire ruleset for that category.

Default false

categorizationPrimaryFlagboolean

This field indicates if the matching products assigned as a result of the rules run will be given the tag for primary category. Note: this applies to all the rules for that category, and the last modification for this field will apply to the entire ruleset for that category.

Default false

conditionsarray<object>5 fields

The list of conditions for the rule.

json
{
  "data": [
    {
      "id": "VHRule",
      "enabled": false,
      "exclusion": false,
      "categorizationLocaleId": "en-US",
      "categorizationClassificationFlag": true,
      "categorizationPrimaryFlag": true,
      "conditions": [
        {
          "id": "NameCondition",
          "attributeKey": "name",
          "attributeValue": [
            "Shirt"
          ],
          "operator": "starts_with",
          "attributeName": "name"
        }
      ]
    }
  ]
}

Need more? See the Salesforce Commerce Cloud guide for connection setup and behaviour shared by every action.

Create Category Rules — Salesforce Commerce Cloud — Documentation