> This page is for Developer.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.bigcommerce.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.bigcommerce.com/_mcp/server.

# Create Product Variant Option Value

POST https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/products/{product_id}/options/{option_id}/values
Content-Type: application/json

Creates a *Variant Option Value*.

**Required Fields**
* label
* sort_order

**Read-Only Fields**
* id
* is_default

**Limits**
* 250 option values per option limit.

> `is_default` is derived from the parent option configuration and cannot be set on individual values. To change which value is the default, use [Update Product Variant Option](/developer/api-reference/rest/admin/catalog/product-variant-options/update-product-variant-option) and include the full `option_values` array with the desired `is_default` flags.

Reference: https://docs.bigcommerce.com/developer/api-reference/rest/admin/catalog/product-variant-options/values/create-product-variant-option-value

## Authentication

- `X-Auth-Token` header (required) — ### OAuth scopes | UI Name | Permission | Parameter | |:--------|:-----------|:----------| | Products | modify | `store_v2_products` | | Products | read-only | `store_v2_products_read_only` | ### Authentication header | Header | Argument | Description | |:-------|:---------|:------------| | `X-Auth-Token` | `access_token` | For more about API accounts that generate `access_token`s, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts#api-accounts). | ### Further reading For example requests and more information about authenticating BigCommerce APIs, see [Authentication and Example Requests](/developer/docs/overview/api-fundamentals/api-accounts#x-auth-token-header-example-requests). For more about BigCommerce OAuth scopes, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts#oauth-scopes). For a list of API status codes, see [API Status Codes](/developer/api-reference/rest/overview#rest-http-status-codes).

## Request

### Path parameters

- `product_id` (integer, required) — The ID of the `Product` to which the resource belongs.
- `option_id` (integer, required) — The ID of the `Option`.
- `store_hash` (string, required) — Permanent ID of the BigCommerce store.

### Headers

- `Accept` (string, required, default: application/json) — The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body.

### Body (application/json)

This endpoint expects an object.

- `label` (string, required) — The text display identifying the value on the storefront. Required in a /POST.
- `sort_order` (integer, required) — The order in which the value will be displayed on the product page. Required in a /POST.
- `is_default` (boolean, optional) — The flag for preselecting a value as the default on the storefront. This field is not supported for swatch options/modifiers. Read-only on this endpoint; use [Update Product Variant Option](/developer/api-reference/rest/admin/catalog/product-variant-options/update-product-variant-option) with the full `option_values` array to change the default.
- `value_data` (CatalogProductsProductIdOptionsOptionIdValuesPostRequestBodyContentApplicationJsonSchemaValueData, optional) — Extra data describing the value, based on the type of option or modifier with which the value is associated. The `swatch` type option can accept an array of `colors`, with up to three hexidecimal color keys; or an `image_url`, which is a full image URL path including protocol. The `product list` type option requires a `product_id`. The `checkbox` type option requires a boolean flag, called `checked_value`, to determine which value is considered to be the checked state.

## Response

### 200

OK

- `data` (CatalogProductsProductIdOptionsOptionIdValuesPostResponsesContentApplicationJsonSchemaData, optional) — Common Option Value properties.
- `meta` (metaEmpty_Full, optional) — Response metadata.

## Errors

### 422 Unprocessable Entity Error

The `OptionValue` was not valid. This is the result of missing required fields, or of invalid data. See the response for more details.

- `errors` (CatalogProductsProductIdOptionsOptionIdValuesPostResponsesContentApplicationJsonSchemaErrors, optional)
- `instance` (string, optional)
- `status` (integer, optional) — The HTTP status code.
- `title` (string, optional) — The error title describing the particular error.
- `type` (string, optional)

## Types

### CatalogProductsProductIdOptionsOptionIdValuesPostRequestBodyContentApplicationJsonSchemaValueData

Extra data describing the value, based on the type of option or modifier with which the value is associated. The `swatch` type option can accept an array of `colors`, with up to three hexidecimal color keys; or an `image_url`, which is a full image URL path including protocol. The `product list` type option requires a `product_id`. The `checkbox` type option requires a boolean flag, called `checked_value`, to determine which value is considered to be the checked state.

### CatalogProductsProductIdOptionsOptionIdValuesPostResponsesContentApplicationJsonSchemaData

Common Option Value properties.

- `label` (string, required) — The text display identifying the value on the storefront. Required in a /POST.
- `sort_order` (integer, required) — The order in which the value will be displayed on the product page. Required in a /POST.
- `is_default` (boolean, optional) — The flag for preselecting a value as the default on the storefront. This field is not supported for swatch options/modifiers.
- `value_data` (CatalogProductsProductIdOptionsOptionIdValuesPostResponsesContentApplicationJsonSchemaDataValueData, optional) — Extra data describing the value, based on the type of option or modifier with which the value is associated. The `swatch` type option can accept an array of `colors`, with up to three hexidecimal color keys; or an `image_url`, which is a full image URL path including protocol. The `product list` type option requires a `product_id`. The `checkbox` type option requires a boolean flag, called `checked_value`, to determine which value is considered to be the checked state.
- `id` (integer, optional) — The unique numeric ID of the value; increments sequentially.

### metaEmpty_Full

Response metadata.

### CatalogProductsProductIdOptionsOptionIdValuesPostResponsesContentApplicationJsonSchemaErrors

### CatalogProductsProductIdOptionsOptionIdValuesPostResponsesContentApplicationJsonSchemaDataValueData

Extra data describing the value, based on the type of option or modifier with which the value is associated. The `swatch` type option can accept an array of `colors`, with up to three hexidecimal color keys; or an `image_url`, which is a full image URL path including protocol. The `product list` type option requires a `product_id`. The `checkbox` type option requires a boolean flag, called `checked_value`, to determine which value is considered to be the checked state.

## Examples

**Request**

```json
{
  "label": "Pick a color",
  "sort_order": 9,
  "value_data": {
    "colors": [
      "#123c91, #FFFF00, #397a44"
    ]
  }
}
```

**Response**

```json
{
  "data": {
    "label": "Pick a color",
    "sort_order": 9,
    "is_default": false,
    "value_data": {
      "colors": [
        "#123c91, #FFFF00, #397a44"
      ]
    },
    "id": 44
  }
}
```

**SDK Code**

```python Create a variant option value
import requests

url = "https://api.bigcommerce.com/stores/store_hash/v3/catalog/products/1/options/1/values"

payload = {
    "label": "Pick a color",
    "sort_order": 9,
    "value_data": { "colors": ["#123c91, #FFFF00, #397a44"] }
}
headers = {
    "Accept": "application/json",
    "X-Auth-Token": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Create a variant option value
const url = 'https://api.bigcommerce.com/stores/store_hash/v3/catalog/products/1/options/1/values';
const options = {
  method: 'POST',
  headers: {
    Accept: 'application/json',
    'X-Auth-Token': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"label":"Pick a color","sort_order":9,"value_data":{"colors":["#123c91, #FFFF00, #397a44"]}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Create a variant option value
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.bigcommerce.com/stores/store_hash/v3/catalog/products/1/options/1/values"

	payload := strings.NewReader("{\n  \"label\": \"Pick a color\",\n  \"sort_order\": 9,\n  \"value_data\": {\n    \"colors\": [\n      \"#123c91, #FFFF00, #397a44\"\n    ]\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Accept", "application/json")
	req.Header.Add("X-Auth-Token", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Create a variant option value
require 'uri'
require 'net/http'

url = URI("https://api.bigcommerce.com/stores/store_hash/v3/catalog/products/1/options/1/values")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/json'
request["X-Auth-Token"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"label\": \"Pick a color\",\n  \"sort_order\": 9,\n  \"value_data\": {\n    \"colors\": [\n      \"#123c91, #FFFF00, #397a44\"\n    ]\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Create a variant option value
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.bigcommerce.com/stores/store_hash/v3/catalog/products/1/options/1/values")
  .header("Accept", "application/json")
  .header("X-Auth-Token", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"label\": \"Pick a color\",\n  \"sort_order\": 9,\n  \"value_data\": {\n    \"colors\": [\n      \"#123c91, #FFFF00, #397a44\"\n    ]\n  }\n}")
  .asString();
```

```php Create a variant option value
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.bigcommerce.com/stores/store_hash/v3/catalog/products/1/options/1/values', [
  'body' => '{
  "label": "Pick a color",
  "sort_order": 9,
  "value_data": {
    "colors": [
      "#123c91, #FFFF00, #397a44"
    ]
  }
}',
  'headers' => [
    'Accept' => 'application/json',
    'Content-Type' => 'application/json',
    'X-Auth-Token' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Create a variant option value
using RestSharp;

var client = new RestClient("https://api.bigcommerce.com/stores/store_hash/v3/catalog/products/1/options/1/values");
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/json");
request.AddHeader("X-Auth-Token", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"label\": \"Pick a color\",\n  \"sort_order\": 9,\n  \"value_data\": {\n    \"colors\": [\n      \"#123c91, #FFFF00, #397a44\"\n    ]\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Create a variant option value
import Foundation

let headers = [
  "Accept": "application/json",
  "X-Auth-Token": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "label": "Pick a color",
  "sort_order": 9,
  "value_data": ["colors": ["#123c91, #FFFF00, #397a44"]]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.bigcommerce.com/stores/store_hash/v3/catalog/products/1/options/1/values")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```