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:


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:


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.


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.