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
- 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_gramsis always in grams. Returns201. - Update —
PATCHonly the fields to change;nullclears 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;
GETthe list again to confirm it shows the change.
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.