{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openjuvenile.org/schemas/v0.2/core.schema.json",
  "title": "Product record – core",
  "description": "A product record describes one sellable product variant, identified by its GTIN. The core contains information about the record itself, identity, brand, manufacturer, variant grouping, contents, child suitability, dimensions, weights, logistics, multilingual texts and status. Compliance, media, compatibility and category profiles are separate blocks referenced from here.",
  "$comment": "Draft 0.2 – open for comment. Field levels: MUST = listed in `required`; otherwise `x-openjuvenile-level` is should, may or conditional.",
  "type": "object",
  "properties": {
    "$schema": {
      "description": "URI of the schema the record conforms to, so that editors can validate it.",
      "type": "string",
      "format": "uri",
      "x-openjuvenile-level": "may",
      "examples": ["https://openjuvenile.org/schemas/v0.2/core.schema.json"]
    },
    "specVersion": {
      "description": "Version of the specification the record conforms to.",
      "type": "string",
      "enum": ["0.2"],
      "examples": ["0.2"]
    },
    "recordInfo": {
      "description": "Information about the record itself: who publishes it, when it was last changed and how final it is. Data recipients use it to detect changes and to tell records for the same GTIN apart.",
      "type": "object",
      "properties": {
        "publisher": {
          "description": "The company that publishes this record and answers questions about its data.",
          "type": "object",
          "properties": {
            "name": {
              "description": "Name of the company.",
              "type": "string",
              "minLength": 1,
              "examples": ["Example Brand Ltd."]
            },
            "gln": {
              "$ref": "#/$defs/gln",
              "description": "Global Location Number (GLN) of the publishing company.",
              "x-openjuvenile-level": "should"
            },
            "role": {
              "description": "Role of the publisher for this product: brand-owner (owns the brand) · manufacturer · importer · distributor · retailer · service-provider (publishes on behalf of one of the others).",
              "type": "string",
              "enum": [
                "brand-owner",
                "manufacturer",
                "importer",
                "distributor",
                "retailer",
                "service-provider"
              ],
              "examples": ["brand-owner"]
            }
          },
          "required": ["name", "role"],
          "additionalProperties": false
        },
        "lastModified": {
          "description": "Date and time of the last change to the record, in ISO 8601 format with time zone.",
          "type": "string",
          "format": "date-time",
          "examples": ["2026-09-15T09:30:00Z"]
        },
        "revision": {
          "description": "Revision number of the record. It increases by at least one with every change the publisher releases.",
          "type": "integer",
          "minimum": 1,
          "x-openjuvenile-level": "should",
          "examples": [3]
        },
        "status": {
          "description": "preliminary: values may still change, for example before the launch · final: values are confirmed by the publisher.",
          "type": "string",
          "enum": ["preliminary", "final"],
          "x-openjuvenile-level": "should",
          "examples": ["final"]
        },
        "recordId": {
          "description": "Identifier of the record in the publisher's own system.",
          "type": "string",
          "minLength": 1,
          "x-openjuvenile-level": "may",
          "examples": ["PIM-000123"]
        }
      },
      "required": ["publisher", "lastModified"],
      "additionalProperties": false
    },
    "gtin": {
      "$ref": "#/$defs/gtin",
      "description": "Global Trade Item Number of this product variant: 8, 12, 13 or 14 digits with a valid check digit. Primary identifier of the record."
    },
    "brand": {
      "description": "The brand under which the product is sold.",
      "type": "object",
      "properties": {
        "name": {
          "description": "Brand name as shown on the product and its packaging.",
          "type": "string",
          "minLength": 1,
          "examples": ["Example Brand"]
        },
        "website": {
          "$ref": "#/$defs/url",
          "description": "Website of the brand.",
          "x-openjuvenile-level": "may"
        }
      },
      "required": ["name"],
      "additionalProperties": false
    },
    "manufacturer": {
      "$ref": "#/$defs/party",
      "description": "The manufacturer of the product. GPSR Art. 19 requires the manufacturer's name, postal and electronic address in every online offer."
    },
    "euResponsiblePerson": {
      "$ref": "#/$defs/responsiblePerson",
      "description": "The person established in the EU who is responsible for the product when the manufacturer is established outside the EU (GPSR Art. 19).",
      "x-openjuvenile-level": "conditional",
      "x-openjuvenile-condition": "The manufacturer is established outside the EU (manufacturer.postalAddress.country is not an EU member state)."
    },
    "modelName": {
      "description": "Model name as used by the brand, without variant details such as colour.",
      "type": "string",
      "minLength": 1,
      "examples": ["Pebble Travel Stroller"]
    },
    "modelNumber": {
      "description": "The manufacturer's article number for this model or variant.",
      "type": "string",
      "minLength": 1,
      "x-openjuvenile-level": "should",
      "examples": ["EB-PTS-26"]
    },
    "modelYear": {
      "description": "Model year as communicated by the brand.",
      "type": "integer",
      "minimum": 1990,
      "maximum": 2100,
      "x-openjuvenile-level": "may",
      "examples": [2026]
    },
    "productGroupId": {
      "description": "Identifier, assigned by the brand, that all variants of one model share – for example the model number without the colour code. Records with the same brand.name and productGroupId are variants of one model.",
      "type": "string",
      "minLength": 1,
      "x-openjuvenile-level": "should",
      "examples": ["EB-PTS"]
    },
    "variant": {
      "description": "What distinguishes this variant from other variants of the same model.",
      "type": "object",
      "properties": {
        "colorName": {
          "$ref": "#/$defs/localizedString",
          "description": "Colour name as communicated to consumers, per language.",
          "x-openjuvenile-level": "should"
        },
        "colorCode": {
          "description": "Colour code used by the brand in its own systems.",
          "type": "string",
          "minLength": 1,
          "x-openjuvenile-level": "may",
          "examples": ["GRA"]
        },
        "size": {
          "description": "Size designation, if the model is available in sizes.",
          "type": "string",
          "minLength": 1,
          "x-openjuvenile-level": "may",
          "examples": ["74/80"]
        },
        "variesBy": {
          "description": "Attributes in which the variants of this model differ from each other.",
          "type": "array",
          "items": {
            "description": "One attribute.",
            "type": "string",
            "enum": ["color", "size", "pattern", "material", "edition", "other"],
            "examples": ["color"]
          },
          "minItems": 1,
          "uniqueItems": true,
          "x-openjuvenile-level": "may"
        },
        "pattern": {
          "$ref": "#/$defs/localizedString",
          "description": "Name of the pattern or print, per language, if the variants differ in it.",
          "x-openjuvenile-level": "may"
        }
      },
      "additionalProperties": false,
      "x-openjuvenile-level": "should"
    },
    "category": {
      "description": "Product category. The category code determines which category profile applies.",
      "type": "object",
      "properties": {
        "code": {
          "description": "Category code of this standard. Records with code stroller or car-seat MUST contain the matching profile.",
          "$comment": "TODO(review): the category list is a first draft and follows the planned profiles.",
          "type": "string",
          "enum": [
            "stroller",
            "car-seat",
            "nursery-furniture",
            "mattress",
            "carrier",
            "feeding",
            "textile",
            "safety-product",
            "toy",
            "other"
          ],
          "examples": ["stroller"]
        },
        "gs1GpcBrick": {
          "description": "GS1 Global Product Classification (GPC) brick code: 8 digits.",
          "type": "string",
          "pattern": "^\\d{8}$",
          "x-openjuvenile-level": "should"
        }
      },
      "required": ["code"],
      "additionalProperties": false
    },
    "title": {
      "$ref": "#/$defs/localizedString",
      "description": "Product title for listings, per language."
    },
    "shortDescription": {
      "$ref": "#/$defs/localizedString",
      "description": "One or two sentences that describe the product, per language.",
      "x-openjuvenile-level": "should"
    },
    "description": {
      "$ref": "#/$defs/localizedString",
      "description": "Full product description, per language. Plain text; paragraphs are separated by a blank line.",
      "x-openjuvenile-level": "should"
    },
    "keyFeatures": {
      "description": "Short feature statements in order of importance, each per language.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/localizedString",
        "description": "One feature statement, per language."
      },
      "minItems": 1,
      "x-openjuvenile-level": "may"
    },
    "contents": {
      "description": "What the customer receives: every item in the package, including the product itself, accessories and parts. For sets and bundles, each component is one entry.",
      "type": "array",
      "items": {
        "description": "One item in the package.",
        "type": "object",
        "properties": {
          "name": {
            "$ref": "#/$defs/localizedString",
            "description": "Name of the item, per language."
          },
          "quantity": {
            "description": "Number of these items in the package.",
            "type": "integer",
            "minimum": 1,
            "examples": [1]
          },
          "gtin": {
            "$ref": "#/$defs/gtin",
            "description": "GTIN of the item, if it is also sold on its own.",
            "x-openjuvenile-level": "conditional",
            "x-openjuvenile-condition": "The item is also sold on its own."
          }
        },
        "required": ["name", "quantity"],
        "additionalProperties": false
      },
      "minItems": 1,
      "x-openjuvenile-level": "should"
    },
    "childSuitability": {
      "description": "Which children the product is intended for, as stated by the manufacturer. Category profiles add limits for parts of a product, such as the seat of a stroller.",
      "type": "object",
      "properties": {
        "fromBirth": {
          "description": "Whether the product can be used from birth.",
          "type": "boolean",
          "x-openjuvenile-level": "should",
          "examples": [true]
        },
        "ageMonths": {
          "$ref": "#/$defs/range",
          "description": "Age range in months.",
          "x-openjuvenile-level": "should"
        },
        "childWeightKg": {
          "$ref": "#/$defs/range",
          "description": "Range of the child's weight in kg.",
          "x-openjuvenile-level": "may"
        },
        "childHeightCm": {
          "$ref": "#/$defs/range",
          "description": "Range of the child's height (stature) in cm.",
          "x-openjuvenile-level": "may"
        }
      },
      "additionalProperties": false,
      "x-openjuvenile-level": "should"
    },
    "dimensions": {
      "description": "Outer dimensions in centimetres.",
      "type": "object",
      "properties": {
        "assembled": {
          "$ref": "#/$defs/dimensions",
          "description": "Dimensions of the product ready for use."
        },
        "packaged": {
          "$ref": "#/$defs/dimensions",
          "description": "Dimensions of the retail packaging. For products shipped in more than one package, use logistics.packages.",
          "x-openjuvenile-level": "should"
        }
      },
      "required": ["assembled"],
      "additionalProperties": false
    },
    "weight": {
      "description": "Weights in kilograms.",
      "type": "object",
      "properties": {
        "netKg": {
          "description": "Weight of the product without packaging, in kg.",
          "type": "number",
          "exclusiveMinimum": 0,
          "examples": [6.9]
        },
        "grossKg": {
          "description": "Weight including the retail packaging, in kg. For products shipped in more than one package, use logistics.packages.",
          "type": "number",
          "exclusiveMinimum": 0,
          "x-openjuvenile-level": "should",
          "examples": [8.4]
        }
      },
      "required": ["netKg"],
      "additionalProperties": false
    },
    "logistics": {
      "description": "Packages and trade units for ordering, storage and shipping.",
      "type": "object",
      "properties": {
        "packages": {
          "description": "The packages of the product, if it is shipped in more than one package (for example frame and seat unit in separate boxes).",
          "type": "array",
          "items": {
            "description": "One package.",
            "type": "object",
            "properties": {
              "dimensions": {
                "$ref": "#/$defs/dimensions",
                "description": "Outer dimensions of the package."
              },
              "grossKg": {
                "description": "Weight of the package including its contents, in kg.",
                "type": "number",
                "exclusiveMinimum": 0,
                "examples": [9.2]
              },
              "contentsNote": {
                "$ref": "#/$defs/localizedString",
                "description": "What the package contains, per language.",
                "x-openjuvenile-level": "may"
              }
            },
            "required": ["dimensions", "grossKg"],
            "additionalProperties": false
          },
          "minItems": 2,
          "x-openjuvenile-level": "conditional",
          "x-openjuvenile-condition": "The product is shipped in more than one package."
        },
        "tradeUnits": {
          "description": "Units in which the product is ordered and shipped, such as cases and pallets.",
          "type": "array",
          "items": {
            "description": "One trade unit.",
            "type": "object",
            "properties": {
              "level": {
                "description": "inner-pack · case · pallet.",
                "type": "string",
                "enum": ["inner-pack", "case", "pallet"],
                "examples": ["case"]
              },
              "gtin": {
                "$ref": "#/$defs/gtin",
                "description": "GTIN of the trade unit, usually a GTIN-14."
              },
              "quantity": {
                "description": "Number of consumer units (this product) in the trade unit.",
                "type": "integer",
                "minimum": 1,
                "examples": [2]
              },
              "dimensions": {
                "$ref": "#/$defs/dimensions",
                "description": "Outer dimensions of the trade unit.",
                "x-openjuvenile-level": "should"
              },
              "grossKg": {
                "description": "Gross weight of the trade unit, in kg.",
                "type": "number",
                "exclusiveMinimum": 0,
                "x-openjuvenile-level": "should",
                "examples": [17.6]
              }
            },
            "required": ["level", "gtin", "quantity"],
            "additionalProperties": false
          },
          "minItems": 1,
          "x-openjuvenile-level": "should"
        }
      },
      "additionalProperties": false,
      "x-openjuvenile-level": "should"
    },
    "countryOfOrigin": {
      "$ref": "#/$defs/countryCode",
      "description": "Country of origin of the product.",
      "x-openjuvenile-level": "should"
    },
    "lifecycle": {
      "description": "Market status of the product.",
      "type": "object",
      "properties": {
        "status": {
          "description": "announced: not yet available · active: available · discontinued: no longer produced.",
          "type": "string",
          "enum": ["announced", "active", "discontinued"],
          "examples": ["active"]
        },
        "launchDate": {
          "$ref": "#/$defs/date",
          "description": "Date from which the product is or was available.",
          "x-openjuvenile-level": "should"
        },
        "discontinuedDate": {
          "$ref": "#/$defs/date",
          "description": "Date from which the product is no longer produced.",
          "x-openjuvenile-level": "conditional",
          "x-openjuvenile-condition": "status is discontinued."
        }
      },
      "required": ["status"],
      "additionalProperties": false,
      "x-openjuvenile-level": "should",
      "if": {
        "properties": {
          "status": {
            "const": "discontinued"
          }
        },
        "required": ["status"]
      },
      "then": {
        "required": ["discontinuedDate"]
      }
    },
    "profiles": {
      "description": "Category profiles with category-specific fields, keyed by profile key: stroller and carSeat. The profile that matches category.code MUST be present.",
      "type": "object",
      "properties": {
        "stroller": {
          "$ref": "profiles/stroller.schema.json",
          "description": "Profile for strollers, prams and buggies.",
          "x-openjuvenile-level": "conditional",
          "x-openjuvenile-condition": "category.code is stroller."
        },
        "carSeat": {
          "$ref": "profiles/car-seat.schema.json",
          "description": "Profile for child car seats.",
          "x-openjuvenile-level": "conditional",
          "x-openjuvenile-condition": "category.code is car-seat."
        }
      },
      "additionalProperties": false,
      "x-openjuvenile-level": "conditional",
      "x-openjuvenile-condition": "category.code has a category profile (stroller, car-seat)."
    },
    "compliance": {
      "$ref": "compliance.schema.json",
      "description": "Compliance block: markets, regulations, standards, test reports, warnings and Digital Product Passport."
    },
    "media": {
      "$ref": "media.schema.json",
      "description": "Media block: images, documents, videos and 3D/AR models."
    },
    "compatibility": {
      "$ref": "compatibility.schema.json",
      "description": "Compatibility block: products this product can be combined with.",
      "x-openjuvenile-level": "may"
    }
  },
  "required": [
    "specVersion",
    "recordInfo",
    "gtin",
    "brand",
    "manufacturer",
    "modelName",
    "category",
    "title",
    "dimensions",
    "weight",
    "compliance",
    "media"
  ],
  "patternProperties": {
    "^x-": {
      "description": "Extension fields. Names start with x- and are ignored by consumers that do not know them."
    }
  },
  "additionalProperties": false,
  "allOf": [
    {
      "$comment": "GPSR Art. 19: EU responsible person for manufacturers established outside the EU.",
      "if": {
        "properties": {
          "manufacturer": {
            "properties": {
              "postalAddress": {
                "properties": {
                  "country": {
                    "not": {
                      "$ref": "#/$defs/euMemberState"
                    }
                  }
                },
                "required": ["country"]
              }
            },
            "required": ["postalAddress"]
          }
        },
        "required": ["manufacturer"]
      },
      "then": {
        "required": ["euResponsiblePerson"]
      }
    },
    {
      "if": {
        "properties": {
          "category": {
            "properties": {
              "code": {
                "const": "stroller"
              }
            },
            "required": ["code"]
          }
        },
        "required": ["category"]
      },
      "then": {
        "required": ["profiles"],
        "properties": {
          "profiles": {
            "required": ["stroller"]
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "category": {
            "properties": {
              "code": {
                "const": "car-seat"
              }
            },
            "required": ["code"]
          }
        },
        "required": ["category"]
      },
      "then": {
        "required": ["profiles"],
        "properties": {
          "profiles": {
            "required": ["carSeat"]
          }
        }
      }
    }
  ],
  "$defs": {
    "gtin": {
      "description": "GTIN-8, GTIN-12, GTIN-13 or GTIN-14 with a valid GS1 check digit.",
      "type": "string",
      "pattern": "^(\\d{8}|\\d{12}|\\d{13}|\\d{14})$",
      "format": "gtin",
      "examples": ["9521234567899"]
    },
    "gln": {
      "description": "Global Location Number: 13 digits with a valid GS1 check digit.",
      "type": "string",
      "pattern": "^\\d{13}$",
      "format": "gln",
      "examples": ["9521234000006"]
    },
    "localizedString": {
      "description": "Text per language. Keys are BCP 47 language tags (for example en, de, de-AT), values are non-empty strings. At least one language.",
      "type": "object",
      "propertyNames": {
        "pattern": "^[a-z]{2,3}(-[A-Z][a-z]{3})?(-([A-Z]{2}|[0-9]{3}))?$"
      },
      "additionalProperties": {
        "type": "string",
        "minLength": 1
      },
      "minProperties": 1,
      "examples": [
        {
          "en": "Graphite",
          "de": "Graphit"
        }
      ]
    },
    "countryCode": {
      "description": "ISO 3166-1 alpha-2 country code in upper case.",
      "type": "string",
      "pattern": "^[A-Z]{2}$",
      "examples": ["AT"]
    },
    "euMemberState": {
      "description": "ISO 3166-1 alpha-2 codes of the EU member states.",
      "type": "string",
      "enum": [
        "AT",
        "BE",
        "BG",
        "CY",
        "CZ",
        "DE",
        "DK",
        "EE",
        "ES",
        "FI",
        "FR",
        "GR",
        "HR",
        "HU",
        "IE",
        "IT",
        "LT",
        "LU",
        "LV",
        "MT",
        "NL",
        "PL",
        "PT",
        "RO",
        "SE",
        "SI",
        "SK"
      ]
    },
    "languageCode": {
      "description": "BCP 47 language tag.",
      "type": "string",
      "pattern": "^[a-z]{2,3}(-[A-Z][a-z]{3})?(-([A-Z]{2}|[0-9]{3}))?$",
      "examples": ["en"]
    },
    "url": {
      "description": "Absolute https or http URL.",
      "type": "string",
      "format": "uri",
      "pattern": "^https?://",
      "examples": ["https://example.com"]
    },
    "email": {
      "description": "Email address.",
      "type": "string",
      "format": "email",
      "examples": ["productsafety@example.com"]
    },
    "date": {
      "description": "Calendar date in ISO 8601 format (YYYY-MM-DD).",
      "type": "string",
      "format": "date",
      "examples": ["2026-02-01"]
    },
    "dimensions": {
      "description": "Length, width and height in centimetres.",
      "type": "object",
      "properties": {
        "lengthCm": {
          "description": "Length (depth) in cm.",
          "type": "number",
          "exclusiveMinimum": 0,
          "examples": [85]
        },
        "widthCm": {
          "description": "Width in cm.",
          "type": "number",
          "exclusiveMinimum": 0,
          "examples": [48]
        },
        "heightCm": {
          "description": "Height in cm.",
          "type": "number",
          "exclusiveMinimum": 0,
          "examples": [104]
        }
      },
      "required": ["lengthCm", "widthCm", "heightCm"],
      "additionalProperties": false
    },
    "postalAddress": {
      "description": "Postal address.",
      "type": "object",
      "properties": {
        "streetAddress": {
          "description": "Street and house number, or post office box.",
          "type": "string",
          "minLength": 1,
          "examples": ["1 Example Street"]
        },
        "postalCode": {
          "description": "Postal code, if the country uses postal codes.",
          "type": "string",
          "minLength": 1,
          "x-openjuvenile-level": "should",
          "examples": ["1010"]
        },
        "locality": {
          "description": "City or town.",
          "type": "string",
          "minLength": 1,
          "examples": ["Example City"]
        },
        "region": {
          "description": "State, province or region, where part of the address.",
          "type": "string",
          "minLength": 1,
          "x-openjuvenile-level": "may"
        },
        "country": {
          "$ref": "#/$defs/countryCode",
          "description": "Country of the address (ISO 3166-1 alpha-2)."
        }
      },
      "required": ["streetAddress", "locality", "country"],
      "additionalProperties": false
    },
    "party": {
      "description": "An economic operator with contact details.",
      "type": "object",
      "properties": {
        "name": {
          "description": "Name of the company.",
          "type": "string",
          "minLength": 1,
          "examples": ["Example Brand Ltd."]
        },
        "postalAddress": {
          "$ref": "#/$defs/postalAddress",
          "description": "Postal address at which the company can be contacted."
        },
        "email": {
          "$ref": "#/$defs/email",
          "description": "Electronic address at which the company can be contacted."
        },
        "website": {
          "$ref": "#/$defs/url",
          "description": "Website of the company.",
          "x-openjuvenile-level": "should"
        }
      },
      "required": ["name", "postalAddress", "email"],
      "additionalProperties": false
    },
    "responsiblePerson": {
      "description": "The EU responsible person with contact details.",
      "type": "object",
      "properties": {
        "name": {
          "description": "Name of the company or person.",
          "type": "string",
          "minLength": 1,
          "examples": ["Example EU Representative GmbH"]
        },
        "postalAddress": {
          "$ref": "#/$defs/postalAddress",
          "description": "Postal address in the EU."
        },
        "email": {
          "$ref": "#/$defs/email",
          "description": "Electronic address at which the responsible person can be contacted."
        }
      },
      "required": ["name", "postalAddress", "email"],
      "additionalProperties": false
    },
    "range": {
      "description": "A range with a lower and/or an upper limit. The unit is part of the name of the field that holds the range, for example childWeightKg. At least one limit.",
      "type": "object",
      "properties": {
        "min": {
          "description": "Lower limit (inclusive).",
          "type": "number",
          "minimum": 0,
          "x-openjuvenile-level": "should",
          "examples": [0]
        },
        "max": {
          "description": "Upper limit (inclusive).",
          "type": "number",
          "exclusiveMinimum": 0,
          "x-openjuvenile-level": "should",
          "examples": [22]
        }
      },
      "additionalProperties": false,
      "anyOf": [
        {
          "required": ["min"]
        },
        {
          "required": ["max"]
        }
      ]
    },
    "closedRange": {
      "description": "A range with a lower and an upper limit. The unit is part of the name of the field that holds the range, for example childHeightCm.",
      "type": "object",
      "properties": {
        "min": {
          "description": "Lower limit (inclusive).",
          "type": "number",
          "minimum": 0,
          "examples": [40]
        },
        "max": {
          "description": "Upper limit (inclusive).",
          "type": "number",
          "exclusiveMinimum": 0,
          "examples": [87]
        }
      },
      "required": ["min", "max"],
      "additionalProperties": false
    }
  }
}
