{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/companydata-dk/json-schema/companydata-dk-cdssummary-schema.json",
  "title": "CDSSummary",
  "description": "CDS (CompanyData Score) - proprietary credit/health score for companies.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/companydata-dk-openapi.yml#/components/schemas/CDSSummary",
  "properties": {
    "score": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 100.0,
          "minimum": -1.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Score",
      "description": "Score from 0-100 (higher is better). -1 = a score exists but is not published yet"
    },
    "rating": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Rating",
      "description": "Rating category"
    },
    "confidence": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Confidence",
      "description": "How much data the score rests on: high = recent accounts, audit and ownership data on file; low = mostly registry data"
    },
    "credit_recommendation": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Credit Recommendation",
      "description": "Trade-credit recommendation: status (recommended/zero_advised/no_recommendation), limit_dkk, payment_terms_days (0 = prepayment), basis, reason"
    },
    "has_score": {
      "type": "boolean",
      "title": "Has Score",
      "description": "Whether a score has been calculated for this company",
      "default": false
    },
    "not_scored_reason": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Not Scored Reason",
      "description": "Machine-readable reason when no score is disclosed. 'company_dissolved' = the company has ceased; no credit assessment is made or disclosed for dissolved companies."
    },
    "calculated_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Calculated At",
      "description": "When the score was last calculated"
    },
    "pillars": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/CDSPillar"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pillars",
      "description": "Coarse per-pillar breakdown (only on the dedicated /companies/{cvr}/cds endpoint)"
    }
  },
  "type": "object",
  "$defs": {
    "CDSPillar": {
      "properties": {
        "key": {
          "type": "string",
          "title": "Key",
          "description": "Pillar key"
        },
        "score": {
          "type": "number",
          "title": "Score",
          "description": "Points earned on this pillar"
        },
        "max": {
          "type": "number",
          "title": "Max",
          "description": "Maximum points available on this pillar for this company"
        }
      },
      "type": "object",
      "required": [
        "key",
        "score",
        "max"
      ],
      "title": "CDSPillar",
      "description": "Coarse pillar score. Only pillars applicable to the company appear\n(structurally absent data classes are renormalized away, not zero-filled).\nSub-factor detail is deliberately not exposed (methodology: public surfaces\nshow the coarse pillar breakdown only)."
    }
  }
}