BigCommerce API [year]: How To Update And Delete Product Variant Option Value Using Postman

In the previous post, I just showed you How to retrieve and create a product variant option value and today continue with a blog post that will guide you to update and delete a variant option value using Postman in BigCommerce.

Update Product Variant Option Value

First, to update a product variant option value you need to have information such as product ID, option ID, and value id is the id of a product variant option value that you want to update.

Then select PUT and paste this URL, remembering to replace the information about a product variant option value.

https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/products/{product_id}/options/{option_id}/values/{value_id}

Now in the header section, fill in the information about:

  • X-auth-token
  • Accept
  • Content-type

The body will be the information you want to update.

The model for a PUT to update option values on a product.

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

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

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

– value_data: 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 hexadecimal 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: The unique numeric ID of the value; increments sequentially.

Notice that label and sort_order are required

Example:

{
  "label": "Pink",
  "sort_order": 5
}

And this is the result

beehexa how to update and delete product variant option value using postman
beehexa how to update and delete product variant option value using postman

Delete A Product Variant Option Value

Open a request tab, here you choose DELETE and use the URL with the same structure as in the instructions for updating the Product variant option value.

https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/products/{product_id}/options/{option_id}/values/{value_id}

Now in the header section, fill in the information about:

  • X-auth-token
  • Accept
  • Content-type

Skip the body and just press Send button and you have successfully deleted the Product variant option value you want

beehexa 1 how to update and delete product variant option value using postman
beehexa 1 how to update and delete product variant option value using postman

The above are steps to update and delete a new product variant option value in BigCommerce Using Postman. You need to follow the steps that I instructed above. If you have any difficulty or questions at any step, please comment below or refer to our BigCommerce API documentation if you have any questions.

Hope you are successful

Get started for free

You can’t add more hours to the day. Beehexa is the next best thing.