younifyd
Menu

Get Rule By Id

Retrieve a rule by ID.

GET/organizations/{organizationId}/catalogs/{catalogId}/categories/{categoryId}/rules/{ruleId}

Use it in a workflow

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

Request

Path parameters

ruleIdanyrequired

The Id of the rule

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

Response

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

idany

The ID of the rule.

enabledboolean

A flag indicating whether this rule is enabled.

Default false

exclusionboolean

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>

The list of conditions for the rule.

idanyrequired

The ID of the condition.

attributeKeyanyrequired

The key of the attribute(system or custom). This represents the ID of the attribute.

attributeNameany

The human-readable name of the attribute(system or custom). This is a read-only field.

attributeValuearray<any>required

The value of the attribute.

operatorstringrequired

The operator for the condition.

One ofstarts_withcontainsequalsnot_equalsgreater_thanless_thanis_one_ofnot_one_ofis_definedis_not_defined

json
{
  "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.

Get Rule By Id — Salesforce Commerce Cloud — Documentation