← Home
POST/hyax-api/v1/products/:id/variants

Create variant

Adds one variant. Prefer **Generate variants** for a full grid. Pin it to a combination with `options` (by name) or `optionValues` (by id); a combination that already has a live variant returns `409`. The SKU code is derived from the combination when omitted.

Base URL: https://platform.hyax.com · Replace YOUR_API_KEY with your team API key.

Request body

FieldRequiredDescription
skuNoSKU code, unique per product. Derived from the options/title when omitted
titleNoDisplay label, e.g. "Black / XS". Composed from the options when omitted
priceNoOverrides the product price. Null falls back to it
inventoryNo`null` is unlimited stock. Omitted defaults to 0 for `PHYSICAL`, unlimited otherwise
weightNoNumber, for shipping
imageNoImage URL shown when this variant is selected
unitsGrantedNoOverrides the product's wallet grant for this variant
optionsNoCombination by name: `[{ "group": "Color", "value": "Black" }]`
optionValuesNoCombination by id: `[{ "groupId": "color", "valueId": "black" }]`

Request

curl -X POST 'https://platform.hyax.com/hyax-api/v1/products/clx_example_id/variants' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "price": 34,
    "inventory": 10,
    "options": [
      {
        "group": "Color",
        "value": "Black"
      },
      {
        "group": "Size",
        "value": "XL"
      }
    ]
  }'

Response

{
  "success": true,
  "data": {
    "id": "clx…",
    "sku": "BLACK-XL",
    "title": "Black / XL",
    "price": 34,
    "inventory": 10,
    "isSoldOut": false,
    "isRetired": false,
    "variantRef": "BLACK-XL",
    "buyUrl": "https://shop.example.com/buy/studio-tee?variant=BLACK-XL"
  }
}