Core API
...
Products
Update a Product Variant
code examples curl location globoff request patch 'https //app sparklayer io/api/v1/variants/{id}' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "tax type" 1, "position" 1, "status" "pending", "settings" \[ { "pack size" 1 } ], "stock management" "sparklayer" }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "tax type" 1, "position" 1, "status" "pending", "settings" \[ { "pack size" 1 } ], "stock management" "sparklayer" }); var requestoptions = { method 'patch', headers myheaders, body raw, redirect 'follow' }; fetch("https //app sparklayer io/api/v1/variants/{id}", 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 //app sparklayer io/api/v1/variants/{id}") https = net http new(url host, url port) https use ssl = true request = net http patch new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump({ "tax type" 1, "position" 1, "status" "pending", "settings" \[ { "pack size" 1 } ], "stock management" "sparklayer" }) response = https request(request) puts response read body import requests import json url = "https //app sparklayer io/api/v1/variants/{id}" payload = json dumps({ "tax type" 1, "position" 1, "status" "pending", "settings" \[ { "pack size" 1 } ], "stock management" "sparklayer" }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("patch", url, headers=headers, data=payload) print(response text) responses // successful response { "product id" "pp 123", "id" "pv 234", "created at" "", "updated at" "", "external id" "idv001", "sku" "idv001", "barcode" 837493612362, "weight in grams" 0, "tax type" 0, "position" 0, "cart image url" "", "rrp" \[ { "value" 10 49, "currency code" "gbp" } ], "options" \[ { "group" "color", "value" "blue" } ], "status" "live", "settings" \[ { "customer group" "default", "pack size" 0, "reserve stock quantity" 0, "min order quantity" 0, "max order quantity" 0, "min order parent quantity" 0, "max order parent quantity" 0, "display" false, "sell" false } ], "stock management" "none" }// conflict response // error response