Create or update a product
PUT/products/:id
Create or update a single product. The response already contains the finished calculation, so there is no second request to make.
Products are write-protected. Once an id belongs to a product, only the product endpoints
may change it. A recipe or supply that tries to define an ingredient under the same id is
rejected with statuscode 613, so a routine recipe upload can never silently overwrite your
catalogue. To use the product in a recipe, reference it with type: products.
Request
Responses
- 200
- 401
- 613
The product was stored and calculated
No authorization - valid API key not provided
This id already exists as an ordinary ingredient. Storing a product under it would turn
that ingredient into a write-protected product, and every recipe still sending the id as
a conceptual-ingredients line would start being rejected. Repeat the request with
convert-ingredient-to-product=true if that is what you want.