beehexa cover 21 how to update and delete a product variant using postman

BigCommerce API 2024: How To Update And Delete A Product Variant Using Postman

Following the previous blog How To Retrieve And Create A Product Variant Without Error 409, today I will show you How To Update and Delete a Product Variant in BigCommerce using Postman.

Update A Product Variant

First, go back to the retrieve product variant tab to select a product variant you want to update. Remember the ID of that variant

Now, open a new tab in Postman. Select PUT and paste the URL below:

https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/products/{product_id}/variants/{variant_id}

Replace {store_hash} with your store hash and {product_id} by the product id you want to see the variants

Similarly,  in the header, we will need the accept, content type, and access token declarations

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

With the body part, we will update the information related to this product variant.

I will change some information. And here is a sample example.

{
        
            "product_id": 111,
            "sku": "SM13-PL1",
            "sku_id": 138,
            "price": null,
            "calculated_price": 20,
            "sale_price": 13,
            "retail_price": 12,
            "map_price": 7,
            "weight": 6,
            "calculated_weight": 2,
            "width": 5,
            "height": 5,
            "depth": 5,
            "is_free_shipping": false,
            "fixed_cost_shipping_price": 5,
            "purchasing_disabled": false,
            "purchasing_disabled_message": "",
            "cost_price": 5,
            "inventory_level": 0,
            "inventory_warning_level": 0
        
        }
Code language: JSON / JSON with Comments (json)

Once done, click the send button to send the request.

And the result returned is the information about the Product variant has been updated after a second

beehexa 2 how to update and delete product variant using postman
beehexa 2 how to update and delete product variant using postman

Delete A Product Variant

Deleting the product variant is not difficult at all. 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.

https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/products/{product_id}/variants/{variant_id}

The header is unchanged.

beehexa 4
beehexa 3 how to update and delete product variant using postman

Skip the body and just press Send Button and you have successfully deleted the Product variant you want

beehexa 4how to update and delete product variant using postman
beehexa 4 how to update and delete product variant using postman

Now to go back to Bigcommerce to check the results.

beehexa 5 how to update and delete product variant using postman
beehexa 5 how to update and delete product variant using postman

The above are steps to update and delete a new product variant 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