Api Access To Update Gtin

I've trying to update the GTIN for all the products.

The api URL is /api/products/45/features/2

Where 45 is the first product ID to update and 2 is the feature id of GTIN (according to a JSON dump)

If I set the GTIN in the GUI to say xxx and run the script to update it to a proper value, xxx is deleted and GTIN is set to a blank. I can't get the PUT to work even though the same code with a different URL will happily update the stock amount. The HTTP Response is 200 so it claims to have worked but it's not writing the value I want.

Any suggestions?

Use an import rather than the api. Only assuming that this is a one time (or infrequent) update.

It is only a one off, but I need to apply logic to match the EAN to the product so an import won't do it.

I've done a bit more investigation.

if I use CURL to get the product json:
curl --user api@example.com:xxx -X GET http://www.example.co.uk/api/products/45/

I get, amongst other thing this:

"product_features":{"2":{"feature_id":"2","value":"xxxx","value_int":null,"variant_id":"0","feature_type":"T","description":"GTIN","prefix":"","suffix":"","variant":null,"parent_id":"1"}

Which seems right as I currently have xxxx as the GTIN value.

If I add the features url:
curl --user api@example.com:xxx -X GET http://www.example.co.uk/api/products/45/features/2

I get back:

{"feature_id":"2","feature_code":"","company_id":"0","feature_type":"T","parent_id":"1","display_on_product":"0","display_on_catalog":"0","display_on_header":"N","description":"GTIN","lang_code":"en","prefix":"","suffix":"","categories_path":"","full_description":"","status":"A","comparison":"N","position":"0","variants":[]}

Which is missing the value key.

is this right or is it a bug? If it's a bug it may explain why my updates are being ignored.

Edit

This is a bug. If I use CURL to update another field like full_description it works, it's just the value field it fails on.