Skip to main content
GET
/
vendor
/
products
/
{id}
/
variants
curl 'http://localhost:9000/vendor/products/prod_01HXYZ/variants?limit=20' \
  -H 'Authorization: Bearer <token>' \
  -H 'x-seller-id: <seller_id>'
{
  "variants": [
    {
      "id": "variant_01HXYZ",
      "title": "M",
      "sku": "ACME-SHIRT-M",
      "product_id": "prod_01HXYZ",
      "manage_inventory": false,
      "allow_backorder": false
    }
  ],
  "count": 1,
  "offset": 0,
  "limit": 20
}
Returns the variants belonging to the given product.

Path parameters

id
string
required
The product’s ID.

Query parameters

limit
number
default:"50"
The maximum number of variants to return.
offset
number
default:"0"
The number of variants to skip before returning results.
order
string
The field to sort by, e.g. variant_rank or -created_at.
fields
string
Comma-separated fields to include in the response. Prefix with +/- to add to or remove from the defaults.
q
string
Search term matched against variant fields.
manage_inventory
boolean
Filter by whether inventory is managed for the variant.
allow_backorder
boolean
Filter by whether backorders are allowed.
created_at
object
Filter by creation date using operators like $gt, $lt, $gte, $lte.
updated_at
object
Filter by update date using operators like $gt, $lt, $gte, $lte.
$and
object[]
Join multiple filter objects with a logical AND.
$or
object[]
Join multiple filter objects with a logical OR.

Response

variants
object[]
count
number
Total number of matching variants.
offset
number
Number of skipped variants.
limit
number
Maximum number of returned variants.
curl 'http://localhost:9000/vendor/products/prod_01HXYZ/variants?limit=20' \
  -H 'Authorization: Bearer <token>' \
  -H 'x-seller-id: <seller_id>'
{
  "variants": [
    {
      "id": "variant_01HXYZ",
      "title": "M",
      "sku": "ACME-SHIRT-M",
      "product_id": "prod_01HXYZ",
      "manage_inventory": false,
      "allow_backorder": false
    }
  ],
  "count": 1,
  "offset": 0,
  "limit": 20
}