Products
Retrieve Product Variant
Retrieve a single variant of a product.
GET
/
vendor
/
products
/
{id}
/
variants
/
{variant_id}
curl 'http://localhost:9000/vendor/products/prod_01HXYZ/variants/variant_01HXYZ' \
-H 'Authorization: Bearer <token>' \
-H 'x-seller-id: <seller_id>'
const { variant } = await client.vendor.products.$id.variants.$variant_id.query({
$id: "prod_01HXYZ",
$variant_id: "variant_01HXYZ",
})
{
"variant": {
"id": "variant_01HXYZ",
"title": "M",
"sku": "ACME-SHIRT-M",
"product_id": "prod_01HXYZ",
"manage_inventory": false,
"allow_backorder": false,
"options": [
{ "id": "optval_01HXYZ", "value": "M", "option": { "id": "opt_01HXYZ", "title": "Size" } }
]
}
}
Returns a variant scoped to the given product.
Path parameters
string
required
The product’s ID.
string
required
The variant’s ID.
Query parameters
string
Comma-separated fields to include in the response. Prefix with
+/- to add to or remove from the defaults.Response
object
Show properties
Show properties
string
The variant’s ID.
string
The variant’s title.
string
The variant’s SKU.
string
EAN barcode.
string
UPC barcode.
string
Generic barcode.
string
ID of the parent product.
boolean
Whether inventory is managed for the variant.
boolean
Whether backorders are allowed.
number
Sort rank of the variant.
object[]
Selected option values with
id, value, and the parent option.object[]
Variant images with
id, url, and rank.object
Custom key-value pairs.
curl 'http://localhost:9000/vendor/products/prod_01HXYZ/variants/variant_01HXYZ' \
-H 'Authorization: Bearer <token>' \
-H 'x-seller-id: <seller_id>'
const { variant } = await client.vendor.products.$id.variants.$variant_id.query({
$id: "prod_01HXYZ",
$variant_id: "variant_01HXYZ",
})
{
"variant": {
"id": "variant_01HXYZ",
"title": "M",
"sku": "ACME-SHIRT-M",
"product_id": "prod_01HXYZ",
"manage_inventory": false,
"allow_backorder": false,
"options": [
{ "id": "optval_01HXYZ", "value": "M", "option": { "id": "opt_01HXYZ", "title": "Size" } }
]
}
}
⌘I
curl 'http://localhost:9000/vendor/products/prod_01HXYZ/variants/variant_01HXYZ' \
-H 'Authorization: Bearer <token>' \
-H 'x-seller-id: <seller_id>'
const { variant } = await client.vendor.products.$id.variants.$variant_id.query({
$id: "prod_01HXYZ",
$variant_id: "variant_01HXYZ",
})
{
"variant": {
"id": "variant_01HXYZ",
"title": "M",
"sku": "ACME-SHIRT-M",
"product_id": "prod_01HXYZ",
"manage_inventory": false,
"allow_backorder": false,
"options": [
{ "id": "optval_01HXYZ", "value": "M", "option": { "id": "opt_01HXYZ", "title": "Size" } }
]
}
}