---
search:
  tags:
    - Variants
    - PUT
seo:
  description: >-
    Updates an existing variant. You can also look up the variant by sku…
    Reference for the PUT /shops/{shop_id}/variants/{id} endpoint in the Bolder
    API v1.
sidebar:
  label: Update variant
  badge: PUT
title: Update variant
type: openapi-operation
---
Updates an existing variant. You can also look up the variant by `sku` instead of `id`
by passing `?sku=YOUR_SKU` as a query parameter. Requires `admin` scope.

`PUT /shops/{shop_id}/variants/{id}`

**Request body** (`application/json`, required)

- `title` (string) — Required on create
- `position` (integer) — Ordering position (lower comes first). On a chained-variants product, omitting it on create defaults to the current highest position instead of 0.
- `sku` (string) — Must be unique within the shop
- `stock` (integer)
- `available_if_no_stock` (integer) — \`1\` = always available, \`0\` = unavailable when out of stock
- `weight_in_grams` (integer)
- `price` (integer) — Override product price for this variant (cents)
- `price_comparison` (integer) — Override comparison price for this variant (cents)

Request body example:

```json
{
  "title": "string",
  "position": 0,
  "sku": "string",
  "stock": 1,
  "available_if_no_stock": 0,
  "weight_in_grams": 0,
  "price": 0,
  "price_comparison": 0
}
```

**Responses**

- `200` — Variant updated
- `422` — Validation errors

Response example, 200:

```json
{
  "id": 0,
  "title": "string",
  "position": 0,
  "sku": "string",
  "price": 0,
  "price_comparison": 0,
  "stock": 0,
  "available_if_no_stock": true,
  "weight_in_grams": 0,
  "_links": {}
}
```

Response example, 422:

```json
{
  "_class": [
    "errors"
  ],
  "_embedded": {
    "errors": [
      {
        "_class": [
          "error"
        ],
        "field": "product.title",
        "messages": [
          "can't be blank"
        ]
      }
    ]
  }
}
```
