Menu
Create Rule
Creates a new catalog rule
POST
/catalogs/rulesUse it in a workflow
- Add a step and choose the Elastic Path connector.
- Pick the Create Rule action (under Catalog).
- Fill in the fields below, then reference the result from later steps as
{{createRule.response.data}}.
Request
Request body
Enter the body as JSON in the step's Body field.
{
"data": {
"attributes": {
"name": "rule-123",
"catalog_id": "d09b4e16-08a5-4f42-817c-6e0d98acbb63",
"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
}
],
"search_profile_slug": "vip-search"
},
"type": "catalog_rule"
}
}
Response
Returns 201 with an object. Read it in later steps with {{createRule.response.data.<field>}}.
{
"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"
}
},
"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.
Was this page helpful?