Product Rules
Product Rules
Rules that modify the properties of a product, such as weight, price, and product image.
This is archived documentation. The V2 Catalog API is deprecated. For current API documentation, see the Catalog API.
Product Rule Object Properties
List Product Rules
Gets the collection of rules associated with a product. (Default sorting is by rule id, from lowest to highest.)
GET /stores/{store_hash}/v2/products/{product_id}/rules
Filters
There are no filter parameters specific to product rules.
Pagination
Parameters can be added to the URL query string to paginate the collection. The maximum limit is 250. If a limit isn’t provided, up to 50 product_rules are returned by default.
Response
Example JSON returned in the response:
Get a Product Rule
Gets a single product rule.
GET /stores/{store_hash}/v2/products/{product_id}/rules/{id}
Response
Example JSON returned in the response:
Get a Count of Product Rules
Gets a count of the number of product rules in the store.
GET /stores/{store_hash}/v2/products/rules/count
Response
Example JSON returned in the response:
Create a Product Rule
Creates a new product rule.
POST /stores/{store_hash}/v2/products/{product_id}/rules
Read-only Properties
The following properties of the product rule are read-only. If one or more of these properties are included in the request, it will be rejected.
- id
- product_id
Requirements
The following properties of the product rule are required. The request won’t be fulfilled unless these properties are valid.
- conditions
Response
Example JSON returned in the response:
Update a Product Rule
Updates an existing product rule.
Note
If you include a conditions object array, its contents will be appended to any existing conditions. This operation does not overwrite existing conditions.
PUT /stores/{store_hash}/v2/products/{product_id}/rules/{id}
Read-only Properties
The following properties of the product rule are read-only. If one or more of these properties are included in the request, it will be rejected.
- id
- product_id
Requirements
There are no property requirements for updating a product rule.
Response
Example JSON returned in the response:
Delete a Product Rule
Deletes a product rule.
DELETE /stores/{store_hash}/v2/products/{product_id}/rules/{id}
Delete Multiple Product Rules
Deletes multiple product rules.
DELETE /stores/{store_hash}/v2/products/{product_id}/rules
Pagination
Parameters can be added to the URL query string to paginate the collection. The maximum limit is 250. If a limit isn’t provided, up to 50 product_rules are returned by default.