Browse the API docs

Variants

The combinations of option values a product is sold in, each with its own price, SKU, weight and stock.

Endpoints#

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_products
Request
curl "https://store.weftgrid.com/api/admin/2026-10/products/$PRODUCT_ID/variants.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{ "variants": [ … ] }

Count a product's variants#

GET/products/{product_id}/variants/count.jsonread_products
Request
curl "https://store.weftgrid.com/api/admin/2026-10/products/$PRODUCT_ID/variants/count.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{ "count": 8 }

Get a variant#

GET/variants/{id}.jsonread_products
Request
curl "https://store.weftgrid.com/api/admin/2026-10/variants/$VARIANT_ID.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{ "variant": { "id": "…", "product_id": "…", "price": "58.00", … } }

Add a variant to a product#

POST/products/{product_id}/variants.jsonwrite_products
Request 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 responseShow
{ "variant": { … } }

Update a variant#

PUT/variants/{id}.jsonwrite_products

Price, 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 responseShow
{ "variant": { … } }

Delete a variant#

DELETE/products/{product_id}/variants/{id}.jsonwrite_products
Request
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 responseShow
{}