{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/vatfind-com/json-schema/vatfind-com-company-schema.json",
  "title": "Company",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/vatfind-com-openapi.yml#/components/schemas/Company",
  "type": "object",
  "required": [
    "id",
    "object",
    "legal_name",
    "vat_numbers",
    "tax_identifiers",
    "country_code",
    "company_legal_status",
    "sources",
    "retrieved_at"
  ],
  "properties": {
    "tax_number_evidence": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "number",
        "source_urls",
        "retrieved_at"
      ],
      "properties": {
        "number": {
          "type": "string"
        },
        "source_urls": {
          "type": "array",
          "maxItems": 3,
          "items": {
            "type": "string",
            "format": "uri"
          }
        },
        "retrieved_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "Published evidence for a recovered VAT/EIN. Registry facts retain their separate source."
    },
    "id": {
      "type": "string",
      "pattern": "^cmp_"
    },
    "object": {
      "const": "company"
    },
    "legal_name": {
      "type": "string"
    },
    "registration_number": {
      "type": "string"
    },
    "vat_numbers": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_identifiers": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "country_code": {
      "$ref": "#/$defs/CountryCode"
    },
    "company_legal_status": {
      "$ref": "#/$defs/CompanyLegalStatus"
    },
    "raw_company_legal_status": {
      "type": "string"
    },
    "legal_form": {
      "type": "string"
    },
    "incorporation_date": {
      "type": "string",
      "format": "date"
    },
    "registered_address": {
      "type": "object",
      "properties": {
        "formatted": {
          "type": "string"
        }
      },
      "required": [
        "formatted"
      ]
    },
    "website": {
      "type": "string",
      "format": "uri"
    },
    "sources": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Source"
      }
    },
    "retrieved_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "CompanyLegalStatus": {
      "type": "string",
      "enum": [
        "active",
        "inactive",
        "dissolved",
        "liquidation",
        "insolvency",
        "unknown",
        "unavailable",
        "not_applicable",
        "not_supported",
        "not_checked"
      ]
    },
    "CountryCode": {
      "type": "string",
      "pattern": "^[A-Z]{2}$"
    },
    "Source": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "source_type"
      ],
      "properties": {
        "source_type": {
          "type": "string",
          "enum": [
            "government_registry",
            "official_public_record",
            "licensed_data_provider"
          ]
        },
        "source_name": {
          "type": "string"
        },
        "source_url": {
          "type": "string",
          "format": "uri"
        }
      }
    }
  }
}