Need help with your APIs? I offer API discovery, governance & evangelism services. Explore services →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

Elastic Path Rules API

If your store requires multiple catalogs, add catalog rules to control when a catalog is displayed. A catalog rule contains a catalog plus the criteria under which to display the catalog.:::cautionYou cannot create catalog rules for organization catalogs.:::You can use catalog rules to schedule a catalog to appear during a particular period, such as on a specific date or during summer. The catalog might offer different pricing during this period. The pricing depends on the associated price book.The following scenarios provides a few examples for using catalog rules.- **Multiple geographical regions**. Display different catalogs in different regions with suitable pricing or combine product hierarchies from two different regions to display in a third region.- **Multiple channels**. Display different catalogs based on how a shopper accesses your store, such as through a mobile app or a web storefront.- **Direct to business versus direct to customers**. Offer different products and prices for business customers versus retail customers.- **Preferred accounts**. Offer special pricing to a group of users while displaying a standard price catalog to other users.- **Preferred customers**. Offer special pricing to preferred customers while displaying a standard price catalog to all other shoppers.- **Reward programs**. Enable reward programs where catalog prices drop after a certain spending level is reached.- **Product sales**. Offer sale items for a limited time.- **Standard pricing**. Display a default catalog to the shoppers who do not meet the criteria of the other catalog rules.You can define a catalog rule with any of the following criteria.- **Accounts**. List the accounts that should see a catalog. When a user has logged in with the account, they see the configured catalog.- **Customers**. List the customers that should see a catalog. When the customer is logged in, they see the configured catalog.- **Channel**. Specify a shopper experience, such as web storefront or mobile app. Set up the channel to retrieve the catalog from the catalog rule that matches that channel.- **Other tags**. Create your own user-defined tags. For example, you might want to tag by regions or you might want to distinguish between business and consumer customers.If a catalog rule has no criteria defined, it is the default catalog rule.### Resolving catalog rulesWhen there is a request for a catalog, the store displays the catalog with the rule that matches the most attributes of the shoppers context.The request triggers the following steps:1. Compares the shoppers context against the defined catalog rules.1. Determines the best match.1. Retrieves the catalog associated with the matching catalog rule.The follow examples show how the best match might be resolved:- A shopper matches one of the `customer_ids` in one catalog rule only. The catalog for that catalog rule is displayed.- A shopper matches one of the `customer_ids` in one catalog rule only, but doesnʼt match any of the `tags` specified in that catalog rule. Because there are no other catalog rules for this `customer_id`, the catalog for the catalog rule is displayed because it is the best match.- A shopper is browsing a store using the stores mobile app, which matches `channel=mobile` in two catalog rules. The catalog displayed depends on matches with the `tags` or `customer_ids` attributes. If there is no other matching attribute, the first catalog rule found by the store is used. The best practice is to create catalog rules that cover all cases so that you avoid this situation.- An unknown shopper is browsing the only channel offered by the seller. The store displays the base catalog.

Elastic Path Rules API is one of 100 APIs that Elastic Path publishes on the APIs.io network, described by a machine-readable OpenAPI specification.

Tagged areas include Rules. The published artifact set on APIs.io includes an OpenAPI specification and API documentation.

This API exposes 6 operations across 3 paths, and defines 13 schemas. It is described by OpenAPI 3.1.0, at version 25.1126.6886238.

Requests are made against 2 base URLs: https://useast.api.elasticpath.com, https://euwest.api.elasticpath.com.

6 operations 3 paths 13 schemas 1 DELETE2 GET2 POST1 PUT

Metadata

The identity and technical contract details declared by the specification.

Specification
OpenAPI 3.1.0
API Version
25.1126.6886238
Base URL
https://useast.api.elasticpath.com
Authentication
HTTP Bearer
License
Resource Areas
1

Authentication & Security 1

Elastic Path Rules API declares 1 security scheme for authenticating requests. It accepts HTTP bearer tokens (BearerToken). By default, every request must be authenticated.

Paths & Operations 6

Across 3 paths, the API surfaces 6 operations — 1 DELETE, 2 GET, 2 POST, 1 PUT. Each is listed below with its method, path, parameters, and response codes.

Rules 6

If your store requires multiple catalogs, add catalog rules to control when a catalog is displayed. A catalog rule contains a catalog plus the criteria under which to display the…

POST
/catalogs/rules
Creates a new catalog rule
createRule body → 201default
GET
/catalogs/rules
Gets all authorized catalog rules
getRules 3 params → 200default
GET
/catalogs/rules/{catalog_rule_id}
Get a catalog rule by ID
getRuleByID 1 param → 200default
PUT
/catalogs/rules/{catalog_rule_id}
Updates a catalog rule
updateRule 1 param body → 200default
DELETE
/catalogs/rules/{catalog_rule_id}
Deletes a catalog rule
deleteRuleByID 1 param → 204default
POST
/catalogs/rules/validate
Validate catalog rules for a given context
validateCatalogRules 2 params body → 200default

Schemas 13

The contract defines 13 schemas that model the data the API accepts and returns. The most detailed are links (5 properties), rule-meta (4 properties), rule (4 properties), error (3 properties). Each schema is shown below with its type and property counts.

rule-schedule
object
A period of time during which a catalog is valid
2 properties
rule
object
A catalog rule specifies which catalog to use for a given shopper context.
4 properties 3 required
error
object
APIError is a json-api style part of an error response.
3 properties
rule-data
object
Container for a single catalog rule.
2 properties 1 required
page-meta
object
Contains the results for the entire collection.
2 properties
rule-list-data
object
Container for a list of catalog rules.
3 properties 1 required
rule-create-data
object
A catalog rule specifies which catalog to use for a given shopper context.
1 property 1 required
error-response
object
ErrorResponse is a json-api style Error response.
1 property
prioritized-pricebooks
array
If you want multiple price books for different scenarios, such as seasonal sales, business versus retail pricing, and reward programs, when creating a catalog,…
catalog-rule-validator-request
object
1 property
rule-update-data
object
A catalog rule specifies which catalog to use for a given shopper context.
1 property 1 required
rule-meta
object
A rule's metadata.
4 properties
links
object
Links allow you to move between requests.
5 properties

Specification

The full machine-readable OpenAPI contract behind this narrative.

Source

elastic-path-rules-api-openapi.yml Raw ↑

Other APIs Elastic Path publishes across the network.

Elastic Path GraphQL API
Elastic Path Account Addresses API
Elastic Path Account Authentication Settings API
Elastic Path Account Cart Associations API
Elastic Path Account Management Authentication API
Elastic Path Account Members API
Elastic Path Account Membership API
Elastic Path Account Membership Settings API
Elastic Path Account Tags API
Elastic Path Accounts API
Elastic Path Administrator Latest Releases Catalog API API
Elastic Path Application Keys API