{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bol-com/json-schema/bol-com-performance-indicators-schema.json",
  "title": "PerformanceIndicators",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bol-com-insights-api-openapi.yml#/components/schemas/PerformanceIndicators",
  "required": [
    "performanceIndicators"
  ],
  "type": "object",
  "properties": {
    "performanceIndicators": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PerformanceIndicator"
      }
    }
  },
  "$defs": {
    "Details": {
      "required": [
        "norm",
        "period"
      ],
      "type": "object",
      "properties": {
        "period": {
          "$ref": "#/$defs/PerformanceIndicatorPeriod"
        },
        "score": {
          "allOf": [
            {
              "$ref": "#/$defs/Score"
            }
          ]
        },
        "norm": {
          "$ref": "#/$defs/Norm"
        }
      },
      "description": "Details of the indicator."
    },
    "Norm": {
      "required": [
        "condition",
        "value"
      ],
      "type": "object",
      "properties": {
        "condition": {
          "type": "string",
          "description": "Condition norm for this indicator.",
          "enum": [
            "<=",
            ">="
          ]
        },
        "value": {
          "type": "number",
          "description": "Service norm for this indicator.",
          "format": "float"
        }
      },
      "description": "Service norm for this indicator."
    },
    "PerformanceIndicator": {
      "required": [
        "details",
        "name",
        "type"
      ],
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Indicator name.",
          "enum": [
            "CANCELLATIONS",
            "FULFILMENT",
            "PHONE_AVAILABILITY",
            "RESPONSE_TIME",
            "CASE_ITEM_RATIO",
            "TRACK_AND_TRACE",
            "RETURNS",
            "REVIEWS"
          ]
        },
        "type": {
          "type": "string",
          "description": "Interpretation of the data that applies to this measurement.",
          "enum": [
            "PERCENTAGE",
            "AVERAGE"
          ]
        },
        "details": {
          "$ref": "#/$defs/Details"
        }
      }
    },
    "PerformanceIndicatorPeriod": {
      "required": [
        "week",
        "year"
      ],
      "type": "object",
      "properties": {
        "week": {
          "type": "string",
          "description": "Week number in the ISO-8601 standard."
        },
        "year": {
          "type": "string",
          "description": "Year number in the ISO-8601 standard."
        }
      },
      "description": "The period for which the performance is measured."
    },
    "Score": {
      "required": [
        "conforms",
        "denominator",
        "distanceToNorm",
        "numerator",
        "value"
      ],
      "type": "object",
      "properties": {
        "conforms": {
          "type": "boolean",
          "description": "Indicates whether the score conforms to the bol.com service norm or not."
        },
        "numerator": {
          "type": "integer",
          "description": "The top part of the fraction (above the line). This usually is the smaller number compared to the denominator.",
          "format": "int32"
        },
        "denominator": {
          "type": "integer",
          "description": "The lower part of the fraction (below the line). This usually is the larger number compared to the the numerator.",
          "format": "int32"
        },
        "value": {
          "type": "number",
          "description": "The score for this measurement (denominator divided by the numerator).",
          "format": "float"
        },
        "distanceToNorm": {
          "type": "number",
          "description": "The difference between the score and the bol.com service norm.",
          "format": "float"
        }
      },
      "description": "The score for this measurement. In case there are no scores for an indicator, this element is omitted from the response."
    }
  }
}