{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/engrate/json-schema/engrate-allocations-response-schema.json",
  "title": "AllocationsResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/engrate-time-series-api-openapi.yml#/components/schemas/AllocationsResponse",
  "properties": {
    "values": {
      "items": {
        "$ref": "#/$defs/AllocationRecord"
      },
      "title": "Values",
      "type": "array"
    }
  },
  "required": [
    "values"
  ],
  "type": "object",
  "$defs": {
    "AllocationQuality": {
      "description": "How the volume was arrived at, in ascending order of trust. When one settlement period carries several records, prefer the highest quality.\n\n### Available allocation qualities\n\n- **provisional** — A placeholder the sender intends to replace.\n\n- **estimated** — Substituted because no reading was available: profiled, interpolated, or copied from a comparable period. Expect it to be superseded.\n\n- **calculated** — Derived by a defined computation rather than read\n\n- **measured** — Read off the meter.",
      "enum": [
        "provisional",
        "estimated",
        "calculated",
        "measured"
      ],
      "title": "AllocationQuality",
      "type": "string"
    },
    "AllocationRecord": {
      "description": "A volume allocated to some Accounting Point for one Imbalance Settlement Period (ISP).",
      "properties": {
        "accounting_point_id": {
          "format": "uuid",
          "title": "Accounting Point Id",
          "type": "string"
        },
        "flow_direction": {
          "enum": [
            "consumption",
            "production"
          ],
          "title": "Flow Direction",
          "type": "string"
        },
        "isp_resolution_minutes": {
          "title": "Isp Resolution Minutes",
          "type": "integer"
        },
        "isp_time": {
          "format": "date-time",
          "title": "Isp Time",
          "type": "string"
        },
        "known_at": {
          "format": "date-time",
          "title": "Known At",
          "type": "string"
        },
        "quality": {
          "$ref": "#/$defs/AllocationQuality"
        },
        "volume_wh": {
          "title": "Volume Wh",
          "type": "integer"
        }
      },
      "required": [
        "accounting_point_id",
        "flow_direction",
        "isp_resolution_minutes",
        "isp_time",
        "known_at",
        "quality",
        "volume_wh"
      ],
      "title": "AllocationRecord",
      "type": "object"
    }
  }
}