{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/e-vignettes-eu/json-schema/e-vignettes-eu-product-list-schema.json",
  "title": "ProductList",
  "x-generated": "2026-11-06",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/e-vignettes-eu-openapi.json#/components/schemas/ProductList",
  "type": "object",
  "required": [
    "object",
    "count",
    "filters",
    "data"
  ],
  "properties": {
    "object": {
      "type": "string",
      "const": "list"
    },
    "count": {
      "type": "integer"
    },
    "filters": {
      "type": "object",
      "description": "The filters that produced this list, echoed back.",
      "required": [
        "country",
        "type"
      ],
      "properties": {
        "country": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": "string"
        }
      }
    },
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Product"
      }
    }
  },
  "$defs": {
    "Offer": {
      "type": "object",
      "description": "One validity period of a product, priced.",
      "required": [
        "validity",
        "validity_label",
        "total_price",
        "government_price",
        "partner_fee",
        "currency",
        "restrictions"
      ],
      "properties": {
        "validity": {
          "type": "string",
          "description": "Validity in days (\"1\", \"10\", \"365\") or trips (\"1j\") for section tolls."
        },
        "validity_label": {
          "type": "string",
          "description": "Human label."
        },
        "total_price": {
          "type": "number",
          "description": "What the customer pays, fee included."
        },
        "government_price": {
          "type": [
            "number",
            "null"
          ],
          "description": "Price set by the national operator, where the operator publishes one."
        },
        "partner_fee": {
          "type": [
            "number",
            "null"
          ],
          "description": "Vignette ID's service fee."
        },
        "currency": {
          "type": "string",
          "description": "ISO 4217, upper case."
        },
        "restrictions": {
          "type": "array",
          "description": "Conditions checkout must handle, e.g. a start date no earlier than tomorrow.",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "Product": {
      "type": "object",
      "required": [
        "id",
        "title",
        "type",
        "country",
        "vehicle_type",
        "status",
        "checkout_url",
        "offers"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable product identifier."
        },
        "title": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "vignette",
            "tunnel"
          ]
        },
        "country": {
          "type": "string",
          "description": "ISO 3166-1 alpha-2, lower case."
        },
        "vehicle_type": {
          "type": [
            "string",
            "null"
          ],
          "description": "Vehicle class the product applies to. Null for section tolls, which are priced per crossing rather than per vehicle class.",
          "enum": [
            "car",
            "van",
            "moto",
            "trailer",
            null
          ]
        },
        "status": {
          "type": "string",
          "description": "Only `active` products are returned."
        },
        "checkout_url": {
          "type": "string",
          "format": "uri",
          "description": "Where a human buys this product."
        },
        "offers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Offer"
          }
        }
      }
    }
  }
}