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

Reorder variants

Sets the order buyers see variants in, and therefore which one the product-level buy link selects by default. Send every live variant id exactly once, or the request is rejected as stale.

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

Request body

FieldRequiredDescription
variantIds Required Every live variant id, in the desired order

Request

curl -X POST 'https://platform.hyax.com/hyax-api/v1/products/clx_example_id/variants/reorder' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "variantIds": [
      "clx_black_xs",
      "clx_black_s",
      "clx_white_xs"
    ]
  }'

Response

{
  "success": true,
  "data": [
    { "id": "clx_black_xs", "sku": "BLACK-XS", "sortOrder": 0 },
    { "id": "clx_black_s", "sku": "BLACK-S", "sortOrder": 1 },
    { "id": "clx_white_xs", "sku": "WHITE-XS", "sortOrder": 2 }
  ],
  "exposesVariants": true
}