List Option Combinations of a Product - Venddor API

List Product Option Combinations

This endpoint allows you to retrieve all option combinations for a specific product. Option combinations define the different possible variants of a product based on its configurable options.

Base URL: https://your-store-url.com/api

What are Product Option Combinations?

Product option combinations represent the different variations of a product that can be purchased. For example, if a T-shirt comes in 3 colors and 5 sizes, there would be 15 possible combinations (3 × 5). Each combination can have its own price, inventory, product code, etc.

Endpoint Details

GET /api/combinations/?product_id={id}

This request returns all option combinations for the specified product.

Query Parameters

Parameter Type Description
product_id* integer The unique identifier of the product

Example Request

GET /api/combinations/?product_id=12

Response Example

[
  {
    "combination_id": "128",
    "product_id": "12",
    "product_code": "T-SHIRT-BLK-S",
    "combination_hash": "3_12-4_17",
    "combination": {
      "3": "12",
      "4": "17"
    },
    "amount": "0.000",
    "stock": "25",
    "position": "0"
  },
  {
    "combination_id": "129",
    "product_id": "12",
    "product_code": "T-SHIRT-BLK-M",
    "combination_hash": "3_13-4_17",
    "combination": {
      "3": "13",
      "4": "17"
    },
    "amount": "0.000",
    "stock": "30",
    "position": "0"
  }
]

Response Fields

Field Type Description
combination_id string Unique identifier of the combination
product_id string ID of the product that this combination belongs to
product_code string SKU or product code specific to this combination
combination_hash string A unique hash representing this combination in format "option_id_variant_id-option_id_variant_id"
combination object Object representing the combination of product options.
The keys are option IDs and the values are variant IDs.
amount string Price adjustment for this combination (added to the base product price)
stock string Inventory level for this specific combination
position string Display position of this combination
Tip: To understand the meaning of the option and variant IDs in the combination object, first retrieve the product options using GET /api/options/?product_id={id}.

Understanding Combination Values

In the example above:

Common Use Cases