Product option exceptions allow you to define combinations of options that should not be available together. This endpoint enables you to create new exceptions for your products.
Creates a new option exception for a specific product.
Pass the following parameters in the HTTP request body according to your specified Content-Type
:
Parameter | Type | Required | Description |
---|---|---|---|
product_id* | integer | Yes | The unique identifier of the product that the exception is associated with. |
combination | object | No | The options and variants that comprise the exception. The object keys are option IDs and values are variant IDs. |
combination
object should have the Checkbox, Select box, or Radiogroup type and be available for the product.
-1
as a variant value to indicate "any variant" of an option. This allows you to create more flexible exceptions.
{ "product_id": "12", "combination": { "3": "-1", "4": "19", "17": "61" } }
This request creates a new exception for the product with product_id=12
. This exception describes the following combination of variants that should not be available together:
{ "exception_id": "10" }
Returned when the exception couldn't be created due to invalid parameters or other issues.
Option exceptions are useful for defining rules about which combinations of options shouldn't be available together. This can be helpful when:
-1
as a variant ID (meaning "any variant") allows you to create broader rules. For example, you can specify that a particular color option should never be combined with any size variant of another option.
Here are some common scenarios where option exceptions are useful: