---
title: "Updates a catalog rule"
method: PUT
path: "/catalogs/rules/{catalog_rule_id}"
tags: ["Rules"]
---

# Updates a catalog rule

`PUT /catalogs/rules/{catalog_rule_id}`

## Request

- Base URL: `https://euwest.api.elasticpath.com`
- URL: `https://euwest.api.elasticpath.com/catalogs/rules/{catalog_rule_id}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/elasticpath/apis/catalogs-introduction/docs/catalogs/rules/:catalog_rule_id/put.ts> (a function with typed inputs; its response is checked against the schema)

Specify whichever attributes you want to change. The values of the other attributes remain the same. If the attributes section is empty, the catalog rule is not updated.

## Path parameters

- `catalog_rule_id` string, required

## Request body

- RuleUpdateData: A catalog rule specifies which catalog to use for a given shopper context.
  - `data` object, required
    - `id` string, required: The catalog rule ID. Use this to get, modify, or delete the catalog rule.
    - `attributes` object
      - `name` string, nullable: The name of a catalog rule. The name must not contain spaces.
      - `description` string, nullable: A description of the purpose of a catalog rule.
      - `account_ids` string[], nullable: Specifies the list of accounts who are eligible to see this catalog. If this field is empty, the rule matches all accounts.
      - `account_tag_ids` string[], nullable: The list of account tag UUIDs. Accounts must have at least one of these tags to see this catalog. If this field is empty, the rule matches all accounts regardless of tags.
      - `customer_ids` string[], nullable: The list of customers who are eligible to see this catalog. If empty, the rule matches all customers.
      - `channels` string[], nullable: 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.
      - `schedules` RuleSchedule[], nullable: Specifies a time period when a catalog is displayed, such as on a specific date or during summer. Requests populate the rule tag using the `EP-Context-Tag` header. The schedules attribute must include the following. - `valid_from` matches the date and time that the catalog is displayed from. - `valid_to` matches the date and time the catalog is displayed to. Commerce runs on UTC time. You can offset the timezone by adding the offset to the end of the date and time. For example, a catalog which contains a sale hierarchy that should appear for a set timeframe may be scheduled to publish on a given date and time within a given timezone. For instance, a sale that should begin on 1st of June 2022 05:00 ET and end on the 15th of June 2022 at 23:50 PT would have a valid schedule of `"valid_from": "2022-06-01T05:00:00.000-05:00"`, `"valid_to": "2022-06-15T11:59:99.000-08:00"`.
        - `valid_from` string, date-time, nullable: Matches the date and time that the catalog is displayed from.
        - `valid_to` string, date-time, nullable: Matches the date and time the catalog is displayed to.
      - `tags` string[], nullable: 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.
      - `catalog_id` string, nullable: The unique identifier of a catalog rule.
      - `pricebook_ids` object[]: If you want multiple price books for different scenarios, such as seasonal sales, business versus retail pricing, and reward programs, when creating a catalog, you can specify up to five price books. You must configure a priority for your price books. Product prices are displayed in the catalog according to the priority of the price books.
        - `id` string, uuid, required: A unique identifier of a price book.
        - `priority` integer, required: Priority is a number and the price book with the highest number has the highest priority.
      - `search_profile_slug` string, nullable: Optional slug of a Catalog Search profile to apply when this rule is selected for a shopper. This is configuration on the rule (same role as `pricebook_ids`), not a shopper-context matching dimension. Omit the field to leave unchanged. Send an empty string to clear. Invalid format or SYSTEMS_DEFAULT_PROFILE is rejected with 400.
    - `type` 'catalog_rule', required: This represents the type of object being returned. Always `catalog_rule`.

## Response `200`

An Updated catalog rule with the following attributes.

- RuleData: Container for a single catalog rule.
  - `data` Rule, required: A catalog rule specifies which catalog to use for a given shopper context.
    - `id` string, required: The catalog rule ID. Use this to get, modify, or delete the catalog rule.
    - `attributes` object, required
      - `name` string, required: The name of a catalog rule. The name must not contain any spaces.
      - `description` string: A brief description of the purpose of a catalog rule.
      - `account_ids` string[]: The list of accounts who are eligible to see this catalog. If this field is empty, the rule matches all accounts.
      - `account_tag_ids` string[]: The list of account tag UUIDs. Accounts must have at least one of these tags to see this catalog. If this field is empty, the rule matches all accounts regardless of tags.
      - `customer_ids` string[]: The list of customers who are eligible to see this catalog. If empty, the rule matches all customers.
      - `channels` 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.
      - `tags` 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.
      - `schedules` RuleSchedule[]: Specifies a time period when a catalog is displayed, such as on a specific date or during summer. Requests populate the rule tag using the `EP-Context-Tag` header. The schedules attribute must include the following. - `valid_from` matches the date and time that the catalog is displayed from. - `valid_to` matches the date and time the catalog is displayed to. Commerce runs on UTC time. You can offset the timezone by adding the offset to the end of the date and time. For example, a catalog which contains a sale hierarchy that should appear for a set timeframe may be scheduled to publish on a given date and time within a given timezone. For instance, a sale that should begin on 1st of June 2022 05:00 ET and end on the 15th of June 2022 at 23:50 PT would have a valid schedule of `"valid_from": "2022-06-01T05:00:00.000-05:00"`, `"valid_to": "2022-06-15T11:59:99.000-08:00"`.
        - `valid_from` string, date-time, nullable: Matches the date and time that the catalog is displayed from.
        - `valid_to` string, date-time, nullable: Matches the date and time the catalog is displayed to.
      - `catalog_id` string, required: The unique identifier of a catalog.
      - `created_at` string, date-time, required: The date and time a catalog rule was created.
      - `updated_at` string, date-time, required: The date and time a catalog release is updated.
      - `pricebook_ids` object[]: If you want multiple price books for different scenarios, such as seasonal sales, business versus retail pricing, and reward programs, when creating a catalog, you can specify up to five price books. You must configure a priority for your price books. Product prices are displayed in the catalog according to the priority of the price books.
        - `id` string, uuid, required: A unique identifier of a price book.
        - `priority` integer, required: Priority is a number and the price book with the highest number has the highest priority.
      - `search_profile_slug` string, nullable: Optional slug of a Catalog Search profile to apply when this rule is selected for a shopper. This is configuration on the rule (same role as `pricebook_ids`), not a shopper-context matching dimension. Omitted from responses when unset.
    - `type` 'catalog_rule', required: This represents the type of object being returned. Always `catalog_rule`.
    - `meta` RuleMeta: A rule's metadata.
      - `similarity_score` integer, nullable: Indicates the similarity score of the rule to the supplied validation request. The score is calculated based on matching criteria: - **Name match**: 100 points (exact match) - **Account IDs**: 5 points per matching account - **Customer IDs**: 5 points per matching customer - **Channels**: 5 points per matching channel - **Tags**: 5 points per matching tag - **Catalog ID**: 3 points (exact match) - **Pricebook IDs**: 2 points per matching pricebook - **Schedules**: 2 points per overlapping schedule Higher scores indicate greater similarity. Rules are sorted by similarity score in descending order.
      - `active` boolean: will the rule be active at the supplied match date/time?
      - `resolved_for_shopper` boolean: Indicates whether this rule will be the one resolved for a shopper viewing the catalog at the supplied match date/time
      - `release_id` string, nullable: The unique identifier of the published release of the catalog for the rule
  - `links` Links: Links allow you to move between requests.
    - `self` string, uri-reference, nullable: Single entities use a `self` parameter with a link the specific resource.
    - `first` string, uri-reference, nullable: Always the first page.
    - `last` string, uri-reference, nullable: This is `null` if there is only one page.
    - `prev` string, uri-reference, nullable: This is `null` if there is only one page.
    - `next` string, uri-reference, nullable: This is `null` if there is only one page.

## Other responses

- `default`: Unexpected error.

---

[API](https://skmtc.dev/elasticpath/apis/catalogs-introduction.md) - [All operations](https://skmtc.dev/elasticpath/apis/catalogs-introduction/llms.txt) - [OpenAPI document](https://skmtc.dev/elasticpath/apis/catalogs-introduction/revisions/eb541d5dea51?raw)
