{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/carbonara-co2-org/json-schema/carbonara-co2-org-report-schema.json",
  "title": "Report",
  "description": "See pkg/report for every field. Emissions in kg CO2e.",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/carbonara-co2-org-openapi.yaml#/components/schemas/Report",
  "type": "object",
  "properties": {
    "title": {
      "type": "string"
    },
    "organisation": {
      "type": "string"
    },
    "period": {
      "type": "object",
      "properties": {
        "from": {
          "type": "string"
        },
        "to": {
          "type": "string"
        }
      }
    },
    "level": {
      "type": "string"
    },
    "statement": {
      "type": "string"
    },
    "reference": {
      "type": "string"
    },
    "datasets": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "generated": {
      "type": "string",
      "format": "date-time"
    },
    "coverage": {
      "type": "object",
      "properties": {
        "shipments": {
          "type": "integer"
        },
        "calculated": {
          "type": "integer"
        },
        "failed": {
          "type": "integer"
        },
        "failed_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "First 100"
        },
        "retryable_failed": {
          "type": "integer",
          "description": "Failures that weren't the data's fault (a routing service didn't answer, also when tried again): calculate them again"
        },
        "legs": {
          "type": "integer"
        },
        "hub_stops": {
          "type": "integer"
        },
        "weight_t": {
          "type": "number"
        },
        "added_road_legs": {
          "type": "integer",
          "description": "Road legs added by the calculator",
          "included in legs and totals": null
        },
        "added_road_km": {
          "type": "number"
        },
        "added_road_leg_shipments": {
          "type": "integer"
        },
        "warned_shipments": {
          "type": "integer"
        },
        "warnings": {
          "type": "array",
          "description": "Warnings by kind",
          "items": {
            "type": "object",
            "properties": {
              "reason": {
                "type": "string"
              },
              "shipments": {
                "type": "integer"
              }
            }
          }
        }
      }
    },
    "total": {
      "type": "object",
      "properties": {
        "wtw_kg": {
          "type": "number"
        },
        "transport_wtw_kg": {
          "type": "number"
        },
        "ttw_kg": {
          "type": "number",
          "description": "Operational emissions",
          "transport": null
        },
        "wtt_kg": {
          "type": "number",
          "description": "Energy provision emissions",
          "transport": null
        },
        "hub_wtw_kg": {
          "type": "number"
        },
        "tonne_km": {
          "type": "number"
        },
        "intensity_g_per_tkm": {
          "type": "number"
        },
        "distance_types": {
          "type": "object",
          "additionalProperties": {
            "type": "number"
          },
          "description": "Share of tonne-km per distance type (sfd, gcd, actual, unspecified)"
        }
      }
    },
    "modes": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "hubs": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "energy_carriers": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "data_quality": {
      "type": "object"
    },
    "distance_adjustments": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "notes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "ghg_protocol": {
      "type": "object",
      "description": "The totals by GHG Protocol scope: the shipper's scope 3 category, and the operator's scopes 1, 2 and 3 category 3"
    }
  }
}