Product Option Exception Details

Exception Details Overview

This section describes the fields that represent various details of a product option exception. Exceptions allow you to define special pricing or availability for specific combinations of product options.

Note: The Venddor REST API always accepts and returns data as strings and arrays/objects. The Values column in the table indicates the expected data type for each field.

Field Reference

Field Values Description
exception_id integer A unique identifier of the exception.
product_id integer A unique identifier of the product that the exception is associated with.
combination object The options and their variants that comprise the exception.

Example of an Exception Object

{
  "exception_id": 42,
  "product_id": 123,
  "combination": {
    "option_1": "variant_a",
    "option_2": "variant_b"
  }
}

Working with Exception Combinations

The combination object represents the specific set of product options that trigger this exception. Each key in the combination object corresponds to an option ID, and its value corresponds to the variant ID.

Tip: When creating product option exceptions, ensure that the combination specifies valid option and variant IDs that exist for the product.

Using Exceptions in API Requests

GET /product_option_exceptions/:id

Retrieves a specific product option exception by its ID.

Example Response

{
  "exception_id": 42,
  "product_id": 123,
  "combination": {
    "color": "red",
    "size": "large"
  },
  "price": 29.99,
  "in_stock": true,
  "amount": 15
}
POST /product_option_exceptions

Creates a new product option exception.

Example Request

{
  "product_id": 123,
  "combination": {
    "color": "blue",
    "size": "medium"
  },
  "price_modifier": 5.00,
  "modifier_type": "A"
}
Note: In this example, we're creating an exception that adds $5.00 to the base price of the product when the "blue" color and "medium" size options are selected.