This endpoint allows you to retrieve all option exceptions for a specific product. Option exceptions define rules for which combinations of product options are not available.
https://your-store-url.com/api
Product option exceptions define invalid combinations of product options. For example, if a T-shirt comes in multiple colors and sizes, but the "Small" size is not available in "Red", you would create an exception for this combination.
This request returns all option exceptions for the specified product.
Parameter | Type | Description |
---|---|---|
product_id * |
integer | The unique identifier of the product |
GET /api/exceptions/?product_id=12
[ { "exception_id": "1", "product_id": "12", "combination": { "3": "12", "4": "17", "17": "-1" } }, { "exception_id": "4", "product_id": "12", "combination": { "3": "13", "4": "17", "17": "-2" } }, { "exception_id": "5", "product_id": "12", "combination": { "3": "16", "4": "-1", "17": "-2" } } ]
Field | Type | Description |
---|---|---|
exception_id |
string | Unique identifier of the exception |
product_id |
string | ID of the product that this exception belongs to |
combination |
object |
Object representing the invalid combination of product options. The keys are option IDs and the values are variant IDs or special values: -1 — Any variant of this option-2 — No variant of this option
|
combination
object, first retrieve the product options using GET /api/options/?product_id={id}
.
In the combination
object:
-1
: Represents "any variant" of this option-2
: Represents "no variant" of this optionLet's interpret the first exception in the example response:
{
"3": "12",
"4": "17",
"17": "-1"
}
This might mean: "The Small size (variant ID 12 of option ID 3) is not available in Black/White color (variant ID 17 of option ID 4) with any variant of option ID 17 (which could be a material option)."