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.
https://your-store-url.com/api
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.
This request returns all option combinations for the specified product.
| Parameter | Type | Description |
|---|---|---|
product_id* |
integer | The unique identifier of the product |
GET /api/combinations/?product_id=12
[
{
"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"
}
]
| 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 |
combination object, first retrieve the product options using GET /api/options/?product_id={id}.
In the example above: