> ## Documentation Index
> Fetch the complete documentation index at: https://docs.closient.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage Product Recipes

> Add, update, list, and remove the brand's own recipes and the products each is shown on -- the programmatic equivalent of the dashboard's product recipes page.

Programmatic equivalent of the dashboard's `products/<gtin>/recipes/` page.

## When to use

* A brand publishes recipes for its products (on its own site, its packaging or a recipe card)
  and wants them on the product's Closient page.
* A recipe changed, or should also appear on another of the brand's products, or should come
  off one.

## Auth

`X-API-Key` header or OAuth token. Reading takes membership of the recipe's organization;
writing takes the contribute role (Editor or Manager). A read-only key is refused with `403`;
a recipe or product another organization owns answers `404`, so the API never confirms it
exists.

## Flow

```
GET    /products/api/v1/recipes?gtin={gtin}
GET    /products/api/v1/recipes?organization_id={organization_id}
GET    /products/api/v1/recipes/{recipe_id}
POST   /products/api/v1/recipes
PATCH  /products/api/v1/recipes/{recipe_id}
DELETE /products/api/v1/recipes/{recipe_id}
```

* **List** -- the recipes your organizations own, ordered by title and paginated. Filter by
  `gtin` (recipes shown on that product), `organization_id` or `difficulty` (`easy`, `medium`,
  `hard`). Each recipe carries its `id` and the `products` it is shown on.
* **Create** -- the body is `title`, `ingredients_list` (one ingredient per line),
  `instructions` and optionally `description`, `image_url`, `preparation_time_minutes`,
  `cooking_time_minutes`, `servings` (at least 1) and `difficulty`, plus `gtins`: the products
  to show it on, each one your organization owns. Fields are listed in the OpenAPI document at
  `/products/api/v1/openapi.json`. A caller in several organizations names one with
  `organization_id`. Any GTIN the organization does not own answers `404` and nothing is
  created.
* **Update** -- `PATCH` with only the fields to change. `gtins`, when present, replaces every
  product the recipe is shown on, so send the full list: read the recipe first and add or
  remove one GTIN.
* **Delete** -- removes the recipe permanently from every product it is shown on. To take it
  off one product only, `PATCH` its `gtins` without that product instead.
* **Read back** -- every create and update returns the saved recipe; list again to confirm.

Returns `403` for a read-only key, `404` for a recipe or product the caller cannot see, and
`422` for an invalid value.

## Notes

Copy only recipes the brand itself publishes; never write one, and never adapt one from another
site. Before creating a recipe, list the organization's recipes: one it already has can be
shown on another product by adding that product's GTIN, rather than duplicated.

The fields a brand writes on a recipe are defined once on the model
(`Recipe.BRAND_EDITABLE_FIELDS`); both API schemas and the dashboard form are pinned to that
set. The dashboard form has no image URL box.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.