younifyd
Menu

Validate Catalog Rules

Validate catalog rules for a given context

POST/catalogs/rules/validate

Use it in a workflow

  1. Add a step and choose the Elastic Path connector.
  2. Pick the Validate Catalog Rules action (under Catalog).
  3. Fill in the fields below, then reference the result from later steps as {{validateCatalogRules.response.data}}.

Request

Query parameters

page[limit]integer (int64)

The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used.

page[offset]integer (int64)

The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. You would normally increment the page offset by multiples of the page limit to paginate through the results.

Request body

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

dataobject
match_typestringrequired

The type of matching operation to perform on catalog rules: - **filter**: Advanced rule filtering with AND logic. Returns rules that match ALL specified criteria. - **similarity**: Finds rules similar to the supplied rule using OR logic. Returns rules sorted by similarity score (highest first) with metadata indicating: - Similarity score based on matching criteria (name: 100pts, account/customer/channel/tags: 5pts each, catalog: 3pts, pricebooks: 2pts, schedules: 2pts) - Whether the rule is active at the supplied match_date - Whether the rule would be resolved for a shopper context - **conflict**: Checks for conflicts between the supplied rule and existing rules. Returns rules that would conflict if the new rule were created. - **resolve_for_shopper**: Determines the exact catalog rule that would be applied for a given shopper context. Returns the single most specific matching rule or defaults to "Default Catalog Resolution".

One offiltersimilarityconflictresolve_for_shopper

channelsarray<string>

The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests.

tagsarray<string>

A list of user-defined tags that can be used to further restrict the eligibility criteria for this rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header.

account_idsarray<string>

List of account IDs.

account_tag_idsarray<string>

List of account tag UUIDs.

customer_idsarray<string>

List of customer IDs.

pricebook_idsarray<string>

List of pricebook IDs.

schedulesarray<object>2 fields
namestring

The name of the catalog rule.

catalog_idstring

The id of the catalog to match against.

search_profile_slugstring

Optional. When `match_type` is `filter`, ANDs an exact match on the rule's `search_profile_slug`. Not used as a shopper-context matching dimension for `resolve_for_shopper`.

match_datestring (date-time)

The date to match against the schedules.

json
{
  "data": {
    "match_type": "filter",
    "channels": [
      "string"
    ],
    "tags": [
      "string"
    ],
    "account_ids": [
      "string"
    ],
    "account_tag_ids": [
      "string"
    ],
    "customer_ids": [
      "string"
    ],
    "pricebook_ids": [
      "string"
    ],
    "schedules": [
      {
        "valid_from": "2025-01-01T00:00:00Z",
        "valid_to": "2025-01-01T00:00:00Z"
      }
    ],
    "name": "string",
    "catalog_id": "string",
    "search_profile_slug": "vip-search",
    "match_date": "2025-01-01T00:00:00Z"
  }
}

Response

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

metaobject

Contains the results for the entire collection.

resultsobject1 fields

Total number of results for the entire collection.

pageobject4 fields
dataarray<object>
idstringrequired

The catalog rule ID. Use this to get, modify, or delete the catalog rule.

attributesobjectrequired13 fields
typestringrequired

This represents the type of object being returned. Always `catalog_rule`.

One ofcatalog_rule

metaobject4 fields

A rule's metadata.

linksobject

Links allow you to move between requests.

selfstring (uri)

Single entities use a `self` parameter with a link the specific resource.

firststring (uri)

Always the first page.

laststring (uri)

This is `null` if there is only one page.

prevstring (uri)

This is `null` if there is only one page.

nextstring (uri)

This is `null` if there is only one page.

json
{
  "data": [
    {
      "id": "8dbb35b2-ef04-477e-974d-e5f3abe6faae",
      "attributes": {
        "name": "rule-123",
        "catalog_id": "d09b4e16-08a5-4f42-817c-6e0d98acbb63",
        "created_at": "2020-09-22T09:00:00",
        "updated_at": "2020-09-22T09:00:00",
        "description": "Catalog Rule for most favored customers",
        "account_ids": [
          "string"
        ],
        "account_tag_ids": [
          "string"
        ],
        "customer_ids": [
          "string"
        ],
        "channels": [
          "string"
        ],
        "tags": [
          "string"
        ],
        "schedules": [
          {
            "valid_from": "2020-09-22T09:00:00",
            "valid_to": "2020-09-22T09:00:00"
          }
        ],
        "pricebook_ids": [
          {
            "id": "00000000-0000-0000-0000-000000000000",
            "priority": 0
          }
        ]
      },
      "type": "catalog_rule",
      "meta": {
        "similarity_score": 100,
        "active": false,
        "resolved_for_shopper": true,
        "release_id": "string"
      }
    }
  ],
  "meta": {
    "results": {
      "total": 0
    },
    "page": {
      "limit": 0,
      "offset": 0,
      "current": 0,
      "total": 0
    }
  },
  "links": {
    "self": "string",
    "first": "string",
    "last": "string",
    "prev": "string",
    "next": "string"
  }
}

Need more? See the Elastic Path guide for connection setup and behaviour shared by every action.