Skip to navigation

Create Complex Rule

Creates a product Complex Rule.

Required Fields

  • conditions
  • modifier_id
  • modifier_value_id
  • variant_id

Read-Only Fields

  • complex_rule_id
  • conditions_id
  • rule_id
  • combination_id
  • id

Authentication

X-Auth-Tokenstring

OAuth scopes

UI NamePermissionParameter
Productsmodifystore_v2_products
Productsread-onlystore_v2_products_read_only

Authentication header

HeaderArgumentDescription
X-Auth-Tokenaccess_tokenFor more about API accounts that generate access_tokens, see our Guide to API Accounts.

Further reading

For example requests and more information about authenticating BigCommerce APIs, see Authentication and Example Requests.

For more about BigCommerce OAuth scopes, see our Guide to API Accounts.

For a list of API status codes, see API Status Codes.

Path parameters

product_idintegerRequired

The ID of the Product to which the resource belongs.

store_hashstringRequired
Permanent ID of the BigCommerce store.

Headers

AcceptstringRequiredDefaults to application/json

The MIME type of the response body.

Request

Common ComplexRule properties.
conditionslist of objectsRequired
sort_orderintegerOptional-2147483648-2147483647
The priority to give this rule when making adjustments to the product properties.
enabledbooleanOptional

Flag for determining whether the rule is to be used when adjusting a productʼs price, weight, image, or availabilty.

stopbooleanOptional
Flag for determining whether other rules should not be applied after this rule has been applied.
purchasing_disabledbooleanOptional
Flag for determining whether the rule should disable purchasing of a product when the conditions are applied.
purchasing_disabled_messagestringOptional0-255 characters
Message displayed on the storefront when a rule disables the purchasing of a product.
purchasing_hiddenbooleanOptional
Flag for determining whether the rule should hide purchasing of a product when the conditions are applied.
image_urlstringOptional
The URL for an image displayed on the storefront when the conditions are applied. Limit of 8MB per file.
price_adjusterobjectOptional
Adjuster for Complex Rules.
weight_adjusterobjectOptional
Adjuster for Complex Rules.

Response

OK
dataobjectOptional
Common ComplexRule properties.
metaobjectOptional
Response metadata.

Errors

409
Conflict Error
422
Unprocessable Entity Error