Delink variants from a product.
1 min
code examples curl request post \\ \ url https //api upstartcommerce com/pim/products/{id}/delink variants \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "variantids" \[] }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "variantids" \[] }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //api upstartcommerce com/pim/products/{id}/delink variants", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //api upstartcommerce com/pim/products/{id}/delink variants") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump({ "variantids" \[] }) response = https request(request) puts response read body import requests import json url = "https //api upstartcommerce com/pim/products/{id}/delink variants" payload = json dumps({ "variantids" \[] }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // all requested variants were successfully delinked from the product {}// partial success some variants were delinked while others failed (for example a variant that is not associated to the product or not found) the response body reports the per variant status {}