Skip to main content
Programmatic equivalent of the dashboard’s products/<gtin>/packaging-hierarchy/ page.

When to use

  • A brand owner wants Closient to know what a case, inner pack or pallet GTIN contains, so a scan of the case can be traced to the units inside it.
  • A pack configuration changed (a case went from 12 to 24 units) or a link was recorded at the wrong level.

Auth

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

Flow

  • List — every child link of the product in {gtin}, with each link’s id, the child’s GTIN and name, the quantity and the hierarchy_level.
  • Create — the body is child_gtin, quantity (at least 1) and hierarchy_level (UNIT, INNER_PACK, CASE or PALLET); fields are listed in the OpenAPI document at /products/api/v1/openapi.json. Only the parent must belong to your organization: the child can be any product in the catalog, as a retailer’s case can hold other brands’ items. An unknown child GTIN answers 404, and a product cannot be its own child (422).
  • Re-link — a product links each child once. A POST naming a child that is already linked replaces that link’s quantity and hierarchy_level, so it is how a link’s level is corrected.
  • Update — PATCH with quantity only, addressed by the link’s id.
  • Delete — removes the link permanently; neither product is touched.
  • Read back — every create and update returns the saved link; list again to confirm.
Returns 403 for a read-only key, 404 for a parent product or link the caller cannot see, and 422 for an invalid value.

Notes

Record a link only when the brand publishes the pack configuration or holds it (a spec sheet, a case label, a GDSN record). A child whose own owner’s facts Closient withholds (an unverified or disputed claim, a suspended owner) is left out of the list for anyone outside that child’s organization. The fields a brand writes on a link are defined once on the model (ProductGroup.BRAND_EDITABLE_FIELDS); both API schemas and the dashboard form are pinned to that set.