{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/monerium/main/json-schema/monerium-corporate-details-schema.json",
  "title": "CorporateDetails",
  "description": "Company information such as name, registration number, address, and details of representatives, final beneficiaries, and directors.\n",
  "x-generated": "2026-10-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/monerium-openapi.yml#/components/schemas/CorporateDetails",
  "type": "object",
  "properties": {
    "name": {
      "description": "Name of the company.",
      "type": "string"
    },
    "registrationNumber": {
      "description": "The company's registration number.",
      "type": "string"
    },
    "registrationDate": {
      "description": "The company's registration date.",
      "type": "string",
      "format": "date",
      "pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|1\\d|2\\d|3[01])$"
    },
    "vatNumber": {
      "description": "The company's VAT number.",
      "type": "string"
    },
    "website": {
      "description": "The company's website.",
      "type": "string"
    },
    "address": {
      "description": "Street and building number where the corporate is located.",
      "type": "string",
      "maximum": 70
    },
    "postalCode": {
      "description": "Postal code where the corporate is located.",
      "type": "string"
    },
    "city": {
      "description": "City where the corporate is located.",
      "type": "string"
    },
    "country": {
      "description": "Two-letter country code [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) where the corporate is located",
      "$ref": "#/$defs/CountryCode"
    },
    "countryState": {
      "description": "State/County where the corporate is located.",
      "type": "string"
    },
    "representatives": {
      "description": "List of individuals representing the company and authorized to act on its behalf.",
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "idDocument"
        ],
        "properties": {
          "idDocument": {
            "$ref": "#/$defs/IdDocument"
          }
        },
        "allOf": [
          {
            "$ref": "#/$defs/PersonalDetails"
          }
        ]
      }
    },
    "finalBeneficiaries": {
      "description": "List of beneficial owner that owns 25% or more in a company.",
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "ownershipPercentage"
        ],
        "properties": {
          "ownershipPercentage": {
            "description": "Ownership in % that is between 25% and 100%.",
            "type": "string",
            "format": "number",
            "maximum": 100,
            "minimum": 25,
            "pattern": "^(?:25(?:\\.0{1,2})?|2[6-9](?:\\.\\d{1,2})?|[3-9]\\d(?:\\.\\d{1,2})?|100(?:\\.0{1,2})?)$"
          }
        },
        "allOf": [
          {
            "$ref": "#/$defs/PersonalDetails"
          }
        ]
      }
    },
    "directors": {
      "description": "List of Individual who has powers to legally bind the company (power of procuration).",
      "type": "array",
      "items": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/$defs/PersonalDetails"
          }
        ]
      }
    }
  },
  "required": [
    "name",
    "registrationNumber",
    "registrationDate",
    "address",
    "postalCode",
    "city",
    "country",
    "countryState",
    "representatives",
    "finalBeneficiaries",
    "directors"
  ],
  "$defs": {
    "CountryCode": {
      "description": "Two-letter country code [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)",
      "type": "string",
      "maxLength": 2,
      "minLength": 2
    },
    "IdDocument": {
      "description": "Details of the ID document used to verify the person's identity.",
      "type": "object",
      "properties": {
        "number": {
          "description": "The document number.",
          "type": "string"
        },
        "kind": {
          "description": "The type of ID document. Must verify the person's name, birthday, and nationality.",
          "type": "string",
          "enum": [
            "passport",
            "nationalIdentityCard"
          ]
        }
      },
      "required": [
        "number",
        "kind"
      ]
    },
    "PersonalDetails": {
      "description": "Personal information such as name, address, nationality, and date of birth.",
      "type": "object",
      "properties": {
        "firstName": {
          "description": "First name",
          "type": "string"
        },
        "lastName": {
          "description": "Last name",
          "type": "string"
        },
        "address": {
          "description": "Street and building number where the person lives.",
          "type": "string",
          "maximum": 70
        },
        "postalCode": {
          "description": "Postal code where the person lives.",
          "type": "string"
        },
        "city": {
          "description": "City where the person lives.",
          "type": "string"
        },
        "country": {
          "description": "Two-letter country code [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) where the person lives",
          "$ref": "#/$defs/CountryCode"
        },
        "countryState": {
          "description": "State/County where the person lives.",
          "type": "string"
        },
        "nationality": {
          "description": "Two-letter country code [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) for the person's nationality.",
          "$ref": "#/$defs/CountryCode"
        },
        "birthday": {
          "description": "The person's date of birth in `YYYY-MM-DD` format.",
          "type": "string",
          "format": "date",
          "pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|1\\d|2\\d|3[01])$"
        },
        "phone": {
          "description": "The person's phone number.",
          "type": "string"
        },
        "email": {
          "description": "The person's email address.",
          "type": "string",
          "format": "email"
        }
      },
      "required": [
        "firstName",
        "lastName",
        "address",
        "postalCode",
        "city",
        "country",
        "nationality",
        "birthday",
        "phone",
        "email"
      ]
    }
  }
}