Skip to navigation

Create Product Variant Option

Creates a Variant Option.

Required Fields

  • display_name
  • type
  • option_values

Read-Only Fields

  • id

Limits

  • 255 characters option name length.

Notes

  • Only one variant option at a time can be created; individual variant options will contain an array of multiple values.
  • There are several examples listed below that create options, but the SKUs are not updated and they are not a variant on the product. Variant SKUs must be created with a separate request.
  • Variant options will show on the storefront as an option that can be selected by the customer. A request like this could be used to add new choices to a variant that has already been created.
  • If more than one variant needs to be created, use the Create a Product endpoint.

Authentication

X-Auth-Tokenstring

OAuth scopes

UI NamePermissionParameter
Productsmodifystore_v2_products
Productsread-onlystore_v2_products_read_only

Authentication header

HeaderArgumentDescription
X-Auth-Tokenaccess_tokenFor more about API accounts that generate access_tokens, see our Guide to API Accounts.

Further reading

For example requests and more information about authenticating BigCommerce APIs, see Authentication and Example Requests.

For more about BigCommerce OAuth scopes, see our Guide to API Accounts.

For a list of API status codes, see API Status Codes.

Path parameters

product_idintegerRequired

The ID of the Product to which the resource belongs.

store_hashstringRequired
Permanent ID of the BigCommerce store.

Headers

AcceptstringRequiredDefaults to application/json

The MIME type of the response body.

Request

The model for a POST to create options on a product.
product_idintegerOptional
The unique numerical ID of the product to which the option belongs.
display_namestringOptional1-255 characters
The name of the option shown on the storefront.
typeenumOptional

The type of option, which determines how it will display on the storefront. Acceptable values: radio_buttons, rectangles, dropdown, product_list, product_list_with_images, swatch. For reference, the former v2 API values are: RB = radio_buttons, RT = rectangles, S = dropdown, P = product_list, PI = product_list_with_images, CS = swatch.

configobjectOptional
The values for option config can vary based on the Modifier created.
sort_orderintegerOptional
Order in which the option is displayed on the storefront.
option_valueslist of objectsOptional
image_urlstringOptional
Publicly available image url

Response

OK
dataobjectOptional
Common Option properties.
metaobjectOptional

Empty meta object; may be used later.

Errors

409
Conflict Error
422
Unprocessable Entity Error