I need to delete previous product variant from the existing product and add new variant using API. I am facing issue while adding multiple variant to an existing product. Below is the code what I am trying
$access_token = 'xxxxxxxxx';
$curl_url = 'https://example.myshopify.com/admin/api/2019-04/products/3856519725165/variants.json?access_token='....;
$variant = array( "variant" => array(
@iamdeepakbasnal , I have used another aproach . I have updated the product using PUT api of product and send array of all varinats and it worked. But now I am facing a problem, all varinats created in PUT request have inventory 0 , I want to set any parameter in my request which disable inventory tracking for new created varinats. IS this possible ?
Or any alternate solution ?
Creating a variant with
will allow a product to continue to be sold even after the inventory dips below 0.
Alternatively, creating a variant where "inventory_management"=>nil will tell Shopify that the inventory doesn't need to be tracked.
check in this Variant API Doc as well.