List variants
Returns variants for a product.
GET
/products/{product_id}/variantsAuthorization
AuthorizationBearer token (JWT) · headerrequiredPath parameters
product_idstringrequiredProduct ID or slug
Query parameters
pageintegerdefault: 1
per_pageintegerdefault: 20
Responses
200Paginated variants list
_embeddedobjectShow propertiesHide properties
itemsVariant[]Show propertiesHide properties
Array of
Variant_linksHalLinksidintegerproduct_idintegernamestringDisplay name, computed from option1/option2/option3.
statusstringAllowed:
visiblehiddenskustringbarcode_numberstringoption1stringoption2stringoption3stringcurrency_codestringregular_priceintegerRegular price in cents
sale_priceinteger | nullSale price in cents
priceintegerEffective price in cents (sale_price if set, else regular_price)
online_stockintegerall_stockintegeravailable_if_no_stockbooleanweight_in_gramsintegerunit_quantitynumbercolorstringcostintegerprofitintegerstocksobject[]Per-location stock breakdown
Show propertiesHide properties
Array of
objectlocation_idintegeravailable_unitsintegertotal_unitsintegerRequest
curl -X GET "https://api.onbolder.com/v2/products/101/variants" \
-H "Authorization: Bearer YOUR_TOKEN"const response = await fetch("https://api.onbolder.com/v2/products/101/variants", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_TOKEN"
}
});import requests
response = requests.get(
"https://api.onbolder.com/v2/products/101/variants",
headers={
"Authorization": "Bearer YOUR_TOKEN"
},
)Response
{
"_class": [
"results",
"variants"
],
"total_items": 3,
"per_page": 20,
"page": 1,
"_embedded": {
"items": [
{
"id": 201,
"product_id": 101,
"name": "Small",
"sku": "WH-001-S",
"option1": "Small",
"currency_code": "USD",
"regular_price": 8999,
"price": 8999,
"online_stock": 10
}
]
}
}