Update items

Update items

Lots of my items reach a stock level (a small amount) & stock_on_hand needs to be re-set to zero as it's not possible to top them up.
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 .....

itemID = "*************";
    var data = {
"stock_on_hand" : 0,
"custom_fields" : [{
"index" : indexofCustomFieldBay,
"value" : "All sold - Ready to use again"
}
]};
    

var url = ' https://books.zoho.com/api/v3/items/' + encodeURIComponent( itemID) + '?authtoken=' + token + '&JSONString=' + encodeURIComponent(JSON.stringify( data))
var options = {
'method' : 'put',
'contentType' : 'application/json',
'muteHttpExceptions' : true
};
var response = UrlFetchApp.fetch( url, options);

Does it have to be done a different way ?