> ## 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 Packaging

> Add, update, list, and delete a product's packaging elements (primary, secondary and tertiary packaging, with weight, recyclable and reusable flags and recycled content) -- the programmatic equivalent of the dashboard's packaging page.

Programmatic equivalent of the dashboard's `products/<gtin>/packaging/` page
(and its add, edit and delete sub-pages).

## When to use

* A brand owner needs to record what a product is packed in: each packaging element,
  its weight in grams, whether it is recyclable or reusable, and its recycled content.
* Before recording recyclability (`manage-product-recyclability`): an assessment belongs
  to one packaging element, so the element must exist first.

## Auth

`X-API-Key` header or OAuth token. The caller must be a member of the product's
organization with the contribute role (Editor or Manager); a read-only key is refused
with `403`. A product the caller cannot see, or that another organization owns, answers
`404`.

## Flow

```
GET    /sustainability/api/v1/packaging
POST   /sustainability/api/v1/packaging
PATCH  /sustainability/api/v1/packaging/{record_id}
DELETE /sustainability/api/v1/packaging/{record_id}
```

* **List** -- paginated; filter with `?gtin=` (and `?organization_id=`). Read the list
  first: it shows which elements exist and which fields are empty.
* **Create** -- the body names the product with `gtin`; fields are listed in the OpenAPI
  document at `/sustainability/api/v1/openapi.json`. `weight_grams` is always in grams.
  Returns `201`.
* **Update** -- `PATCH` only the fields to change; `null` clears an optional field. The
  product cannot change: delete and recreate to move an element.
* **Delete** -- removes one element and its recyclability assessment.
* **Read back** -- every write returns the saved row; `GET` the list again to confirm it
  shows the change.

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

## Notes

API writes go through the audited `@org_action` sustainability record services. Fields a
brand can write are defined once on the model (`Packaging.BRAND_EDITABLE_FIELDS`); the
dashboard form writes the same columns, taking the weight as a value and unit it converts
to grams.


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