{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/vatfind-com/json-schema/vatfind-com-check-schema.json",
  "title": "Check",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/vatfind-com-openapi.yml#/components/schemas/Check",
  "type": "object",
  "required": [
    "id",
    "object",
    "processing_status",
    "source",
    "identifier",
    "format_status",
    "registry_match_status",
    "tax_authority_status",
    "company_legal_status",
    "evidence",
    "warnings",
    "credits_used",
    "created_at",
    "completed_at"
  ],
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^chk_"
    },
    "object": {
      "const": "check"
    },
    "processing_status": {
      "const": "completed"
    },
    "source": {
      "type": "string",
      "enum": [
        "api",
        "mcp",
        "dashboard",
        "monitoring"
      ]
    },
    "identifier": {
      "$ref": "#/$defs/Identifier"
    },
    "format_status": {
      "$ref": "#/$defs/FormatStatus"
    },
    "registry_match_status": {
      "$ref": "#/$defs/RegistryMatchStatus"
    },
    "tax_authority_status": {
      "$ref": "#/$defs/TaxAuthorityStatus"
    },
    "company_legal_status": {
      "$ref": "#/$defs/CompanyLegalStatus"
    },
    "company_name": {
      "type": "string"
    },
    "client_reference": {
      "type": "string"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "company": {
      "$ref": "#/$defs/Company"
    },
    "evidence": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Evidence"
      }
    },
    "warnings": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Warning"
      }
    },
    "credits_used": {
      "type": "integer",
      "minimum": 0
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "completed_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "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"
        }
      }
    },
    "CompanyLegalStatus": {
      "type": "string",
      "enum": [
        "active",
        "inactive",
        "dissolved",
        "liquidation",
        "insolvency",
        "unknown",
        "unavailable",
        "not_applicable",
        "not_supported",
        "not_checked"
      ]
    },
    "CountryCode": {
      "type": "string",
      "pattern": "^[A-Z]{2}$"
    },
    "Evidence": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "dimension",
        "source_type",
        "retrieved_at"
      ],
      "properties": {
        "dimension": {
          "type": "string",
          "enum": [
            "format",
            "registry_match",
            "tax_authority",
            "company_legal"
          ]
        },
        "source_type": {
          "type": "string",
          "enum": [
            "vatfind_rules",
            "government_registry",
            "tax_authority",
            "official_public_record",
            "licensed_data_provider"
          ]
        },
        "source_name": {
          "type": "string"
        },
        "source_url": {
          "type": "string",
          "format": "uri"
        },
        "raw_status": {
          "type": "string"
        },
        "retrieved_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "FormatStatus": {
      "type": "string",
      "enum": [
        "valid",
        "invalid",
        "not_supported",
        "not_checked"
      ]
    },
    "Identifier": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "input",
        "normalized",
        "country_code"
      ],
      "properties": {
        "type": {
          "$ref": "#/$defs/IdentifierType"
        },
        "input": {
          "type": "string"
        },
        "normalized": {
          "type": "string"
        },
        "country_code": {
          "$ref": "#/$defs/CountryCode"
        }
      }
    },
    "IdentifierType": {
      "type": "string",
      "enum": [
        "vat_number",
        "tax_identifier",
        "registration_number"
      ]
    },
    "RegistryMatchStatus": {
      "type": "string",
      "enum": [
        "matched",
        "not_matched",
        "ambiguous",
        "unavailable",
        "not_supported",
        "not_checked"
      ]
    },
    "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"
        }
      }
    },
    "TaxAuthorityStatus": {
      "type": "string",
      "enum": [
        "valid",
        "invalid",
        "unavailable",
        "not_applicable",
        "not_supported",
        "not_checked"
      ]
    },
    "Warning": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "dimension",
        "code",
        "message",
        "retryable"
      ],
      "properties": {
        "dimension": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        }
      }
    }
  }
}