Gets all authorized catalog rules
GET/pcm/catalogs/rules
Retrieves all authorized catalog rules.
Filtering
This endpoint supports filtering. For general filtering syntax, see Filtering. The following operators and attributes are supported.
Operator | Description | Supported Attributes | Example |
---|---|---|---|
In | Checks if the values are included in the specified string. If they are, the condition is true. | id | filter=in(id,some-id) |
Request
Query Parameters
This endpoint supports filtering. See Filtering.
Possible values: >= 1
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 store setting is used.
Possible values: <= 10000
The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the page length store setting is used.
Responses
- 200
- default
The list of catalog rules.
- application/json
- Schema
- Example (from schema)
Schema
- Array [
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 [
- ]
- ]
meta object
Contains the results for the entire collection.
results object
Total number of results for the entire collection.
Total number of results for the entire collection.
page object
The maximum number of records for all pages.
The current offset by number of pages.
The current number of pages.
The total number of records for the entire collection.
data object[]required
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.
{
"meta": {
"results": {
"total": 0
},
"page": {
"limit": 0,
"offset": 0,
"current": 0,
"total": 0
}
},
"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."
}
]
}