Edit Product
This updates a product.
Note: If the barcode exists then you will be editing the existing product, However if it doesn''t you will be creating a new product with that unique barcode, and adding properties to the product.
Session cookie containing user ID, username, and session token. The value is structured as: user_id&username&user_session&session_token e.g. "user_id&exampleuser&user_session&abcdefghijklmnopqrstuvwxyz123456789ABCDEFGHIJKLM"
In: cookie
Authentication using User-Agent header User-Agent header in the format 'app_name/app_version (email)'
In: header
The barcode of the product to be added or edited
Username to authenticate with
Note: you must always use the username (and not the email) as it is far less brittle.
Password to authenticate with
password
A comment on the contribution. Adding meaningful comments help moderators and users understand a single product history.
The brands of the product (comma separated list of values).
The labels of the product (comma separated list of values).
The categories of the product (comma separated list of values).
Packaging type, format, material.
The v3 API documentation
has a more structured data for packaging
.
Name of the app providing the information
Version of the app providing the information
When an app uses a single user to log its contributions, it might be interesting to know which user of the app is providing the information. You can use this field to provide an identifier (eg: an sha1 of the username) that's privacy preserving. Make sure that your salt is strong, perfectly random and secret
In case we have trouble with one of your user, it helps our moderators revert edits.
It is required that you pass a specific User-Agent header when you do an API request. But some times it's not possible to modify such a header (eg. request using JavaScript in a browser). In such cases, you can override it with this parameter.
Response Body
curl -X POST "https://world.openfoodfacts.net/cgi/product_jqm2.pl" \
-F code="0074570036004" \
-F user_id="string" \
-F password="pa$$word"
{
"status_verbose": "fields saved",
"status": 1
}