---
search:
  tags:
    - Variants
    - POST
seo:
  description: >-
    Creates a new variant for a product. Reference for the POST
    /products/{product_id}/variants endpoint in the Bolder API v2.
sidebar:
  label: Create a variant
  badge: POST
title: Create a variant
type: openapi-operation
---
Creates a new variant for a product.

`POST /products/{product_id}/variants`

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

- `id` (integer) — Pre-assign a specific variant ID (rarely used; usually omitted).
- `position` (integer) — Ordering position within the product (lower comes first). On a \`chained\_variants\` product, omitting it defaults to the current highest position instead of 0.
- `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.
- `sku` (string)
- `barcode_number` (string)
- `regular_price` (integer) — In cents. Required if the product has per-variant prices.
- `sale_price` (integer) — In cents
- `cost` (integer)
- `weight_in_grams` (integer)
- `unit_quantity` (number)
- `color` (string)
- `available_if_no_stock` (boolean)
- `online_stock` (integer)
- `status` (string)
- `stocks` (object[])

Request body example:

```json
{
  "option1": "Large",
  "sku": "WH-001-L",
  "regular_price": 8999,
  "stocks": [
    {
      "location_id": 1,
      "units": 15
    }
  ]
}
```

**Responses**

- `201` — Variant created

Response example, 201:

```json
{
  "id": 202,
  "product_id": 101,
  "name": "Large",
  "sku": "WH-001-L",
  "regular_price": 8999,
  "price": 8999
}
```
