---
title: "Edit Product"
method: POST
path: "/cgi/product_jqm2.pl"
tags: ["Products"]
---

# Edit Product

`POST /cgi/product_jqm2.pl`

## Request

- Base URL: `https://world.openfoodfacts.net`
- URL: `https://world.openfoodfacts.net/cgi/product_jqm2.pl`
- Auth: API key in cookie `session` and API key in header `User-Agent`

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.

## Request body `multipart/form-data`

- object: Properties that goes in change ref
  - `product_type` 'beauty' | 'food' | 'petfood' | 'product': The product type is a fundamental separation that tells on which platform the product is made available: Open Food Facts, Open Beauty Facts, Open Pet Food Facts or Open Products Facts. Each platform has variations on the way it analyses the product. Changing the product type moves the product to the new platform. It must be done thoughtfully.
  - `code` string, required: The barcode of the product to be added or edited
  - `user_id` string: Username to authenticate with Note: you must always use the username (and not the email) as it is far less brittle.
  - `password` string, password: Password to authenticate with
  - `lc` string: 2 letter code of the language of the interface. Used to determine the language of certain fields (e.g. product_name and taxonomy fields like categories and labels). If not passed, the language may be inferred by the country of the user (passed through the cc field or inferred by the IP address). Full list at https://static.openfoodfacts.org/data/taxonomies/languages.json
  - `lang` string: 2 letter language code of the main language of the product (the most prominent on the packaging)
  - `product_name` string: Product name in the language sent in the lc field. For backward compatibility only, use the field product_name_[language_code] instead.
  - `abbreviated_product_name` string: Abbreviated product name. For backward compatibility only, use the field abbreviated_product_name_[language_code] instead.
  - `generic_name` string: Legal name of the product. For backward compatibility only, use the field generic_name_[language_code] instead.
  - `ingredients_text` string: Raw list of ingredients text. For backward compatibility only, use the field ingredients_text_[language_code] instead.
  - `packaging_text` string: Packaging information text. For backward compatibility only, use the field packaging_text_[language_code] instead.
  - `quantity` string: Product quantity with unit
  - `labels` string: Product labels (comma-separated list)
  - `categories` string: Product categories (comma-separated list)
  - `brands` string: Product brands (comma-separated list)
  - `stores` string: Stores where product is sold
  - `countries` string: Countries where product is sold
  - `origins` string: Origins of ingredients
  - `traces` string: Traces of allergens
  - `packaging` string: Packaging type, format, material. The [v3 API documentation](https://openfoodfacts.github.io/openfoodfacts-server/api/ref-v3/#operation/post-api-v3-product-barcode) has a more structured data for `packaging`.
  - `serving_size` string: Serving size
  - `nutrition_data_per` '100g' | 'serving': Whether nutrition data is per 100g or per serving. Note that this field applies to all nutriment fields (existing or new). So if its value is changed, all nutrients should be supplied, so that we don't have existing values per 100g when the new values are per serving, or vice versa.
  - `comment` string: A comment on the contribution. It will be shown in product changes history. Adding meaningful comments help moderators and users understand a single product history.
  - `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 `200`

OK

- AddOrEditAProduct
  - `status_verbose` string
  - `status` integer

## Changes

- **2026-11-18** `ebaef6823f1f`: 2 breaking, 1 warning, 2 info
  - added `#/components/schemas/add_or_edit_a_product_2, #/components/schemas/change_ref_properties` to the request body `allOf` list
  - the response's body type changed from no type to `object` for status `200`
  - removed `#/components/schemas/add_or_edit_a_product.yaml, #/components/schemas/change_ref_properties.yaml` from the request body `allOf` list
  - added the optional property `status` to the response with the `200` status
  - …1 more
- **2025-07-02** `7193ad484e5d`: 2 info
  - api tag `Products` added
  - api tag `Write Requests` removed

[Operation history](https://skmtc.dev/openfoodfacts/apis/open-food-facts-open-api/changes/cgi/product_jqm2.pl/post.md)

---

[API](https://skmtc.dev/openfoodfacts/apis/open-food-facts-open-api.md) - [All operations](https://skmtc.dev/openfoodfacts/apis/open-food-facts-open-api/llms.txt) - [OpenAPI document](https://skmtc.dev/openfoodfacts/apis/open-food-facts-open-api/revisions/ebaef6823f1f?raw)
