Get a catalog rule by ID
GET/catalogs/rules/:catalog_rule_id
Get a catalog rule by ID
Request
Path Parameters
The catalog rule ID.
Responses
- 200
- default
The catalog rile.
- application/json
- Schema
- Example (from schema)
Schema
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.- Array [
- ]
data objectrequired
A catalog rule specifies which catalog to use for a given shopper context.
The catalog rule ID. Use this to get, modify, or delete the catalog rule.
attributes objectrequired
The name of a catalog rule. The name must not contain any spaces.
A brief description of the purpose of a catalog rule.
The list of accounts who are eligible to see this catalog. If this field is empty, the rule matches all accounts.
The list of customers who are eligible to see this catalog. If empty, the rule matches all customers.
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.
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 object[]
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.
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"
.
Matches the date and time that the catalog is displayed from.
Matches the date and time the catalog is displayed to.
The unique identifier of a catalog.
The date and time a catalog rule was created.
The date and time a catalog release is updated.
Possible values: [catalog_rule
]
This represents the type of object being returned. Always catalog_rule
.
links object
Links allow you to move between requests.
Single entities use a self
parameter with a link the specific resource.
Always the first page.
This is null
if there is only one page.
This is null
if there is only one page.
This is null
if there is only one page.
{
"data": {
"id": "8dbb35b2-ef04-477e-974d-e5f3abe6faae",
"attributes": {
"name": "rule-123",
"description": "Catalog Rule for most favored customers",
"account_ids": [
"string"
],
"customer_ids": [
"string"
],
"channels": [
"string"
],
"tags": [
"string"
],
"schedules": [
{
"valid_from": "2020-09-22T09:00:00",
"valid_to": "2020-09-22T09:00:00"
}
],
"catalog_id": "d09b4e16-08a5-4f42-817c-6e0d98acbb63",
"created_at": "2020-09-22T09:00:00",
"updated_at": "2020-09-22T09:00:00"
},
"type": "catalog_rule"
},
"links": {
"self": "string",
"first": "string",
"last": "string",
"prev": "string",
"next": "string"
}
}
An unexpected error.
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
errors object[]
{
"errors": [
{
"detail": "not processable",
"status": "422",
"title": "There was a problem processing your request."
}
]
}