Get Complex Rules
GET /stores/{store_hash}/v3/catalog/products/{product_id}/complex-rules
Request
Returns a list of all product Complex Rules. Optional parameters may be passed in.
Authentication
- X-Auth-Token in header - required
Parameters
- store_hash in path - string
- Accept in header with default of application/json - string - required
The MIME type of the response body.
- product_id in path - integer - required
The ID of the
Product
to which the resource belongs. - include_fields in query - string
Fields to include, in a comma-separated list. The ID and the specified fields will be returned.
- exclude_fields in query - string
Fields to exclude, in a comma-separated list. The specified fields will be excluded from a response. The ID cannot be excluded.
- page in query - integer
Specifies the page number in a limited (paginated) list of products.
- limit in query - integer
Controls the number of items per page in a limited (paginated) list of products.
example
curl --request GET \ --url 'https://api.bigcommerce.com/stores/[store_hash]/v3/catalog/products/[product_id]/complex-rules' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'X-Auth-Token: xxxxxxxxxxxxxxxxx'
Response
Body
Complex Rule Response
dataarray[object]
metaobject
Data about the response, including pagination and collection totals.
example
{ "data": [ { "id": 82, "product_id": 195, "sort_order": 0, "enabled": true, "stop": false, "price_adjuster": { "adjuster": "relative", "adjuster_value": 8 }, "weight_adjuster": {}, "purchasing_disabled": false, "purchasing_disabled_message": "", "purchasing_hidden": false, "image_url": "", "conditions": [ { "rule_id": 82, "modifier_id": 221, "modifier_value_id": 175, "variant_id": 1, "combination_id": 0 } ] }, { "id": 83, "product_id": 195, "sort_order": 1, "enabled": true, "stop": false, "price_adjuster": {}, "weight_adjuster": { "adjuster": "relative", "adjuster_value": 3 }, "purchasing_disabled": false, "purchasing_disabled_message": "", "purchasing_hidden": false, "image_url": "", "conditions": [ { "rule_id": 83, "modifier_id": 221, "modifier_value_id": 174, "variant_id": 1, "combination_id": 0 } ] } ], "meta": { "pagination": { "total": 2, "count": 2, "per_page": 50, "current_page": 1, "total_pages": 1, "links": { "current": "?page=1&limit=50" } } } }
Create a Complex Rule
POST /stores/{store_hash}/v3/catalog/products/{product_id}/complex-rules
Request
Creates a product Complex Rule.
Required Fields
- modifier_id
- modifier_value_id
- variant_id
Read-Only Fields
- complex_rule_id
- conditions_id
- rule_id
- combination_id
- id
Authentication
- X-Auth-Token in header - required
Parameters
- store_hash in path - string
- Content-Type in header with default of application/json - string - required
The MIME type of the request body.
Body
Common ComplexRule properties.
product_idinteger
The unique numeric ID of the product with which the rule is associated; increments sequentially.
Example: 67
sort_orderinteger
The priority to give this rule when making adjustments to the product properties.
Example: 0
enabledboolean
Flag for determining whether the rule is to be used when adjusting a product's price, weight, image, or availabilty.
Example: true
stopboolean
Flag for determining whether other rules should not be applied after this rule has been applied.
purchasing_disabledboolean
Flag for determining whether the rule should disable purchasing of a product when the conditions are applied.
purchasing_disabled_messagestring
>= 0 characters<= 255 charactersMessage displayed on the storefront when a rule disables the purchasing of a product.
Example: This product is not available at this time.
purchasing_hiddenboolean
Flag for determining whether the rule should hide purchasing of a product when the conditions are applied.
image_urlstring
The URL for an image displayed on the storefront when the conditions are applied. Limit of 8MB per file.
Example: https://cdn8.bigcommerce.com/s-123456/product_images/d/fakeimage.png
price_adjusterobject
Adjuster for Complex Rules.
weight_adjusterobject
Adjuster for Complex Rules.
conditionsarray[object]
example
{ "product_id": 67, "sort_order": 0, "enabled": true, "stop": true, "purchasing_disabled": true, "purchasing_disabled_message": "This product is not available at this time.", "purchasing_hidden": true, "image_url": "https://cdn8.bigcommerce.com/s-123456/product_images/d/fakeimage.png", "price_adjuster": { "adjuster": "relative", "adjuster_value": 5 }, "weight_adjuster": { "adjuster": "relative", "adjuster_value": 5 }, "conditions": [ { "modifier_id": 55, "modifier_value_id": 256, "variant_id": 1 } ] }
Response
Body
dataobject
Common ComplexRule properties.
metaobject
Response metadata.
example
{ "data": { "id": 5, "product_id": 67, "sort_order": 0, "enabled": true, "stop": true, "purchasing_disabled": true, "purchasing_disabled_message": "This product is not available at this time.", "purchasing_hidden": true, "image_url": "https://cdn8.bigcommerce.com/s-123456/product_images/d/fakeimage.png", "price_adjuster": { "adjuster": "relative", "adjuster_value": 5 }, "weight_adjuster": { "adjuster": "relative", "adjuster_value": 5 }, "conditions": [ { "id": 3, "rule_id": 4, "modifier_id": 55, "modifier_value_id": 256, "variant_id": 1, "combination_id": 0 } ] }, "meta": {} }
Get a Complex Rule
GET /stores/{store_hash}/v3/catalog/products/{product_id}/complex-rules/{complex_rule_id}
Request
Returns a single Complex Rule. Optional parameters can be passed in.
Authentication
- X-Auth-Token in header - required
Parameters
- store_hash in path - string
- Accept in header with default of application/json - string - required
The MIME type of the response body.
- product_id in path - integer - required
The ID of the
Product
to which the resource belongs. - complex_rule_id in path - integer - required
The ID of the
ComplexRule
. - complex_rule_id in path - integer - required
The ID of the
ComplexRule
. - include_fields in query - string
Fields to include, in a comma-separated list. The ID and the specified fields will be returned.
- exclude_fields in query - string
Fields to exclude, in a comma-separated list. The specified fields will be excluded from a response. The ID cannot be excluded.
example
curl --request GET \ --url 'https://api.bigcommerce.com/stores/[store_hash]/v3/catalog/products/[product_id]/complex-rules/[complex_rule_id]' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'X-Auth-Token: xxxxxxxxxxxxxxxxx'
Response
Body
dataobject
Common ComplexRule properties.
metaobject
Response metadata.
example
{ "data": { "id": 5, "product_id": 67, "sort_order": 0, "enabled": true, "stop": true, "purchasing_disabled": true, "purchasing_disabled_message": "This product is not available at this time.", "purchasing_hidden": true, "image_url": "https://cdn8.bigcommerce.com/s-123456/product_images/d/fakeimage.png", "price_adjuster": { "adjuster": "relative", "adjuster_value": 5 }, "weight_adjuster": { "adjuster": "relative", "adjuster_value": 5 }, "conditions": [ { "id": 3, "rule_id": 4, "modifier_id": 55, "modifier_value_id": 256, "variant_id": 1, "combination_id": 0 } ] }, "meta": {} }
Update a Complex Rule
PUT /stores/{store_hash}/v3/catalog/products/{product_id}/complex-rules/{complex_rule_id}
Request
Updates a Complex Rule.
Required Fields:
- none
Read-Only Fields:
- complex_rule_id
- conditions_id
- rule_id
- combination_id
- id
Authentication
- X-Auth-Token in header - required
Parameters
- store_hash in path - string
- Content-Type in header with default of application/json - string - required
The MIME type of the request body.
- complex_rule_id in path - integer - required
The ID of the
ComplexRule
.
Body
Common ComplexRule properties.
product_idinteger
The unique numeric ID of the product with which the rule is associated; increments sequentially.
Example: 67
sort_orderinteger
The priority to give this rule when making adjustments to the product properties.
Example: 0
enabledboolean
Flag for determining whether the rule is to be used when adjusting a product's price, weight, image, or availabilty.
Example: true
stopboolean
Flag for determining whether other rules should not be applied after this rule has been applied.
purchasing_disabledboolean
Flag for determining whether the rule should disable purchasing of a product when the conditions are applied.
purchasing_disabled_messagestring
>= 0 characters<= 255 charactersMessage displayed on the storefront when a rule disables the purchasing of a product.
Example: This product is not available at this time.
purchasing_hiddenboolean
Flag for determining whether the rule should hide purchasing of a product when the conditions are applied.
image_urlstring
The URL for an image displayed on the storefront when the conditions are applied. Limit of 8MB per file.
Example: https://cdn8.bigcommerce.com/s-123456/product_images/d/fakeimage.png
price_adjusterobject
Adjuster for Complex Rules.
weight_adjusterobject
Adjuster for Complex Rules.
conditionsarray[object]
example
{ "product_id": 67, "sort_order": 0, "enabled": true, "stop": true, "purchasing_disabled": true, "purchasing_disabled_message": "This product is not available at this time.", "purchasing_hidden": true, "image_url": "https://cdn8.bigcommerce.com/s-123456/product_images/d/fakeimage.png", "price_adjuster": { "adjuster": "relative", "adjuster_value": 5 }, "weight_adjuster": { "adjuster": "relative", "adjuster_value": 5 }, "conditions": [ { "modifier_id": 55, "modifier_value_id": 256, "variant_id": 1 } ] }
Response
Body
dataobject
Common ComplexRule properties.
metaobject
Response metadata.
example
{ "data": { "id": 5, "product_id": 67, "sort_order": 0, "enabled": true, "stop": true, "purchasing_disabled": true, "purchasing_disabled_message": "This product is not available at this time.", "purchasing_hidden": true, "image_url": "https://cdn8.bigcommerce.com/s-123456/product_images/d/fakeimage.png", "price_adjuster": { "adjuster": "relative", "adjuster_value": 5 }, "weight_adjuster": { "adjuster": "relative", "adjuster_value": 5 }, "conditions": [ { "id": 3, "rule_id": 4, "modifier_id": 55, "modifier_value_id": 256, "variant_id": 1, "combination_id": 0 } ] }, "meta": {} }
Delete a Complex Rule
DELETE /stores/{store_hash}/v3/catalog/products/{product_id}/complex-rules/{complex_rule_id}
Request
Deletes a product Complex Rule.
Authentication
- X-Auth-Token in header - required
Parameters
- store_hash in path - string
- Accept in header with default of application/json - string - required
The MIME type of the response body.
- product_id in path - integer - required
The ID of the
Product
to which the resource belongs. - complex_rule_id in path - integer - required
The ID of the
ComplexRule
. - complex_rule_id in path - integer - required
The ID of the
ComplexRule
.
example
curl --request DELETE \ --url 'https://api.bigcommerce.com/stores/[store_hash]/v3/catalog/products/[product_id]/complex-rules/[complex_rule_id]' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'X-Auth-Token: xxxxxxxxxxxxxxxxx'