{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/peppolstatus-com/json-schema/peppolstatus-com-adoption-report-schema.json",
  "title": "AdoptionReport",
  "description": "A country's adoption aggregates as one bare object (spec §8.2). No attribution/licence/registry-metadata fields — only the bare snapshot_date.",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/peppolstatus-com-openapi.json#/components/schemas/AdoptionReport",
  "type": "object",
  "required": [
    "country",
    "snapshot_date",
    "generated_at",
    "totals",
    "cuts",
    "cuts_by_age",
    "trend"
  ],
  "properties": {
    "country": {
      "type": "string",
      "description": "BE | FR."
    },
    "snapshot_date": {
      "type": [
        "string",
        "null"
      ],
      "description": "YYYY-MM-DD of the latest run."
    },
    "generated_at": {
      "type": "string",
      "format": "date-time"
    },
    "totals": {
      "$ref": "#/$defs/AdoptionTotals"
    },
    "cuts": {
      "type": "object",
      "required": [
        "sector",
        "section",
        "region",
        "department",
        "province",
        "postcode",
        "size",
        "entity_type",
        "mandate",
        "age"
      ],
      "properties": {
        "sector": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AdoptionCell"
          }
        },
        "section": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AdoptionCell"
          }
        },
        "region": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AdoptionCell"
          }
        },
        "department": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AdoptionCell"
          },
          "description": "FR-only finer geography (INSEE département, postcode-derived; Corsica merged as '20'); empty for BE."
        },
        "province": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AdoptionCell"
          },
          "description": "BE-only finer geography (ISO 3166-2 province, postcode-derived; rolls up inside region); empty for FR."
        },
        "postcode": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AdoptionCell"
          },
          "description": "BE-only finest geography — one cell per 4-digit postcode; empty for FR. Only covers register entities with a known postcode."
        },
        "size": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AdoptionCell"
          },
          "description": "FR-only cut; empty for BE."
        },
        "entity_type": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AdoptionCell"
          },
          "description": "Legal-form family — an exhaustive cut summing back to the total: companies (sociétés & legal entities), sole traders & self-employed, associations & non-profits, public sector & other."
        },
        "mandate": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AdoptionCell"
          },
          "description": "E-invoicing-mandate scope by VAT liability (cells in_scope/out_scope). BE-only: derived from KBO VAT activities (ActivityGroup 001); empty where the register has no VAT signal (FR)."
        },
        "age": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AdoptionCell"
          },
          "description": "Company-age bands by completed years since incorporation (both countries): 00 <2y, 02 2–4y, 05 5–9y, 10 10–19y, 20 20+y. Covers entities with a known incorporation date."
        },
        "ap": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AdoptionApCut"
          },
          "description": "Per-Access-Point adoption — one cell per AP so consumers can zoom the numbers to a subset of APs. Optional: OMITTED entirely until the AP rollup has run. A company present at two APs counts in each AP's cell (per-AP attribution); sub-threshold (< 10) APs are dropped."
        }
      }
    },
    "cuts_by_age": {
      "type": "object",
      "description": "The categorical cuts cross-tabbed by company-age band — an object keyed by the same band codes as cuts.age (00/02/05/10/20), each value holding the cuts re-sliced to that band (sector + section, region, size, entity_type, mandate). The geographic maps (department/province/postcode) are NOT crossed. Empty {} on a worker predating the cross-tab.",
      "additionalProperties": {
        "type": "object",
        "required": [
          "sector",
          "section",
          "region",
          "size",
          "entity_type",
          "mandate"
        ],
        "properties": {
          "sector": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/AdoptionCell"
            }
          },
          "section": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/AdoptionCell"
            }
          },
          "region": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/AdoptionCell"
            }
          },
          "size": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/AdoptionCell"
            }
          },
          "entity_type": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/AdoptionCell"
            }
          },
          "mandate": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/AdoptionCell"
            }
          }
        }
      }
    },
    "trend": {
      "type": "object",
      "required": [
        "new_adopters",
        "penetration"
      ],
      "properties": {
        "new_adopters": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AdoptionTrendPoint"
          }
        },
        "penetration": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AdoptionPenetrationPoint"
          }
        }
      }
    }
  },
  "$defs": {
    "AdoptionApCut": {
      "type": "object",
      "description": "One Access-Point cell (cuts.ap). `code` is the operator SeatID (join key); `label` its provider name, or the bare SeatID when unmapped. Sub-threshold (< 10) APs are dropped, so `on_peppol` is always present here.",
      "required": [
        "code",
        "label",
        "on_peppol",
        "scope_on_peppol",
        "penetration"
      ],
      "properties": {
        "code": {
          "type": "string",
          "description": "Operator SeatID."
        },
        "label": {
          "type": "string",
          "description": "Provider name, or the bare SeatID."
        },
        "on_peppol": {
          "type": "integer",
          "description": "Distinct on-Peppol matched companies attributed to this AP."
        },
        "scope_on_peppol": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The mandate-scope subset (BE VAT-liable / FR company), or null when absent."
        },
        "penetration": {
          "type": [
            "number",
            "null"
          ],
          "description": "on_peppol / country universe in [0,1], or null when universe is 0."
        }
      }
    },
    "AdoptionCell": {
      "type": "object",
      "description": "One segment cell. `universe` (denominator) is always present; `on_peppol` and `penetration` are null when suppressed (numerator < 10).",
      "required": [
        "code",
        "label",
        "universe",
        "on_peppol",
        "penetration",
        "suppressed"
      ],
      "properties": {
        "code": {
          "type": "string",
          "description": "Stable join code: NACE Rev. 2.1 division (sector) or section letter A–V (section), ISO 3166-2 / INSEE région (region), INSEE département (department), ISO 3166-2 province (province), 4-digit postcode (postcode), trancheEffectifs (size), legal-form family (entity_type), or in_scope/out_scope (mandate), or age band (age)."
        },
        "label": {
          "type": "string"
        },
        "universe": {
          "type": "integer",
          "description": "Active registry entities in the cell."
        },
        "on_peppol": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Distinct on-Peppol matched companies, or null when suppressed."
        },
        "penetration": {
          "type": [
            "number",
            "null"
          ],
          "description": "on_peppol / universe in [0,1], or null when suppressed."
        },
        "suppressed": {
          "type": "boolean"
        },
        "section": {
          "type": [
            "string",
            "null"
          ],
          "description": "Parent NACE Rev. 2.1 section letter, A–V (sector division cells only). Rev. 2 letters K–U are L–V in Rev. 2.1 (new section K = telecom, IT, hosting)."
        }
      }
    },
    "AdoptionPenetrationPoint": {
      "type": "object",
      "required": [
        "snapshot_date",
        "universe",
        "on_peppol",
        "penetration"
      ],
      "properties": {
        "snapshot_date": {
          "type": [
            "string",
            "null"
          ],
          "description": "YYYY-MM-DD of the run."
        },
        "universe": {
          "type": "integer"
        },
        "on_peppol": {
          "type": "integer"
        },
        "penetration": {
          "type": [
            "number",
            "null"
          ]
        }
      }
    },
    "AdoptionTotals": {
      "type": "object",
      "required": [
        "universe",
        "on_peppol",
        "penetration"
      ],
      "properties": {
        "universe": {
          "type": "integer"
        },
        "on_peppol": {
          "type": "integer"
        },
        "penetration": {
          "type": [
            "number",
            "null"
          ]
        }
      }
    },
    "AdoptionTrendPoint": {
      "type": "object",
      "required": [
        "month",
        "count"
      ],
      "properties": {
        "month": {
          "type": "string",
          "description": "YYYY-MM."
        },
        "count": {
          "type": "integer",
          "description": "Companies whose first participant appeared."
        }
      }
    }
  }
}