---
search:
  tags:
    - Variants
    - PUT
seo:
  description: >-
    Variant names are set via option1/option2/option3. On update,… Reference for
    the PUT /products/{product_id}/variants/{id} endpoint in the Bolder API v2.
sidebar:
  label: Update a variant
  badge: PUT
title: Update a variant
type: openapi-operation
---
Variant names are set via `option1`/`option2`/`option3`. On update, `stocks` accepts `available_units`/`total_units` in addition to `location_id`.

`PUT /products/{product_id}/variants/{id}`

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

- `position` (integer) — Ordering position within the product (lower comes first).
- `sku` (string)
- `barcode_number` (string)
- `option1` (string)
- `option2` (string)
- `option3` (string)
- `option_values` (object) — Custom variant option values, keyed by \`option1\`/\`option2\`/\`option3\`.
- `option_asset_ids` (object) — Asset IDs to associate with each option value.
- `product_asset_ids` (integer[]) — Product image asset IDs to associate with this variant.
- `color` (string)
- `regular_price` (integer)
- `sale_price` (integer)
- `cost` (integer) — Cost in cents (for margin reporting, not shown to buyers).
- `status` (string)
- `available_if_no_stock` (boolean)
- `weight_in_grams` (integer)
- `unit_quantity` (number)
- `online_stock` (integer)
- `stocks` (object[])

Request body example:

```json
{
  "regular_price": 7999
}
```

**Responses**

- `200` — Variant updated

Response example, 200:

```json
{
  "_links": {
    "property1": {
      "href": "string",
      "templated": true,
      "method": "get",
      "title": "string",
      "type": "string"
    },
    "property2": {
      "href": "string",
      "templated": true,
      "method": "get",
      "title": "string",
      "type": "string"
    }
  },
  "id": 0,
  "product_id": 0,
  "name": "string",
  "position": 0,
  "status": "visible",
  "sku": "string",
  "barcode_number": "string",
  "option1": "string",
  "option2": "string",
  "option3": "string",
  "currency_code": "string",
  "regular_price": 0,
  "sale_price": 0,
  "price": 0,
  "online_stock": 0,
  "all_stock": 0,
  "available_if_no_stock": true,
  "weight_in_grams": 0,
  "unit_quantity": 0,
  "color": "string",
  "cost": 0,
  "profit": 0,
  "stocks": [
    {
      "location_id": 0,
      "available_units": 0,
      "total_units": 0
    }
  ]
}
```
