{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/engrate/json-schema/engrate-get-metering-grid-areas-response-schema.json",
  "title": "GetMeteringGridAreasResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/engrate-core-api-openapi.yml#/components/schemas/GetMeteringGridAreasResponse",
  "properties": {
    "mgas": {
      "items": {
        "$ref": "#/$defs/MeteringGridArea"
      },
      "title": "Mgas",
      "type": "array"
    }
  },
  "required": [
    "mgas"
  ],
  "type": "object",
  "$defs": {
    "ExtraIdentifier": {
      "description": "Extra identifiers are used to attach things like EIC ids, VAT numbers, jurisdiction-specific identifiers, etc.\n\nFor example, Metering Grid Area's in parts of Europe are assigned an local jurisdiction EIC code; for those MGAs, the Engrate system will store the EIC as an extra identifier. However some jurisdictions have not yet switched to EIC codes, instead they rely on older local identification schemes. Swedish MGAs, as an example, use a local code assigned by the Swedish TSO.\n\nBecause the local schemes are subject to collisions - two TSOs assigning the same numerical code to different things, as they do not coordinate id assignment - we also track an identifier \"kind\".",
      "properties": {
        "kind": {
          "$ref": "#/$defs/IdentifierKind",
          "description": "The kind of identifier"
        },
        "value": {
          "description": "The identifier value",
          "title": "Value",
          "type": "string"
        }
      },
      "required": [
        "kind",
        "value"
      ],
      "title": "ExtraIdentifier",
      "type": "object"
    },
    "Identifier": {
      "properties": {
        "extra_ids": {
          "description": "[Extra Identifiers](/api-reference/core/models/extra-identifier) used to reference this same entity",
          "items": {
            "$ref": "#/$defs/ExtraIdentifier"
          },
          "title": "Extra Ids",
          "type": "array"
        },
        "id": {
          "description": "Unique identifier assigned by Engrate",
          "format": "uuid",
          "title": "Id",
          "type": "string"
        }
      },
      "required": [
        "extra_ids",
        "id"
      ],
      "title": "Identifier",
      "type": "object"
    },
    "IdentifierKind": {
      "enum": [
        "eic",
        "vat",
        "gln",
        "se.ediel",
        "se.mga_code",
        "no.mga_code",
        "esett.mga_type"
      ],
      "title": "IdentifierKind",
      "type": "string"
    },
    "MeteringGridArea": {
      "description": "A Metering Grid Area (MGA) is a core domain concept in the European energy market.\n\nThe [ENTSO-E Harmonized Electricity Market Role Model](https://www.entsoe.eu/data/cim/role-models/) defines an MGA as:\n\n> A physical area where consumption, production and exchange can be measured. It is delimited by the placement of meters for continuous measurement for input to, and withdrawal from the area.\n\nIn other words, an MGA is a collection of Metering Points operated by some System Operator, usually a DSO.",
      "properties": {
        "extra_ids": {
          "description": "[Extra Identifiers](/api-reference/core/models/extra-identifier) for this MGA",
          "items": {
            "$ref": "#/$defs/ExtraIdentifier"
          },
          "title": "Extra Ids",
          "type": "array"
        },
        "id": {
          "description": "Unique identifier for the MGA",
          "format": "uuid",
          "title": "Id",
          "type": "string"
        },
        "name": {
          "description": "Name of the metering grid area",
          "title": "Name",
          "type": "string"
        },
        "scheduling_area_eic": {
          "description": "EIC code for the Scheduling Area this Metering Grid Area belongs to",
          "title": "Scheduling Area Eic",
          "type": "string"
        },
        "system_operator": {
          "$ref": "#/$defs/Identifier",
          "description": "The [Party](/api-reference/core/models/party) that operates this MGA"
        }
      },
      "required": [
        "extra_ids",
        "id",
        "name",
        "scheduling_area_eic",
        "system_operator"
      ],
      "title": "MeteringGridArea",
      "type": "object"
    }
  }
}