Variants
The combinations of option values a product is sold in, each with its own price, SKU, weight and stock.
Endpoints#
- GET
/products/{product_id}/variants.jsonList a product's variants - GET
/products/{product_id}/variants/count.jsonCount a product's variants - GET
/variants/{id}.jsonGet a variant - POST
/products/{product_id}/variants.jsonAdd a variant to a product - PUT
/variants/{id}.jsonUpdate a variant - DELETE
/products/{product_id}/variants/{id}.jsonDelete a variant
Paths are relative to https://store.weftgrid.com/api/admin/2026-10. The examples read the token from $STORELOOM_TOKEN and ids from variables like $ORDER_ID.
List a product's variants#
GET
/products/{product_id}/variants.jsonread_productsRequest
curl "https://store.weftgrid.com/api/admin/2026-10/products/$PRODUCT_ID/variants.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{ "variants": [ … ] }Count a product's variants#
GET
/products/{product_id}/variants/count.jsonread_productsRequest
curl "https://store.weftgrid.com/api/admin/2026-10/products/$PRODUCT_ID/variants/count.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{ "count": 8 }Get a variant#
GET
/variants/{id}.jsonread_productsRequest
curl "https://store.weftgrid.com/api/admin/2026-10/variants/$VARIANT_ID.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{ "variant": { "id": "…", "product_id": "…", "price": "58.00", … } }Add a variant to a product#
POST
/products/{product_id}/variants.jsonwrite_productsRequest body
{ "variant": { "option1": "XL", "price": "62.00", "sku": "LINEN-XL", "inventory_quantity": 4 } }Request with curl
curl -X POST "https://store.weftgrid.com/api/admin/2026-10/products/$PRODUCT_ID/variants.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "variant": { "option1": "XL", "price": "62.00", "sku": "LINEN-XL", "inventory_quantity": 4 } }'Example responseShowHide
{ "variant": { … } }Update a variant#
PUT
/variants/{id}.jsonwrite_productsPrice, compare_at_price, cost_per_item, sku, barcode, grams, inventory_policy, inventory_management, requires_shipping, taxable, image_src and option values. Stock changes go through inventory_levels.
Request body
{ "variant": { "price": "54.00", "compare_at_price": "58.00" } }Request with curl
curl -X PUT "https://store.weftgrid.com/api/admin/2026-10/variants/$VARIANT_ID.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "variant": { "price": "54.00", "compare_at_price": "58.00" } }'Example responseShowHide
{ "variant": { … } }Delete a variant#
DELETE
/products/{product_id}/variants/{id}.jsonwrite_productsRequest
curl -X DELETE "https://store.weftgrid.com/api/admin/2026-10/products/$PRODUCT_ID/variants/$VARIANT_ID.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{}