Ideally they need to be re-used again rather than making them inactive, I have tried the following but the stock_on_hand doesn't update .....
var
data = {
"stock_on_hand" : 0,
"custom_fields" : [{
"index" : indexofCustomFieldBay,
"value" : "All sold - Ready to use again"
}
]};
var
options = {
'method' : 'put',
'contentType' : 'application/json',
'muteHttpExceptions' : true
};
var response = UrlFetchApp.fetch(
url,
options);