Products

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.

POST
/cgi/product_jqm2.pl
session<token>

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

User-Agent<token>

Authentication using User-Agent header User-Agent header in the format 'app_name/app_version (email)'

In: header

codestring

The barcode of the product to be added or edited

user_idstring

Username to authenticate with

Note: you must always use the username (and not the email) as it is far less brittle.

passwordstring

Password to authenticate with

Formatpassword
comment?string

A comment on the contribution. Adding meaningful comments help moderators and users understand a single product history.

brands?array<string>

The brands of the product (comma separated list of values).

labels?array<string>

The labels of the product (comma separated list of values).

categories?array<string>

The categories of the product (comma separated list of values).

packaging?string

Packaging type, format, material. The v3 API documentation has a more structured data for packaging.

app_name?string

Name of the app providing the information

app_version?string

Version of the app providing the information

app_uuid?string

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.

User-Agent?string

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
}