> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mercurjs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Product Variant

> Update a variant of a product.

Updates the variant and returns the parent product.

## Path parameters

**id** `string` *required*

The product's ID.

**variant\_id** `string` *required*

The variant's ID.

## Body parameters

**title** `string`

Variant title.

**sku** `string`

Variant SKU.

**ean** `string`

Variant EAN.

**upc** `string`

Variant UPC.

**isbn** `string`

Variant ISBN.

**asin** `string`

Variant ASIN.

**gtin** `string`

Variant GTIN.

**barcode** `string`

Variant barcode.

**hs\_code** `string`

Harmonized System code.

**mid\_code** `string`

Manufacturer identification code.

**thumbnail** `string`

URL of the variant thumbnail.

**variant\_rank** `number`

Sort rank of the variant.

**weight** `number`

Variant weight.

**length** `number`

Variant length.

**height** `number`

Variant height.

**width** `number`

Variant width.

**origin\_country** `string`

Country of origin.

**material** `string`

Variant material.

**prices** `object[]`

Variant prices.

**properties**

**id** `string`

Existing price ID to update.

**currency\_code** `string`

Price currency code.

**amount** `number`

Price amount.

**min\_quantity** `number`

Minimum quantity for the price to apply.

**max\_quantity** `number`

Maximum quantity for the price to apply.

**rules** `object`

Map of rule attribute to value.

**options** `object`

Map of option title to option value.

**metadata** `object`

Custom key-value data.

**additional\_data** `object`

Custom data passed to workflow hooks.

## Response

**product** `object`

**properties**

**id** `string`

The product's ID.

**title** `string`

Product title.

**variants** `object[]`

All variants, including the updated one.

**updated\_at** `string`

Last update timestamp.

```bash cURL theme={null}
curl -X POST 'http://localhost:9000/admin/products/prod_01HXYZABCDEF/variants/variant_01HXYZABCDEF' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"sku": "LS-M-2026"}'
```

```ts JS Client theme={null}
const { product } = await client.admin.products.$id.variants.$variant_id.mutate({
  $id: "prod_01HXYZABCDEF",
  $variant_id: "variant_01HXYZABCDEF",
  sku: "LS-M-2026",
})
```

```json 200 theme={null}
{
  "product": {
    "id": "prod_01HXYZABCDEF",
    "title": "Linen Shirt",
    "variants": [
      { "id": "variant_01HXYZABCDEF", "title": "M", "sku": "LS-M-2026" }
    ]
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.