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
Query parameters
Comma-separated fields to include in the response. Prefix with
+/- to add to or remove from the defaults.Response
Show properties
Show properties
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" } }
]
}
}