Rules
Creates a new catalog rule
If you have multiple catalogs, create catalog rule resources. With catalog rules, you can display different catalogs to different shoppers. For example, you can display a preferred pricing catalog to a few special customers. Or you can display one catalog to shoppers using your website and a different catalog to shoppers using your mobile app. Finally, you can define custom criteria by creating tags.
:::note
- If you have one catalog for all customers and channels, you can omit creating this resource.
- Due to the way catalogs are cached in Commerce, using catalog rules to display catalogs sometimes causes a 5-minute time delay before the catalogs are displayed.
:::
For ideas about the kinds of business scenarios you can achieve with catalog rules, see Catalog Rules. To understand how catalogs are matched to shoppers by using rules, see Resolving Catalog Rules.
post/catalogs/rules
Request
- Base URLhttps://euwest.api.elasticpath.com
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Example request
{
"data": {
"attributes": {
"name": "rule-123",
"description": "Catalog Rule for most favored customers",
"schedules": [
{
"valid_from": "2020-09-22T09:00:00",
"valid_to": "2020-09-22T09:00:00"
}
],
"catalog_id": "d09b4e16-08a5-4f42-817c-6e0d98acbb63",
"search_profile_slug": "vip-search"
},
"type": "catalog_rule"
}
}Response
The created catalog rule
Example response
{
"data": {
"id": "8dbb35b2-ef04-477e-974d-e5f3abe6faae",
"attributes": {
"name": "rule-123",
"description": "Catalog Rule for most favored customers",
"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",
"search_profile_slug": "vip-search"
},
"type": "catalog_rule",
"meta": {
"similarity_score": 100,
"resolved_for_shopper": true
}
}
}Changes
No recorded changes to this operation across all 1 revision of this API.