Values

Get All Product Variant Option Values

GET /catalog/products/{product_id}/options/{option_id}/values

Request

Returns a list of all Variant Option Values. Optional parameters can be passed in.

Authentication

  • X-Auth-Token in header

Parameters

  • store_hash in path - string
  • Accept in header with default of application/json - string
    required
    The MIME type of the response body.
  • product_id in path - integer
    required

    The ID of the Product to which the resource belongs.

  • option_id in path - integer
    required

    The ID of the Option.

  • page in query - integer

    Specifies the page number in a limited (paginated) list of products.

  • limit in query with default of 50 - integer

    Controls the number of items per page in a limited (paginated) list of products.

  • include_fields in query - array
    Fields to include, in a comma-separated list. The ID and the specified fields will be returned.
    Type: array[string]
  • exclude_fields in query - array
    Fields to exclude, in a comma-separated list. The specified fields will be excluded from a response. The ID cannot be excluded.
    Type: array[string]

example

curl --request GET \
--url 'https://api.bigcommerce.com/stores/[store_hash]/v3/catalog/products/[product_id]/options/[option_id]/values' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: {{token}}'

Response

Body

object | application/json
Get Option Values response.
  • data
    array[object]

  • meta
    object

    Data about the response, including pagination and collection totals.

example

{
"data": [
{
"id": 174,
"label": "Beige",
"sort_order": 1,
"value_data": {
"colors": [
"#FAFAEB"
]
},
"is_default": false
},
{
"id": 175,
"label": "Grey",
"sort_order": 2,
"value_data": {
"colors": [
"#BDBDBD"
]
},
"is_default": false
},
{
"id": 176,
"label": "Black",
"sort_order": 3,
"value_data": {
"colors": [
"#000000"
]
},
"is_default": false

Create a Product Variant Option Value

POST /catalog/products/{product_id}/options/{option_id}/values

Request

Creates a Variant Option Value.

Required Fields

  • label
  • sort_order

Read-Only Fields

  • id

Limits

  • 250 option values per option limit.

Authentication

  • X-Auth-Token in header

Parameters

  • store_hash in path - string
  • Accept in header with default of application/json - string
    required
    The MIME type of the response body.
  • product_id in path - integer
    required

    The ID of the Product to which the resource belongs.

  • option_id in path - integer
    required

    The ID of the Option.

  • Content-Type in header with default of application/json - string
    required
    The MIME type of the request body.

Body

object | application/json
The model for a POST to create option values on a product.
  • is_default
    boolean

    The flag for preselecting a value as the default on the storefront. This field is not supported for swatch options/modifiers.

  • label
    string
    required

    The text display identifying the value on the storefront. Required in a /POST.

    Example: Green
  • sort_order
    integer
    required

    The order in which the value will be displayed on the product page. Required in a /POST.

    Min: -2147483648
    Max: 2147483647
  • value_data
    object

    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.

example

{
"is_default": false,
"label": "Green",
"sort_order": 0,
"value_data": {}
}

Response

Body

object | application/json
  • data
    object

    Common Option Value properties.
  • meta
    object

    Response metadata.

example

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

Get a Product Variant Option Value

GET /catalog/products/{product_id}/options/{option_id}/values/{value_id}

Request

Returns a single Variant Option Value. Optional parameters can be passed in.

Authentication

  • X-Auth-Token in header

Parameters

  • store_hash in path - string
  • Accept in header with default of application/json - string
    required
    The MIME type of the response body.
  • product_id in path - integer
    required

    The ID of the Product to which the resource belongs.

  • option_id in path - integer
    required

    The ID of the Option.

  • value_id in path - integer
    required

    The ID of the Modifier/Option Value.

  • include_fields in query - array
    Fields to include, in a comma-separated list. The ID and the specified fields will be returned.
    Type: array[string]
  • exclude_fields in query - array
    Fields to exclude, in a comma-separated list. The specified fields will be excluded from a response. The ID cannot be excluded.
    Type: array[string]

example

curl --request GET \
--url 'https://api.bigcommerce.com/stores/[store_hash]/v3/catalog/products/[product_id]/options/[option_id]/values/[value_id]' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: {{token}}'

Response

Body

object | application/json
  • data
    object

    Common Option Value properties.
  • meta
    object

    Response metadata.

example

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

Update a Product Variant Option Value

PUT /catalog/products/{product_id}/options/{option_id}/values/{value_id}

Request

Updates a Variant Option Value.

Read-Only Fields

  • id

Authentication

  • X-Auth-Token in header

Parameters

  • store_hash in path - string
  • Accept in header with default of application/json - string
    required
    The MIME type of the response body.
  • product_id in path - integer
    required

    The ID of the Product to which the resource belongs.

  • option_id in path - integer
    required

    The ID of the Option.

  • value_id in path - integer
    required

    The ID of the Modifier/Option Value.

  • Content-Type in header with default of application/json - string
    required
    The MIME type of the request body.

A BigCommerce OptionValue object.

Body

object | application/json
The model for a PUT to update option values on a product.
  • is_default
    boolean

    The flag for preselecting a value as the default on the storefront. This field is not supported for swatch options/modifiers.

  • label
    string
    required

    The text display identifying the value on the storefront. Required in a /POST.

    Example: Green
  • sort_order
    integer
    required

    The order in which the value will be displayed on the product page. Required in a /POST.

    Min: -2147483648
    Max: 2147483647
  • value_data
    object

    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

    The unique numeric ID of the value; increments sequentially.

example

{
"is_default": false,
"label": "Green",
"sort_order": 0,
"value_data": {},
"id": 0
}

Response

Body

object | application/json
  • data
    object

    Common Option Value properties.
  • meta
    object

    Response metadata.

example

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

Delete a Product Variant Option Value

DELETE /catalog/products/{product_id}/options/{option_id}/values/{value_id}

Request

Deletes a Variant Option Value.

Authentication

  • X-Auth-Token in header

Parameters

  • store_hash in path - string
  • Accept in header with default of application/json - string
    required
    The MIME type of the response body.
  • product_id in path - integer
    required

    The ID of the Product to which the resource belongs.

  • option_id in path - integer
    required

    The ID of the Option.

  • value_id in path - integer
    required

    The ID of the Modifier/Option Value.

example

curl --request DELETE \
--url 'https://api.bigcommerce.com/stores/[store_hash]/v3/catalog/products/[product_id]/options/[option_id]/values/[value_id]' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: {{token}}'

Response

Did you find what you were looking for?