Skip to main content
Programmatic equivalent of the dashboard’s products/<gtin>/environmental/ page (and its add, edit and delete sub-pages).

When to use

  • A brand owner needs to record, correct or remove an environmental impact figure (type, score, unit, methodology, assessment date) for a product.

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 rows 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. Returns 201.
  • Update — PATCH only the fields to change; null clears an optional field.
  • Delete — removes one row; the id must belong to a product the caller can edit.
  • 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

Writes go through the audited @org_action sustainability record services: the dashboard page and this API share one write path and one audit record. Fields a brand can write are defined once on the model (BRAND_EDITABLE_FIELDS).