Option combinations allow you to manage product variations based on different option selections. For example, a T-shirt might have combinations of size and color options (e.g., "Small/Red", "Medium/Blue"). This documentation describes the fields and properties of option combinations in the Venddor API.
The following table provides a comprehensive list of all fields available for product option combinations:
Parameter | Values | Description |
---|---|---|
product_id | integer | The unique identifier of the product that the option combination is associated with. |
product_code | string | The product code of the option combination. This can be used as a SKU (Stock Keeping Unit) for inventory management. |
combination_hash | string | The hash of the option combination, which serves as a unique identifier for the specific combination of option variants. |
combination | object | The options and variants that comprise the combination. This object contains key-value pairs where the key is the option_id and the value is the variant_id. |
amount | integer | Determines how many items of this combination are in stock. This field is used for inventory tracking. |
position | integer | The lower this number, the higher the option combination appears on the list in the Administration panel. |
image_pairs | object | The information about the images associated with the option combination. This allows for different product images based on the selected combination (e.g., different images for different color variants). |
product_code
values for each combination makes inventory management and order fulfillment much easier, especially for products with many variations.
{ "product_id": "101", "product_code": "TSH-BLK-M", "combination_hash": "842135592", "combination": { "12": "35", // Size (option_id: 12) = Medium (variant_id: 35) "14": "41" // Color (option_id: 14) = Black (variant_id: 41) }, "amount": "25", "position": "20", "image_pairs": { "pair_id": "123", "image_id": "456", "detailed_id": "789", "position": "0", "detailed": { "image_path": "http://example.com/images/detailed/0/tshirt_black_m.jpg", "alt": "Black T-shirt Medium Size", "image_x": "800", "image_y": "1200", "http_image_path": "http://example.com/images/detailed/0/tshirt_black_m.jpg", "https_image_path": "https://example.com/images/detailed/0/tshirt_black_m.jpg" }, "icon": { "image_path": "http://example.com/images/thumbnails/0/tshirt_black_m_thumb.jpg", "alt": "Black T-shirt Medium Size", "image_x": "200", "image_y": "300", "http_image_path": "http://example.com/images/thumbnails/0/tshirt_black_m_thumb.jpg", "https_image_path": "https://example.com/images/thumbnails/0/tshirt_black_m_thumb.jpg" } } }
Option combinations are particularly important for inventory management. When a product has multiple options (like size and color), each unique combination can have its own inventory level.
For inventory tracking to work with option combinations, you need to ensure:
inventory="Y"
settingamount
valueRetrieves all option combinations for a specific product.
Parameter | Type | Required | Description |
---|---|---|---|
product_id* | integer | Yes | The unique identifier of the product |
Retrieves details of a specific option combination.
Parameter | Type | Required | Description |
---|---|---|---|
combination_hash* | string | Yes | The unique hash of the option combination |
Creates a new option combination for a product.
Parameter | Type | Required | Description |
---|---|---|---|
product_id* | integer | Yes | The unique identifier of the product |
Parameter | Type | Required | Description |
---|---|---|---|
product_code | string | No | The product code for this specific combination |
combination* | object | Yes | The options and variants that comprise the combination |
amount | integer | No | The quantity in stock for this combination |
position | integer | No | The position of this combination in the list |
combination
object exist and are associated with the specified product. Using invalid option or variant IDs will result in an error.