You can use exceptions to make specific combinations of product options that the customers won't be able to select. For example, if you sell a T-shirt in various colors and sizes, you can make a certain color unavailable for a specific size.
Exceptions are somewhat similar to option combinations—they both include the combination object with variants of different options.
https://www.venddor.com.br/api/2.0/products/{product_id}/exceptions
Only the options that have variants can be a part of an exception. This includes options of the following types: Checkbox, Select box, and Radiogroup.
There are two types of exceptions:
combination object.combination object.The type of the exception is determined by the product that the exception is associated with. A product has a field called exceptions_type, that can have either A (allowed) or F (forbidden) as its value.
F (forbidden) is the default value of the exceptions_type field of the product.
Retrieves all option exceptions for a specific product.
Retrieves details for a specific option exception.
Creates a new option exception for a product.
Updates an existing option exception.
Deletes an option exception.
{
"exception_id": "42",
"product_id": "423",
"combination": {
"16": "43", // option_id: variant_id (Color: White)
"17": "52" // option_id: variant_id (Size: XL)
}
}
In this example, if the product's exceptions_type is:
F (forbidden) - Customers won't be able to select the "White" color in "XL" sizeA (allowed) - Customers will only be able to select the "White" color in "XL" size, and no other combinations// First, set the exceptions_type for the product (if needed)
PUT /api/2.0/products/423
{
"exceptions_type": "F" // F - forbidden, A - allowed
}
// Then create the exception
POST /api/2.0/products/423/exceptions
{
"combination": {
"16": "43", // Color: White
"17": "52" // Size: XL
}
}
Use forbidden exceptions (exceptions_type="F") when most combinations are valid and you only need to exclude a few specific ones. Common use cases include:
Use allowed exceptions (exceptions_type="A") when only a few specific combinations are valid and most combinations should be unavailable. Common use cases include: