{
  "openapi": "3.0.0",
  "info": {
    "title": "certidoes.ai API",
    "version": "1.1.0"
  },
  "servers": [
    {
      "url": "https://api.certidoes.ai/v1",
      "description": "V1 Production API server of certidoes.ai"
    },
    {
      "url": "https://api.sandbox.certidoes.ai/v1",
      "description": "V1 Sandbox API server of certidoes.ai"
    }
  ],
  "paths": {
    "/cprc": {
      "get": {
        "summary": "Get a Permanent Certificate by Access Code",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Retrieves the details of a specific Permanent Certificate using its access code.",
        "tags": [
          "CPRC"
        ],
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": true,
            "description": "The access code of the Permanent Certificate to retrieve.",
            "schema": {
              "type": "string",
              "example": "0123-4567-8901"
            }
          },
          {
            "name": "includePdf",
            "in": "query",
            "required": false,
            "description": "When exactly true, includes the government's original certificate page printed as a base64-encoded PDF. Available only on authenticated/internal routes.",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ],
              "default": "false"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful retrieval of the Permanent Certificate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProcessedPermanentCertificate"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. Confirm that the access code is provided and properly formatted."
          },
          "401": {
            "description": "Unauthorized. Confirm that you are properly authenticated."
          },
          "403": {
            "description": "Request forbidden. Confirm that the request is allowed according to your plan."
          },
          "404": {
            "description": "Permanent Certificate not found for the provided access code."
          },
          "500": {
            "description": "Internal Server Error."
          }
        }
      }
    },
    "/rcbe": {
      "get": {
        "summary": "Get an RCBE by NIPC",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Retrieves a structured version of a Portuguese RCBE (Registo Central do Beneficiário Efetivo) document.",
        "tags": [
          "RCBE"
        ],
        "parameters": [
          {
            "name": "nipc",
            "in": "query",
            "required": true,
            "description": "The NIPC (Número de Identificação de Pessoa Coletiva) or company tax ID.",
            "schema": {
              "type": "string",
              "example": "517938782"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful retrieval of the RCBE.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rcbe"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. Confirm that the NIPC is provided and properly formatted."
          },
          "401": {
            "description": "Unauthorized. Confirm that you are properly authenticated."
          },
          "403": {
            "description": "Request forbidden. Confirm that the request is allowed according to your plan."
          },
          "404": {
            "description": "RCBE not found for the provided NIPC."
          },
          "500": {
            "description": "Internal Server Error."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "IssueSource": {
        "properties": {
          "index": {
            "title": "IssueSource.index",
            "type": "number"
          },
          "type": {
            "enum": [
              "mentions",
              "records"
            ],
            "title": "IssueSource.type",
            "type": "string"
          }
        },
        "required": [
          "index",
          "type"
        ],
        "additionalProperties": false,
        "title": "IssueSource",
        "type": "object"
      },
      "Money": {
        "properties": {
          "amount": {
            "title": "Money.amount",
            "type": "number"
          },
          "currency": {
            "title": "Money.currency",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "amount",
          "currency"
        ],
        "additionalProperties": false,
        "title": "Money",
        "type": "object"
      },
      "PermanentCertificate": {
        "properties": {
          "accessCode": {
            "title": "PermanentCertificate.accessCode",
            "type": "string"
          },
          "expiryDate": {
            "title": "PermanentCertificate.expiryDate",
            "description": "The date when this permanent certificate expires.",
            "type": "string"
          },
          "mentions": {
            "items": {
              "$ref": "#/components/schemas/Mention",
              "title": "PermanentCertificate.mentions.[]"
            },
            "title": "PermanentCertificate.mentions",
            "description": "List of mentions representing specific events or annotations like accountability reports (prestação de contas),\nquota transfers, or unifications, often recorded separately from main registration acts.",
            "type": "array"
          },
          "pendingFacts": {
            "title": "PermanentCertificate.pendingFacts",
            "description": "Indicates if there are pending registration acts (factos pendentes) that have been requested but not yet finalized or fully reflected in the certificate.",
            "type": "boolean"
          },
          "registration": {
            "$ref": "#/components/schemas/Registration",
            "title": "PermanentCertificate.registration"
          },
          "records": {
            "items": {
              "$ref": "#/components/schemas/CertificateRecord",
              "title": "PermanentCertificate.records.[]"
            },
            "title": "PermanentCertificate.records",
            "description": "Chronological list of registration entries (atos de registo) detailing the company's history, such as incorporation, capital changes, amendments to bylaws, etc.",
            "type": "array"
          }
        },
        "required": [
          "expiryDate",
          "mentions",
          "pendingFacts",
          "registration",
          "records"
        ],
        "additionalProperties": false,
        "title": "PermanentCertificate",
        "type": "object"
      },
      "Mention": {
        "properties": {
          "identification": {
            "title": "Mention.identification",
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/EntryMetadata",
            "title": "Mention.metadata"
          },
          "content": {
            "$ref": "#/components/schemas/MentionEntryContent",
            "title": "Mention.content"
          }
        },
        "required": [
          "metadata",
          "content"
        ],
        "additionalProperties": false,
        "title": "Mention",
        "type": "object"
      },
      "Registration": {
        "properties": {
          "nipc": {
            "title": "Registration.nipc",
            "description": "Número de Identificação de Pessoa Coletiva - the unique tax identification number for the legal entity in Portugal.",
            "nullable": true,
            "type": "string"
          },
          "caeCodes": {
            "$ref": "#/components/schemas/CaeCodes",
            "title": "Registration.caeCodes",
            "description": "Classification of Economic Activities (Classificação das Atividades Económicas) codes assigned to the company, indicating its primary and secondary business activities."
          },
          "capital": {
            "$ref": "#/components/schemas/Money",
            "title": "Registration.capital",
            "description": "The company's registered share capital."
          },
          "companyName": {
            "title": "Registration.companyName",
            "description": "The official registered name of the company.",
            "type": "string"
          },
          "corporatePurpose": {
            "title": "Registration.corporatePurpose",
            "description": "The declared purpose or scope of business activities of the company (objeto social).",
            "type": "string"
          },
          "legalNature": {
            "title": "Registration.legalNature",
            "description": "The legal form of the company (e.g., 'Sociedade por Quotas', 'Sociedade Anónima').",
            "type": "string"
          },
          "headquartersAddress": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/HeadquartersAddress",
                "title": "Registration.headquartersAddress"
              },
              {
                "title": "Registration.headquartersAddress",
                "nullable": true
              }
            ],
            "title": "Registration.headquartersAddress",
            "description": "The registered headquarters address of the company."
          },
          "managementAndSignatories": {
            "$ref": "#/components/schemas/ManagementAndSignatories",
            "title": "Registration.managementAndSignatories",
            "description": "Structured information about the company's management bodies (e.g., administration, directors)\nand individuals authorized to sign on behalf of the company."
          },
          "composition": {
            "additionalProperties": {
              "items": {
                "$ref": "#/components/schemas/Manager",
                "title": "[]"
              },
              "title": "[]",
              "type": "array"
            },
            "title": "Registration.composition",
            "description": "Detailed breakdown of the members of various corporate bodies (e.g., Board of Directors, Supervisory Board),\nlisting individuals and their roles. Keys represent the name of the corporate body.",
            "type": "object"
          },
          "signatories": {
            "title": "Registration.signatories",
            "description": "A textual description of who can bind the company (forma de obrigar), often complementing or summarizing the structured `managementAndSignatories` or `composition` data.",
            "type": "string"
          },
          "conservatory": {
            "title": "Registration.conservatory",
            "description": "The specific Commercial Registry Office (Conservatória do Registo Comercial) where the company is registered.",
            "type": "string"
          },
          "fiscalYearCloseDate": {
            "properties": {
              "month": {
                "title": "Registration.fiscalYearCloseDate.month",
                "description": "The month of the fiscal year close date (1-12)",
                "type": "number"
              },
              "dayOfMonth": {
                "title": "Registration.fiscalYearCloseDate.dayOfMonth",
                "type": "number"
              }
            },
            "required": [
              "month",
              "dayOfMonth"
            ],
            "additionalProperties": false,
            "title": "Registration.fiscalYearCloseDate",
            "description": "The date on which the company's fiscal year ends.",
            "type": "object"
          }
        },
        "additionalProperties": false,
        "title": "Registration",
        "type": "object"
      },
      "CaeCodes": {
        "properties": {
          "main": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CaeCode",
                "title": "CaeCodes.main"
              },
              {
                "title": "CaeCodes.main",
                "nullable": true
              }
            ],
            "title": "CaeCodes.main"
          },
          "secondary": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/CaeCode",
                  "title": "CaeCodes.secondary.[]"
                },
                {
                  "title": "CaeCodes.secondary.[]",
                  "nullable": true
                }
              ],
              "title": "CaeCodes.secondary.[]"
            },
            "title": "CaeCodes.secondary",
            "type": "array"
          }
        },
        "required": [
          "main",
          "secondary"
        ],
        "additionalProperties": false,
        "title": "CaeCodes",
        "type": "object"
      },
      "CaeCode": {
        "properties": {
          "code": {
            "title": "CaeCode.code",
            "type": "string"
          },
          "description": {
            "title": "CaeCode.description",
            "type": "string"
          },
          "revision": {
            "title": "CaeCode.revision",
            "type": "string"
          }
        },
        "required": [
          "code",
          "description",
          "revision"
        ],
        "additionalProperties": false,
        "title": "CaeCode",
        "type": "object"
      },
      "HeadquartersAddress": {
        "properties": {
          "council": {
            "title": "HeadquartersAddress.council",
            "type": "string"
          },
          "district": {
            "title": "HeadquartersAddress.district",
            "type": "string"
          },
          "location": {
            "title": "HeadquartersAddress.location",
            "type": "string"
          },
          "parish": {
            "title": "HeadquartersAddress.parish",
            "type": "string"
          },
          "postalCode": {
            "title": "HeadquartersAddress.postalCode",
            "type": "string"
          },
          "streetAndNumber": {
            "title": "HeadquartersAddress.streetAndNumber",
            "type": "string"
          }
        },
        "additionalProperties": false,
        "title": "HeadquartersAddress",
        "type": "object"
      },
      "Manager": {
        "properties": {
          "name": {
            "title": "Manager.name",
            "type": "string"
          },
          "nif": {
            "title": "Manager.nif",
            "type": "string"
          },
          "nifOrNipc": {
            "title": "Manager.nifOrNipc",
            "type": "string"
          },
          "nipc": {
            "title": "Manager.nipc",
            "type": "string"
          },
          "role": {
            "title": "Manager.role",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false,
        "title": "Manager",
        "type": "object"
      },
      "CertificateRecord": {
        "properties": {
          "additions": {
            "items": {
              "$ref": "#/components/schemas/Addition",
              "title": "CertificateRecord.additions.[]"
            },
            "title": "CertificateRecord.additions",
            "type": "array"
          },
          "content": {
            "$ref": "#/components/schemas/RegistrationEntryContent",
            "title": "CertificateRecord.content"
          },
          "identification": {
            "title": "CertificateRecord.identification",
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/EntryMetadata",
            "title": "CertificateRecord.metadata"
          }
        },
        "required": [
          "content",
          "identification",
          "metadata"
        ],
        "additionalProperties": false,
        "title": "CertificateRecord",
        "type": "object"
      },
      "Addition": {
        "properties": {
          "identification": {
            "title": "Addition.identification",
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/EntryMetadata",
            "title": "Addition.metadata"
          },
          "content": {
            "$ref": "#/components/schemas/AdditionEntryContent",
            "title": "Addition.content"
          }
        },
        "required": [
          "identification",
          "metadata",
          "content"
        ],
        "additionalProperties": false,
        "title": "Addition",
        "type": "object"
      },
      "EntryMetadata": {
        "properties": {
          "sequenceNumber": {
            "title": "EntryMetadata.sequenceNumber",
            "nullable": true,
            "type": "number"
          },
          "date": {
            "title": "EntryMetadata.date",
            "nullable": true,
            "type": "string"
          },
          "title": {
            "title": "EntryMetadata.title",
            "nullable": true,
            "type": "string"
          },
          "type": {
            "title": "EntryMetadata.type",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "sequenceNumber",
          "date",
          "title",
          "type"
        ],
        "additionalProperties": false,
        "title": "EntryMetadata",
        "type": "object"
      },
      "AdditionEntryContent": {
        "$ref": "#/components/schemas/RegistrationEntryContent",
        "title": "AdditionEntryContent"
      },
      "CapitalChange": {
        "properties": {
          "capitalAfterChange": {
            "$ref": "#/components/schemas/Money",
            "title": "CapitalChange.capitalAfterChange"
          },
          "change": {
            "$ref": "#/components/schemas/Money",
            "title": "CapitalChange.change"
          }
        },
        "required": [
          "capitalAfterChange",
          "change"
        ],
        "additionalProperties": false,
        "title": "CapitalChange",
        "type": "object"
      },
      "RegistrationEntryContent": {
        "properties": {
          "nipc": {
            "title": "RegistrationEntryContent.nipc",
            "nullable": true,
            "type": "string"
          },
          "caeCodes": {
            "$ref": "#/components/schemas/CaeCodes",
            "title": "RegistrationEntryContent.caeCodes"
          },
          "capitalChanges": {
            "items": {
              "$ref": "#/components/schemas/CapitalChange",
              "title": "RegistrationEntryContent.capitalChanges.[]"
            },
            "title": "RegistrationEntryContent.capitalChanges",
            "type": "array"
          },
          "partnersAndQuotas": {
            "items": {
              "$ref": "#/components/schemas/PartnersAndQuotas",
              "title": "RegistrationEntryContent.partnersAndQuotas.[]"
            },
            "title": "RegistrationEntryContent.partnersAndQuotas, RegistrationEntryContent.partnersAndQuotas.[]",
            "type": "array"
          },
          "capital": {
            "$ref": "#/components/schemas/Money",
            "title": "RegistrationEntryContent.capital"
          },
          "companyName": {
            "title": "RegistrationEntryContent.companyName",
            "type": "string"
          },
          "composition": {
            "additionalProperties": {
              "items": {
                "$ref": "#/components/schemas/Manager",
                "title": "[]"
              },
              "title": "[]",
              "type": "array"
            },
            "title": "RegistrationEntryContent.composition",
            "type": "object"
          },
          "corporatePurpose": {
            "title": "RegistrationEntryContent.corporatePurpose",
            "type": "string"
          },
          "inLiquidation": {
            "title": "RegistrationEntryContent.inLiquidation",
            "type": "boolean"
          },
          "legalNature": {
            "title": "RegistrationEntryContent.legalNature",
            "type": "string"
          },
          "headquartersAddress": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/HeadquartersAddress",
                "title": "RegistrationEntryContent.headquartersAddress"
              },
              {
                "title": "RegistrationEntryContent.headquartersAddress",
                "nullable": true
              }
            ],
            "title": "RegistrationEntryContent.headquartersAddress"
          },
          "managementAndSignatories": {
            "$ref": "#/components/schemas/ManagementAndSignatories",
            "title": "RegistrationEntryContent.managementAndSignatories"
          },
          "conservatory": {
            "title": "RegistrationEntryContent.conservatory",
            "type": "string"
          },
          "shares": {
            "properties": {
              "quantity": {
                "title": "RegistrationEntryContent.shares.quantity",
                "type": "number"
              },
              "nominalValue": {
                "$ref": "#/components/schemas/Money",
                "title": "RegistrationEntryContent.shares.nominalValue"
              }
            },
            "additionalProperties": false,
            "title": "RegistrationEntryContent.shares",
            "type": "object"
          }
        },
        "additionalProperties": false,
        "title": "RegistrationEntryContent",
        "type": "object"
      },
      "MentionEntryContent": {
        "properties": {
          "accountabilityYear": {
            "title": "MentionEntryContent.accountabilityYear",
            "type": "number"
          },
          "quotaTransfer": {
            "$ref": "#/components/schemas/QuotaTransfer",
            "title": "MentionEntryContent.quotaTransfer"
          },
          "quotaUnification": {
            "$ref": "#/components/schemas/QuotaUnification",
            "title": "MentionEntryContent.quotaUnification"
          }
        },
        "additionalProperties": false,
        "title": "MentionEntryContent",
        "type": "object"
      },
      "QuotaTransfer": {
        "properties": {
          "quotasAndActiveSubjects": {
            "items": {
              "$ref": "#/components/schemas/PartnersAndQuotas",
              "title": "QuotaTransfer.quotasAndActiveSubjects.[]"
            },
            "title": "QuotaTransfer.quotasAndActiveSubjects",
            "type": "array"
          },
          "passiveSubjects": {
            "items": {
              "$ref": "#/components/schemas/QuotaHolder",
              "title": "QuotaTransfer.passiveSubjects.[]"
            },
            "title": "QuotaTransfer.passiveSubjects",
            "type": "array"
          }
        },
        "required": [
          "quotasAndActiveSubjects",
          "passiveSubjects"
        ],
        "additionalProperties": false,
        "title": "QuotaTransfer",
        "type": "object"
      },
      "QuotaUnification": {
        "properties": {
          "sourceQuotas": {
            "items": {
              "$ref": "#/components/schemas/Money",
              "title": "QuotaUnification.sourceQuotas.[]"
            },
            "title": "QuotaUnification.sourceQuotas",
            "type": "array"
          },
          "unifiedQuotaAndHolders": {
            "properties": {
              "holders": {
                "items": {
                  "$ref": "#/components/schemas/QuotaHolder",
                  "title": "QuotaUnification.unifiedQuotaAndHolders.holders.[]"
                },
                "title": "QuotaUnification.unifiedQuotaAndHolders.holders",
                "type": "array"
              },
              "value": {
                "$ref": "#/components/schemas/Money",
                "title": "QuotaUnification.unifiedQuotaAndHolders.value"
              }
            },
            "required": [
              "holders"
            ],
            "additionalProperties": false,
            "title": "QuotaUnification.unifiedQuotaAndHolders",
            "type": "object"
          }
        },
        "required": [
          "sourceQuotas",
          "unifiedQuotaAndHolders"
        ],
        "additionalProperties": false,
        "title": "QuotaUnification",
        "type": "object"
      },
      "QuotaHolder": {
        "properties": {
          "address": {
            "title": "QuotaHolder.address",
            "type": "string"
          },
          "headquarters": {
            "title": "QuotaHolder.headquarters",
            "type": "string"
          },
          "holder": {
            "title": "QuotaHolder.holder",
            "type": "string"
          },
          "location": {
            "title": "QuotaHolder.location",
            "type": "string"
          },
          "maritalStatus": {
            "title": "QuotaHolder.maritalStatus",
            "type": "string"
          },
          "nif": {
            "title": "QuotaHolder.nif",
            "type": "string"
          },
          "nifOrNipc": {
            "title": "QuotaHolder.nifOrNipc",
            "type": "string"
          },
          "nipc": {
            "title": "QuotaHolder.nipc",
            "type": "string"
          },
          "postalCode": {
            "title": "QuotaHolder.postalCode",
            "type": "string"
          },
          "propertyScheme": {
            "title": "QuotaHolder.propertyScheme",
            "type": "string"
          },
          "spouseName": {
            "title": "QuotaHolder.spouseName",
            "type": "string"
          }
        },
        "additionalProperties": false,
        "title": "QuotaHolder",
        "type": "object"
      },
      "PartnersAndQuotas": {
        "properties": {
          "holders": {
            "items": {
              "$ref": "#/components/schemas/QuotaHolder",
              "title": "PartnersAndQuotas.holders.[]"
            },
            "title": "PartnersAndQuotas.holders",
            "type": "array"
          },
          "splitFrom": {
            "$ref": "#/components/schemas/Money",
            "title": "PartnersAndQuotas.splitFrom"
          },
          "value": {
            "$ref": "#/components/schemas/Money",
            "title": "PartnersAndQuotas.value"
          }
        },
        "required": [
          "holders",
          "value"
        ],
        "additionalProperties": false,
        "title": "PartnersAndQuotas",
        "type": "object"
      },
      "ManagementAndSignatories": {
        "title": "ManagementAndSignatories"
      },
      "ProcessedPermanentCertificate": {
        "allOf": [
          {
            "type": "object",
            "properties": {
              "accessCode": {
                "type": "string"
              },
              "expiryDate": {
                "type": "string",
                "description": "The date when this permanent certificate expires."
              },
              "issues": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "severity": {
                      "type": "string",
                      "enum": [
                        "ERROR",
                        "WARNING"
                      ]
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "index": {
                          "type": "number"
                        },
                        "type": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "mentions"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "records"
                              ]
                            }
                          ]
                        }
                      },
                      "required": [
                        "index",
                        "type"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "message",
                    "severity"
                  ],
                  "additionalProperties": false
                },
                "description": "A list of potential issues (errors or warnings) detected during the processing of the certificate data, such as inconsistencies or missing information."
              },
              "mentions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "identification": {
                      "type": "string"
                    },
                    "metadata": {
                      "type": "object",
                      "properties": {
                        "sequenceNumber": {
                          "type": "number",
                          "nullable": true
                        },
                        "date": {
                          "type": "string",
                          "nullable": true
                        },
                        "title": {
                          "type": "string",
                          "nullable": true
                        },
                        "type": {
                          "type": "string",
                          "nullable": true
                        }
                      },
                      "required": [
                        "sequenceNumber",
                        "date",
                        "title",
                        "type"
                      ],
                      "additionalProperties": false
                    },
                    "content": {
                      "type": "object",
                      "properties": {
                        "accountabilityYear": {
                          "type": "number"
                        },
                        "quotaTransfer": {
                          "type": "object",
                          "properties": {
                            "quotasAndActiveSubjects": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "holders": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "address": {
                                          "type": "string",
                                          "minLength": 1,
                                          "nullable": true
                                        },
                                        "headquarters": {
                                          "type": "string",
                                          "minLength": 1,
                                          "nullable": true
                                        },
                                        "holder": {
                                          "type": "string",
                                          "minLength": 1,
                                          "nullable": true
                                        },
                                        "location": {
                                          "type": "string",
                                          "minLength": 1,
                                          "nullable": true
                                        },
                                        "maritalStatus": {
                                          "type": "string",
                                          "minLength": 1,
                                          "nullable": true
                                        },
                                        "nif": {
                                          "type": "string",
                                          "minLength": 1,
                                          "nullable": true
                                        },
                                        "nifOrNipc": {
                                          "type": "string",
                                          "minLength": 1,
                                          "nullable": true
                                        },
                                        "nipc": {
                                          "type": "string",
                                          "minLength": 1,
                                          "nullable": true
                                        },
                                        "postalCode": {
                                          "type": "string",
                                          "minLength": 1,
                                          "nullable": true
                                        },
                                        "propertyScheme": {
                                          "type": "string",
                                          "minLength": 1,
                                          "nullable": true
                                        },
                                        "spouseName": {
                                          "type": "string",
                                          "minLength": 1,
                                          "nullable": true
                                        }
                                      },
                                      "required": [
                                        "address",
                                        "headquarters",
                                        "holder",
                                        "location",
                                        "maritalStatus",
                                        "nif",
                                        "nifOrNipc",
                                        "nipc",
                                        "postalCode",
                                        "propertyScheme",
                                        "spouseName"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "splitFrom": {
                                    "type": "object",
                                    "properties": {
                                      "amount": {
                                        "type": "number",
                                        "description": "The monetary amount."
                                      },
                                      "currency": {
                                        "type": "string",
                                        "minLength": 3,
                                        "maxLength": 3,
                                        "nullable": true,
                                        "description": "The currency code (e.g., 'EUR', 'USD'). Null if unspecified."
                                      }
                                    },
                                    "required": [
                                      "amount",
                                      "currency"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "value": {
                                    "type": "object",
                                    "properties": {
                                      "amount": {
                                        "type": "number",
                                        "description": "The monetary amount."
                                      },
                                      "currency": {
                                        "type": "string",
                                        "minLength": 3,
                                        "maxLength": 3,
                                        "nullable": true,
                                        "description": "The currency code (e.g., 'EUR', 'USD'). Null if unspecified."
                                      }
                                    },
                                    "required": [
                                      "amount",
                                      "currency"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "holders",
                                  "value"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "passiveSubjects": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "address": {
                                    "type": "string",
                                    "minLength": 1,
                                    "nullable": true
                                  },
                                  "headquarters": {
                                    "type": "string",
                                    "minLength": 1,
                                    "nullable": true
                                  },
                                  "holder": {
                                    "type": "string",
                                    "minLength": 1,
                                    "nullable": true
                                  },
                                  "location": {
                                    "type": "string",
                                    "minLength": 1,
                                    "nullable": true
                                  },
                                  "maritalStatus": {
                                    "type": "string",
                                    "minLength": 1,
                                    "nullable": true
                                  },
                                  "nif": {
                                    "type": "string",
                                    "minLength": 1,
                                    "nullable": true
                                  },
                                  "nifOrNipc": {
                                    "type": "string",
                                    "minLength": 1,
                                    "nullable": true
                                  },
                                  "nipc": {
                                    "type": "string",
                                    "minLength": 1,
                                    "nullable": true
                                  },
                                  "postalCode": {
                                    "type": "string",
                                    "minLength": 1,
                                    "nullable": true
                                  },
                                  "propertyScheme": {
                                    "type": "string",
                                    "minLength": 1,
                                    "nullable": true
                                  },
                                  "spouseName": {
                                    "type": "string",
                                    "minLength": 1,
                                    "nullable": true
                                  }
                                },
                                "required": [
                                  "address",
                                  "headquarters",
                                  "holder",
                                  "location",
                                  "maritalStatus",
                                  "nif",
                                  "nifOrNipc",
                                  "nipc",
                                  "postalCode",
                                  "propertyScheme",
                                  "spouseName"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "quotasAndActiveSubjects",
                            "passiveSubjects"
                          ],
                          "additionalProperties": false
                        },
                        "quotaUnification": {
                          "type": "object",
                          "properties": {
                            "sourceQuotas": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "amount": {
                                    "type": "number",
                                    "description": "The monetary amount."
                                  },
                                  "currency": {
                                    "type": "string",
                                    "minLength": 3,
                                    "maxLength": 3,
                                    "nullable": true,
                                    "description": "The currency code (e.g., 'EUR', 'USD'). Null if unspecified."
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "unifiedQuotaAndHolders": {
                              "type": "object",
                              "properties": {
                                "holders": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "address": {
                                        "type": "string",
                                        "minLength": 1,
                                        "nullable": true
                                      },
                                      "headquarters": {
                                        "type": "string",
                                        "minLength": 1,
                                        "nullable": true
                                      },
                                      "holder": {
                                        "type": "string",
                                        "minLength": 1,
                                        "nullable": true
                                      },
                                      "location": {
                                        "type": "string",
                                        "minLength": 1,
                                        "nullable": true
                                      },
                                      "maritalStatus": {
                                        "type": "string",
                                        "minLength": 1,
                                        "nullable": true
                                      },
                                      "nif": {
                                        "type": "string",
                                        "minLength": 1,
                                        "nullable": true
                                      },
                                      "nifOrNipc": {
                                        "type": "string",
                                        "minLength": 1,
                                        "nullable": true
                                      },
                                      "nipc": {
                                        "type": "string",
                                        "minLength": 1,
                                        "nullable": true
                                      },
                                      "postalCode": {
                                        "type": "string",
                                        "minLength": 1,
                                        "nullable": true
                                      },
                                      "propertyScheme": {
                                        "type": "string",
                                        "minLength": 1,
                                        "nullable": true
                                      },
                                      "spouseName": {
                                        "type": "string",
                                        "minLength": 1,
                                        "nullable": true
                                      }
                                    },
                                    "required": [
                                      "address",
                                      "headquarters",
                                      "holder",
                                      "location",
                                      "maritalStatus",
                                      "nif",
                                      "nifOrNipc",
                                      "nipc",
                                      "postalCode",
                                      "propertyScheme",
                                      "spouseName"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "value": {
                                  "type": "object",
                                  "properties": {
                                    "amount": {
                                      "type": "number",
                                      "description": "The monetary amount."
                                    },
                                    "currency": {
                                      "type": "string",
                                      "minLength": 3,
                                      "maxLength": 3,
                                      "nullable": true,
                                      "description": "The currency code (e.g., 'EUR', 'USD'). Null if unspecified."
                                    }
                                  },
                                  "required": [
                                    "amount",
                                    "currency"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "holders"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "sourceQuotas",
                            "unifiedQuotaAndHolders"
                          ],
                          "additionalProperties": false
                        },
                        "rawText": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "rawText"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "metadata",
                    "content"
                  ],
                  "additionalProperties": false
                },
                "description": "List of mentions representing specific events or annotations like accountability reports (prestação de contas), quota transfers, or unifications, often recorded separately from main registration acts."
              },
              "pendingFacts": {
                "type": "boolean",
                "description": "Indicates if there are pending registration acts (factos pendentes) that have been requested but not yet finalized or fully reflected in the certificate."
              },
              "records": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "additions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "identification": {
                            "type": "string"
                          },
                          "metadata": {
                            "type": "object",
                            "properties": {
                              "sequenceNumber": {
                                "type": "number",
                                "nullable": true
                              },
                              "date": {
                                "type": "string",
                                "nullable": true
                              },
                              "title": {
                                "type": "string",
                                "nullable": true
                              },
                              "type": {
                                "type": "string",
                                "nullable": true
                              }
                            },
                            "required": [
                              "sequenceNumber",
                              "date",
                              "title",
                              "type"
                            ],
                            "additionalProperties": false
                          },
                          "content": {
                            "type": "object",
                            "properties": {
                              "nipc": {
                                "type": "string",
                                "nullable": true
                              },
                              "caeCodes": {
                                "type": "object",
                                "properties": {
                                  "main": {
                                    "type": "object",
                                    "properties": {
                                      "code": {
                                        "type": "string"
                                      },
                                      "description": {
                                        "type": "string"
                                      },
                                      "revision": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "code",
                                      "description",
                                      "revision"
                                    ],
                                    "additionalProperties": false,
                                    "nullable": true
                                  },
                                  "secondary": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "code": {
                                          "type": "string"
                                        },
                                        "description": {
                                          "type": "string"
                                        },
                                        "revision": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "code",
                                        "description",
                                        "revision"
                                      ],
                                      "additionalProperties": false,
                                      "nullable": true
                                    }
                                  }
                                },
                                "required": [
                                  "main",
                                  "secondary"
                                ],
                                "additionalProperties": false
                              },
                              "capitalChanges": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "capitalAfterChange": {
                                      "type": "object",
                                      "properties": {
                                        "amount": {
                                          "type": "number",
                                          "description": "The monetary amount."
                                        },
                                        "currency": {
                                          "type": "string",
                                          "minLength": 3,
                                          "maxLength": 3,
                                          "nullable": true,
                                          "description": "The currency code (e.g., 'EUR', 'USD'). Null if unspecified."
                                        }
                                      },
                                      "required": [
                                        "amount",
                                        "currency"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "change": {
                                      "type": "object",
                                      "properties": {
                                        "amount": {
                                          "type": "number",
                                          "description": "The monetary amount."
                                        },
                                        "currency": {
                                          "type": "string",
                                          "minLength": 3,
                                          "maxLength": 3,
                                          "nullable": true,
                                          "description": "The currency code (e.g., 'EUR', 'USD'). Null if unspecified."
                                        }
                                      },
                                      "required": [
                                        "amount",
                                        "currency"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "capitalAfterChange",
                                    "change"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "partnersAndQuotas": {
                                "anyOf": [
                                  {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "holders": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "address": {
                                                "type": "string",
                                                "minLength": 1,
                                                "nullable": true
                                              },
                                              "headquarters": {
                                                "type": "string",
                                                "minLength": 1,
                                                "nullable": true
                                              },
                                              "holder": {
                                                "type": "string",
                                                "minLength": 1,
                                                "nullable": true
                                              },
                                              "location": {
                                                "type": "string",
                                                "minLength": 1,
                                                "nullable": true
                                              },
                                              "maritalStatus": {
                                                "type": "string",
                                                "minLength": 1,
                                                "nullable": true
                                              },
                                              "nif": {
                                                "type": "string",
                                                "minLength": 1,
                                                "nullable": true
                                              },
                                              "nifOrNipc": {
                                                "type": "string",
                                                "minLength": 1,
                                                "nullable": true
                                              },
                                              "nipc": {
                                                "type": "string",
                                                "minLength": 1,
                                                "nullable": true
                                              },
                                              "postalCode": {
                                                "type": "string",
                                                "minLength": 1,
                                                "nullable": true
                                              },
                                              "propertyScheme": {
                                                "type": "string",
                                                "minLength": 1,
                                                "nullable": true
                                              },
                                              "spouseName": {
                                                "type": "string",
                                                "minLength": 1,
                                                "nullable": true
                                              }
                                            },
                                            "required": [
                                              "address",
                                              "headquarters",
                                              "holder",
                                              "location",
                                              "maritalStatus",
                                              "nif",
                                              "nifOrNipc",
                                              "nipc",
                                              "postalCode",
                                              "propertyScheme",
                                              "spouseName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "splitFrom": {
                                          "type": "object",
                                          "properties": {
                                            "amount": {
                                              "type": "number",
                                              "description": "The monetary amount."
                                            },
                                            "currency": {
                                              "type": "string",
                                              "minLength": 3,
                                              "maxLength": 3,
                                              "nullable": true,
                                              "description": "The currency code (e.g., 'EUR', 'USD'). Null if unspecified."
                                            }
                                          },
                                          "required": [
                                            "amount",
                                            "currency"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "value": {
                                          "type": "object",
                                          "properties": {
                                            "amount": {
                                              "type": "number",
                                              "description": "The monetary amount."
                                            },
                                            "currency": {
                                              "type": "string",
                                              "minLength": 3,
                                              "maxLength": 3,
                                              "nullable": true,
                                              "description": "The currency code (e.g., 'EUR', 'USD'). Null if unspecified."
                                            }
                                          },
                                          "required": [
                                            "amount",
                                            "currency"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "holders",
                                        "value"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  {
                                    "not": {}
                                  }
                                ]
                              },
                              "capital": {
                                "type": "object",
                                "properties": {
                                  "amount": {
                                    "type": "number",
                                    "description": "The monetary amount."
                                  },
                                  "currency": {
                                    "type": "string",
                                    "minLength": 3,
                                    "maxLength": 3,
                                    "nullable": true,
                                    "description": "The currency code (e.g., 'EUR', 'USD'). Null if unspecified."
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency"
                                ],
                                "additionalProperties": false
                              },
                              "companyName": {
                                "type": "string"
                              },
                              "composition": {
                                "type": "object",
                                "properties": {
                                  "administration": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "nif": {
                                          "type": "string",
                                          "nullable": true
                                        },
                                        "nifOrNipc": {
                                          "type": "string",
                                          "nullable": true
                                        },
                                        "nipc": {
                                          "type": "string",
                                          "nullable": true
                                        },
                                        "role": {
                                          "type": "string",
                                          "nullable": true
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "nif",
                                        "nifOrNipc",
                                        "nipc",
                                        "role"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "minItems": 1,
                                    "nullable": true
                                  },
                                  "administrationSubstitutes": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "nif": {
                                          "type": "string",
                                          "nullable": true
                                        },
                                        "nifOrNipc": {
                                          "type": "string",
                                          "nullable": true
                                        },
                                        "nipc": {
                                          "type": "string",
                                          "nullable": true
                                        },
                                        "role": {
                                          "type": "string",
                                          "nullable": true
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "nif",
                                        "nifOrNipc",
                                        "nipc",
                                        "role"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "minItems": 1,
                                    "nullable": true
                                  },
                                  "fiscal": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "nif": {
                                          "type": "string",
                                          "nullable": true
                                        },
                                        "nifOrNipc": {
                                          "type": "string",
                                          "nullable": true
                                        },
                                        "nipc": {
                                          "type": "string",
                                          "nullable": true
                                        },
                                        "role": {
                                          "type": "string",
                                          "nullable": true
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "nif",
                                        "nifOrNipc",
                                        "nipc",
                                        "role"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "minItems": 1,
                                    "nullable": true
                                  },
                                  "fiscalSubstitutes": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "nif": {
                                          "type": "string",
                                          "nullable": true
                                        },
                                        "nifOrNipc": {
                                          "type": "string",
                                          "nullable": true
                                        },
                                        "nipc": {
                                          "type": "string",
                                          "nullable": true
                                        },
                                        "role": {
                                          "type": "string",
                                          "nullable": true
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "nif",
                                        "nifOrNipc",
                                        "nipc",
                                        "role"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "minItems": 1,
                                    "nullable": true
                                  },
                                  "management": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "nif": {
                                          "type": "string",
                                          "nullable": true
                                        },
                                        "nifOrNipc": {
                                          "type": "string",
                                          "nullable": true
                                        },
                                        "nipc": {
                                          "type": "string",
                                          "nullable": true
                                        },
                                        "role": {
                                          "type": "string",
                                          "nullable": true
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "nif",
                                        "nifOrNipc",
                                        "nipc",
                                        "role"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "minItems": 1,
                                    "nullable": true
                                  }
                                },
                                "required": [
                                  "administration",
                                  "administrationSubstitutes",
                                  "fiscal",
                                  "fiscalSubstitutes",
                                  "management"
                                ],
                                "additionalProperties": false
                              },
                              "corporatePurpose": {
                                "type": "string"
                              },
                              "inLiquidation": {
                                "type": "boolean"
                              },
                              "legalNature": {
                                "type": "string"
                              },
                              "headquartersAddress": {
                                "type": "object",
                                "properties": {
                                  "council": {
                                    "type": "string"
                                  },
                                  "district": {
                                    "type": "string"
                                  },
                                  "location": {
                                    "type": "string"
                                  },
                                  "parish": {
                                    "type": "string"
                                  },
                                  "postalCode": {
                                    "type": "string"
                                  },
                                  "streetAndNumber": {
                                    "type": "string"
                                  }
                                },
                                "additionalProperties": false,
                                "nullable": true
                              },
                              "managementAndSignatories": {
                                "type": "object",
                                "properties": {
                                  "administration": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "directors": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "management": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "signatories": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "supervision": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "term": {
                                    "type": "string",
                                    "nullable": true
                                  }
                                },
                                "additionalProperties": false
                              },
                              "conservatory": {
                                "type": "string"
                              },
                              "rawText": {
                                "type": "string"
                              },
                              "shares": {
                                "type": "object",
                                "properties": {
                                  "quantity": {
                                    "type": "number"
                                  },
                                  "nominalValue": {
                                    "type": "object",
                                    "properties": {
                                      "amount": {
                                        "type": "number",
                                        "description": "The monetary amount."
                                      },
                                      "currency": {
                                        "type": "string",
                                        "minLength": 3,
                                        "maxLength": 3,
                                        "nullable": true,
                                        "description": "The currency code (e.g., 'EUR', 'USD'). Null if unspecified."
                                      }
                                    },
                                    "required": [
                                      "amount",
                                      "currency"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "identification",
                          "metadata",
                          "content"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "content": {
                      "type": "object",
                      "properties": {
                        "nipc": {
                          "type": "string",
                          "nullable": true
                        },
                        "caeCodes": {
                          "type": "object",
                          "properties": {
                            "main": {
                              "type": "object",
                              "properties": {
                                "code": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "revision": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "code",
                                "description",
                                "revision"
                              ],
                              "additionalProperties": false,
                              "nullable": true
                            },
                            "secondary": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": "string"
                                  },
                                  "revision": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "code",
                                  "description",
                                  "revision"
                                ],
                                "additionalProperties": false,
                                "nullable": true
                              }
                            }
                          },
                          "required": [
                            "main",
                            "secondary"
                          ],
                          "additionalProperties": false
                        },
                        "capitalChanges": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "capitalAfterChange": {
                                "type": "object",
                                "properties": {
                                  "amount": {
                                    "type": "number",
                                    "description": "The monetary amount."
                                  },
                                  "currency": {
                                    "type": "string",
                                    "minLength": 3,
                                    "maxLength": 3,
                                    "nullable": true,
                                    "description": "The currency code (e.g., 'EUR', 'USD'). Null if unspecified."
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency"
                                ],
                                "additionalProperties": false
                              },
                              "change": {
                                "type": "object",
                                "properties": {
                                  "amount": {
                                    "type": "number",
                                    "description": "The monetary amount."
                                  },
                                  "currency": {
                                    "type": "string",
                                    "minLength": 3,
                                    "maxLength": 3,
                                    "nullable": true,
                                    "description": "The currency code (e.g., 'EUR', 'USD'). Null if unspecified."
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "capitalAfterChange",
                              "change"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "partnersAndQuotas": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "holders": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "address": {
                                          "type": "string",
                                          "minLength": 1,
                                          "nullable": true
                                        },
                                        "headquarters": {
                                          "type": "string",
                                          "minLength": 1,
                                          "nullable": true
                                        },
                                        "holder": {
                                          "type": "string",
                                          "minLength": 1,
                                          "nullable": true
                                        },
                                        "location": {
                                          "type": "string",
                                          "minLength": 1,
                                          "nullable": true
                                        },
                                        "maritalStatus": {
                                          "type": "string",
                                          "minLength": 1,
                                          "nullable": true
                                        },
                                        "nif": {
                                          "type": "string",
                                          "minLength": 1,
                                          "nullable": true
                                        },
                                        "nifOrNipc": {
                                          "type": "string",
                                          "minLength": 1,
                                          "nullable": true
                                        },
                                        "nipc": {
                                          "type": "string",
                                          "minLength": 1,
                                          "nullable": true
                                        },
                                        "postalCode": {
                                          "type": "string",
                                          "minLength": 1,
                                          "nullable": true
                                        },
                                        "propertyScheme": {
                                          "type": "string",
                                          "minLength": 1,
                                          "nullable": true
                                        },
                                        "spouseName": {
                                          "type": "string",
                                          "minLength": 1,
                                          "nullable": true
                                        }
                                      },
                                      "required": [
                                        "address",
                                        "headquarters",
                                        "holder",
                                        "location",
                                        "maritalStatus",
                                        "nif",
                                        "nifOrNipc",
                                        "nipc",
                                        "postalCode",
                                        "propertyScheme",
                                        "spouseName"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "splitFrom": {
                                    "type": "object",
                                    "properties": {
                                      "amount": {
                                        "type": "number",
                                        "description": "The monetary amount."
                                      },
                                      "currency": {
                                        "type": "string",
                                        "minLength": 3,
                                        "maxLength": 3,
                                        "nullable": true,
                                        "description": "The currency code (e.g., 'EUR', 'USD'). Null if unspecified."
                                      }
                                    },
                                    "required": [
                                      "amount",
                                      "currency"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "value": {
                                    "type": "object",
                                    "properties": {
                                      "amount": {
                                        "type": "number",
                                        "description": "The monetary amount."
                                      },
                                      "currency": {
                                        "type": "string",
                                        "minLength": 3,
                                        "maxLength": 3,
                                        "nullable": true,
                                        "description": "The currency code (e.g., 'EUR', 'USD'). Null if unspecified."
                                      }
                                    },
                                    "required": [
                                      "amount",
                                      "currency"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "holders",
                                  "value"
                                ],
                                "additionalProperties": false
                              }
                            },
                            {
                              "not": {}
                            }
                          ]
                        },
                        "capital": {
                          "type": "object",
                          "properties": {
                            "amount": {
                              "type": "number",
                              "description": "The monetary amount."
                            },
                            "currency": {
                              "type": "string",
                              "minLength": 3,
                              "maxLength": 3,
                              "nullable": true,
                              "description": "The currency code (e.g., 'EUR', 'USD'). Null if unspecified."
                            }
                          },
                          "required": [
                            "amount",
                            "currency"
                          ],
                          "additionalProperties": false
                        },
                        "companyName": {
                          "type": "string"
                        },
                        "composition": {
                          "type": "object",
                          "properties": {
                            "administration": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "nif": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "nifOrNipc": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "nipc": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "role": {
                                    "type": "string",
                                    "nullable": true
                                  }
                                },
                                "required": [
                                  "name",
                                  "nif",
                                  "nifOrNipc",
                                  "nipc",
                                  "role"
                                ],
                                "additionalProperties": false
                              },
                              "minItems": 1,
                              "nullable": true
                            },
                            "administrationSubstitutes": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "nif": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "nifOrNipc": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "nipc": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "role": {
                                    "type": "string",
                                    "nullable": true
                                  }
                                },
                                "required": [
                                  "name",
                                  "nif",
                                  "nifOrNipc",
                                  "nipc",
                                  "role"
                                ],
                                "additionalProperties": false
                              },
                              "minItems": 1,
                              "nullable": true
                            },
                            "fiscal": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "nif": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "nifOrNipc": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "nipc": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "role": {
                                    "type": "string",
                                    "nullable": true
                                  }
                                },
                                "required": [
                                  "name",
                                  "nif",
                                  "nifOrNipc",
                                  "nipc",
                                  "role"
                                ],
                                "additionalProperties": false
                              },
                              "minItems": 1,
                              "nullable": true
                            },
                            "fiscalSubstitutes": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "nif": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "nifOrNipc": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "nipc": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "role": {
                                    "type": "string",
                                    "nullable": true
                                  }
                                },
                                "required": [
                                  "name",
                                  "nif",
                                  "nifOrNipc",
                                  "nipc",
                                  "role"
                                ],
                                "additionalProperties": false
                              },
                              "minItems": 1,
                              "nullable": true
                            },
                            "management": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "nif": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "nifOrNipc": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "nipc": {
                                    "type": "string",
                                    "nullable": true
                                  },
                                  "role": {
                                    "type": "string",
                                    "nullable": true
                                  }
                                },
                                "required": [
                                  "name",
                                  "nif",
                                  "nifOrNipc",
                                  "nipc",
                                  "role"
                                ],
                                "additionalProperties": false
                              },
                              "minItems": 1,
                              "nullable": true
                            }
                          },
                          "required": [
                            "administration",
                            "administrationSubstitutes",
                            "fiscal",
                            "fiscalSubstitutes",
                            "management"
                          ],
                          "additionalProperties": false
                        },
                        "corporatePurpose": {
                          "type": "string"
                        },
                        "inLiquidation": {
                          "type": "boolean"
                        },
                        "legalNature": {
                          "type": "string"
                        },
                        "headquartersAddress": {
                          "type": "object",
                          "properties": {
                            "council": {
                              "type": "string"
                            },
                            "district": {
                              "type": "string"
                            },
                            "location": {
                              "type": "string"
                            },
                            "parish": {
                              "type": "string"
                            },
                            "postalCode": {
                              "type": "string"
                            },
                            "streetAndNumber": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": false,
                          "nullable": true
                        },
                        "managementAndSignatories": {
                          "type": "object",
                          "properties": {
                            "administration": {
                              "type": "string",
                              "nullable": true
                            },
                            "directors": {
                              "type": "string",
                              "nullable": true
                            },
                            "management": {
                              "type": "string",
                              "nullable": true
                            },
                            "signatories": {
                              "type": "string",
                              "nullable": true
                            },
                            "supervision": {
                              "type": "string",
                              "nullable": true
                            },
                            "term": {
                              "type": "string",
                              "nullable": true
                            }
                          },
                          "additionalProperties": false
                        },
                        "conservatory": {
                          "type": "string"
                        },
                        "rawText": {
                          "type": "string"
                        },
                        "shares": {
                          "type": "object",
                          "properties": {
                            "quantity": {
                              "type": "number"
                            },
                            "nominalValue": {
                              "type": "object",
                              "properties": {
                                "amount": {
                                  "type": "number",
                                  "description": "The monetary amount."
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 3,
                                  "maxLength": 3,
                                  "nullable": true,
                                  "description": "The currency code (e.g., 'EUR', 'USD'). Null if unspecified."
                                }
                              },
                              "required": [
                                "amount",
                                "currency"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    },
                    "identification": {
                      "type": "string"
                    },
                    "metadata": {
                      "type": "object",
                      "properties": {
                        "sequenceNumber": {
                          "type": "number",
                          "nullable": true
                        },
                        "date": {
                          "type": "string",
                          "nullable": true
                        },
                        "title": {
                          "type": "string",
                          "nullable": true
                        },
                        "type": {
                          "type": "string",
                          "nullable": true
                        }
                      },
                      "required": [
                        "sequenceNumber",
                        "date",
                        "title",
                        "type"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "content",
                    "identification",
                    "metadata"
                  ],
                  "additionalProperties": false
                },
                "description": "Chronological list of registration entries (atos de registo) detailing the company's history, such as incorporation, capital changes, amendments to bylaws, etc."
              }
            },
            "required": [
              "expiryDate",
              "issues",
              "mentions",
              "pendingFacts",
              "records"
            ]
          },
          {
            "type": "object",
            "properties": {
              "nipc": {
                "type": "string",
                "nullable": true,
                "description": "Número de Identificação de Pessoa Coletiva - the unique tax identification number for the legal entity in Portugal."
              },
              "caeCodes": {
                "type": "object",
                "properties": {
                  "main": {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "revision": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "code",
                      "description",
                      "revision"
                    ],
                    "additionalProperties": false,
                    "nullable": true
                  },
                  "secondary": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "revision": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "description",
                        "revision"
                      ],
                      "additionalProperties": false,
                      "nullable": true
                    }
                  }
                },
                "required": [
                  "main",
                  "secondary"
                ],
                "additionalProperties": false,
                "description": "Classification of Economic Activities (Classificação das Atividades Económicas) codes assigned to the company, indicating its primary and secondary business activities."
              },
              "capital": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "description": "The monetary amount."
                  },
                  "currency": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 3,
                    "nullable": true,
                    "description": "The currency code (e.g., 'EUR', 'USD'). Null if unspecified."
                  }
                },
                "required": [
                  "amount",
                  "currency"
                ],
                "additionalProperties": false,
                "description": "The company's registered share capital."
              },
              "companyName": {
                "type": "string",
                "description": "The official registered name of the company."
              },
              "corporatePurpose": {
                "type": "string",
                "description": "The declared purpose or scope of business activities of the company (objeto social)."
              },
              "legalNature": {
                "type": "string",
                "description": "The legal form of the company (e.g., 'Sociedade por Quotas', 'Sociedade Anónima')."
              },
              "headquartersAddress": {
                "type": "object",
                "properties": {
                  "council": {
                    "type": "string"
                  },
                  "district": {
                    "type": "string"
                  },
                  "location": {
                    "type": "string"
                  },
                  "parish": {
                    "type": "string"
                  },
                  "postalCode": {
                    "type": "string"
                  },
                  "streetAndNumber": {
                    "type": "string"
                  }
                },
                "additionalProperties": false,
                "nullable": true,
                "description": "The registered headquarters address of the company."
              },
              "managementAndSignatories": {
                "type": "object",
                "properties": {
                  "administration": {
                    "type": "string",
                    "nullable": true
                  },
                  "directors": {
                    "type": "string",
                    "nullable": true
                  },
                  "management": {
                    "type": "string",
                    "nullable": true
                  },
                  "signatories": {
                    "type": "string",
                    "nullable": true
                  },
                  "supervision": {
                    "type": "string",
                    "nullable": true
                  },
                  "term": {
                    "type": "string",
                    "nullable": true
                  }
                },
                "additionalProperties": false,
                "description": "Structured information about the company's management bodies (e.g., administration, directors) and individuals authorized to sign on behalf of the company."
              },
              "composition": {
                "type": "object",
                "properties": {
                  "administration": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "nif": {
                          "type": "string",
                          "nullable": true
                        },
                        "nifOrNipc": {
                          "type": "string",
                          "nullable": true
                        },
                        "nipc": {
                          "type": "string",
                          "nullable": true
                        },
                        "role": {
                          "type": "string",
                          "nullable": true
                        }
                      },
                      "required": [
                        "name",
                        "nif",
                        "nifOrNipc",
                        "nipc",
                        "role"
                      ],
                      "additionalProperties": false
                    },
                    "minItems": 1,
                    "nullable": true
                  },
                  "administrationSubstitutes": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "nif": {
                          "type": "string",
                          "nullable": true
                        },
                        "nifOrNipc": {
                          "type": "string",
                          "nullable": true
                        },
                        "nipc": {
                          "type": "string",
                          "nullable": true
                        },
                        "role": {
                          "type": "string",
                          "nullable": true
                        }
                      },
                      "required": [
                        "name",
                        "nif",
                        "nifOrNipc",
                        "nipc",
                        "role"
                      ],
                      "additionalProperties": false
                    },
                    "minItems": 1,
                    "nullable": true
                  },
                  "fiscal": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "nif": {
                          "type": "string",
                          "nullable": true
                        },
                        "nifOrNipc": {
                          "type": "string",
                          "nullable": true
                        },
                        "nipc": {
                          "type": "string",
                          "nullable": true
                        },
                        "role": {
                          "type": "string",
                          "nullable": true
                        }
                      },
                      "required": [
                        "name",
                        "nif",
                        "nifOrNipc",
                        "nipc",
                        "role"
                      ],
                      "additionalProperties": false
                    },
                    "minItems": 1,
                    "nullable": true
                  },
                  "fiscalSubstitutes": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "nif": {
                          "type": "string",
                          "nullable": true
                        },
                        "nifOrNipc": {
                          "type": "string",
                          "nullable": true
                        },
                        "nipc": {
                          "type": "string",
                          "nullable": true
                        },
                        "role": {
                          "type": "string",
                          "nullable": true
                        }
                      },
                      "required": [
                        "name",
                        "nif",
                        "nifOrNipc",
                        "nipc",
                        "role"
                      ],
                      "additionalProperties": false
                    },
                    "minItems": 1,
                    "nullable": true
                  },
                  "management": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "nif": {
                          "type": "string",
                          "nullable": true
                        },
                        "nifOrNipc": {
                          "type": "string",
                          "nullable": true
                        },
                        "nipc": {
                          "type": "string",
                          "nullable": true
                        },
                        "role": {
                          "type": "string",
                          "nullable": true
                        }
                      },
                      "required": [
                        "name",
                        "nif",
                        "nifOrNipc",
                        "nipc",
                        "role"
                      ],
                      "additionalProperties": false
                    },
                    "minItems": 1,
                    "nullable": true
                  }
                },
                "required": [
                  "administration",
                  "administrationSubstitutes",
                  "fiscal",
                  "fiscalSubstitutes",
                  "management"
                ],
                "additionalProperties": false,
                "description": "Detailed breakdown of the members of various corporate bodies (e.g., Board of Directors, Supervisory Board), listing individuals and their roles. Keys represent the name of the corporate body."
              },
              "signatories": {
                "type": "string",
                "description": "A textual description of who can bind the company (forma de obrigar)."
              },
              "conservatory": {
                "type": "string",
                "description": "The specific Commercial Registry Office (Conservatória do Registo Comercial) where the company is registered."
              },
              "fiscalYearCloseDate": {
                "type": "object",
                "properties": {
                  "month": {
                    "type": "number",
                    "description": "The month of the fiscal year close date (1-12)"
                  },
                  "dayOfMonth": {
                    "type": "number"
                  }
                },
                "required": [
                  "month",
                  "dayOfMonth"
                ],
                "additionalProperties": false,
                "description": "The date on which the company's fiscal year ends."
              }
            }
          },
          {
            "type": "object",
            "properties": {
              "accountability": {
                "type": "object",
                "properties": {
                  "reportedYears": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    },
                    "description": "List of years for which the annual accounts (IES/DA) have been successfully registered."
                  },
                  "missingYears": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    },
                    "description": "The missing years are the years that the accountant has not yet submitted the financial statements according to the deadlines established by law.\nThe accountant must submit the financial statements by July 15 of the following year if the company's fiscal year aligns with the end of December.\nIf it doesn't align with the end of the year, the deadline for recording is until the 15th day of the 7th month after the end of the fiscal year.\nOnce the financial statements are submitted, a payment must be made in 5 business days, and that is the maximum legally allowed date for accountability."
                  }
                },
                "required": [
                  "reportedYears",
                  "missingYears"
                ],
                "additionalProperties": false,
                "description": "Summary of the company's accountability status regarding the submission of annual accounts (prestação de contas)."
              },
              "inLiquidation": {
                "type": "boolean",
                "description": "Indicates if the company is currently marked as being in liquidation proceedings."
              },
              "partnersAndQuotas": {
                "type": "array",
                "items": {
                  "allOf": [
                    {
                      "type": "object",
                      "properties": {
                        "holders": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "address": {
                                "type": "string",
                                "minLength": 1,
                                "nullable": true
                              },
                              "headquarters": {
                                "type": "string",
                                "minLength": 1,
                                "nullable": true
                              },
                              "holder": {
                                "type": "string",
                                "minLength": 1,
                                "nullable": true
                              },
                              "location": {
                                "type": "string",
                                "minLength": 1,
                                "nullable": true
                              },
                              "maritalStatus": {
                                "type": "string",
                                "minLength": 1,
                                "nullable": true
                              },
                              "nif": {
                                "type": "string",
                                "minLength": 1,
                                "nullable": true
                              },
                              "nifOrNipc": {
                                "type": "string",
                                "minLength": 1,
                                "nullable": true
                              },
                              "nipc": {
                                "type": "string",
                                "minLength": 1,
                                "nullable": true
                              },
                              "postalCode": {
                                "type": "string",
                                "minLength": 1,
                                "nullable": true
                              },
                              "propertyScheme": {
                                "type": "string",
                                "minLength": 1,
                                "nullable": true
                              },
                              "spouseName": {
                                "type": "string",
                                "minLength": 1,
                                "nullable": true
                              }
                            },
                            "required": [
                              "address",
                              "headquarters",
                              "holder",
                              "location",
                              "maritalStatus",
                              "nif",
                              "nifOrNipc",
                              "nipc",
                              "postalCode",
                              "propertyScheme",
                              "spouseName"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "splitFrom": {
                          "type": "object",
                          "properties": {
                            "amount": {
                              "type": "number",
                              "description": "The monetary amount."
                            },
                            "currency": {
                              "type": "string",
                              "minLength": 3,
                              "maxLength": 3,
                              "nullable": true,
                              "description": "The currency code (e.g., 'EUR', 'USD'). Null if unspecified."
                            }
                          },
                          "required": [
                            "amount",
                            "currency"
                          ],
                          "additionalProperties": false
                        },
                        "value": {
                          "type": "object",
                          "properties": {
                            "amount": {
                              "type": "number",
                              "description": "The monetary amount."
                            },
                            "currency": {
                              "type": "string",
                              "minLength": 3,
                              "maxLength": 3,
                              "nullable": true,
                              "description": "The currency code (e.g., 'EUR', 'USD'). Null if unspecified."
                            }
                          },
                          "required": [
                            "amount",
                            "currency"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "holders",
                        "value"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "shareRatio": {
                          "type": "number"
                        }
                      }
                    }
                  ]
                },
                "description": "Processed list of the company's current partners/shareholders and their respective quotas/stakes.\nThis is derived from the latest relevant records and mentions and includes the calculated share ratio for each holding.\nThe share ratio is a number between 0 and 1, representing the proportion of ownership."
              }
            },
            "required": [
              "accountability",
              "inLiquidation"
            ]
          },
          {
            "type": "object",
            "properties": {
              "pdf": {
                "type": "string",
                "description": "The government's original certificate HTML page printed as a base64-encoded PDF. Returned only when includePdf=true is requested on an authenticated route.",
                "format": "byte"
              }
            }
          }
        ],
        "description": "Represents a processed and structured version of a Portuguese Permanent Company Certificate (Certidão Permanente). It combines the core certificate data with derived summary information and processing issues, and can optionally include the original certificate as a PDF."
      },
      "Summary": {
        "properties": {
          "accountability": {
            "properties": {
              "reportedYears": {
                "items": {
                  "title": "Summary.accountability.reportedYears.[]",
                  "type": "number"
                },
                "title": "Summary.accountability.reportedYears",
                "description": "List of years for which the annual accounts (IES/DA) have been successfully registered.",
                "type": "array"
              },
              "missingYears": {
                "items": {
                  "title": "Summary.accountability.missingYears.[]",
                  "type": "number"
                },
                "title": "Summary.accountability.missingYears",
                "description": "The missing years are the years that the accountant has not yet submitted the financial statements according to the deadlines established by law.\nThe accountant must submit the financial statements by July 15 of the following year if the company's fiscal year aligns with the end of December.\nIf it doesn't align with the end of the year, the deadline for recording is until the 15th day of the 7th month after the end of the fiscal year.\nOnce the financial statements are submitted, a payment must be made in 5 business days, and that is the maximum legally allowed date for accountability.",
                "type": "array"
              }
            },
            "required": [
              "reportedYears",
              "missingYears"
            ],
            "additionalProperties": false,
            "title": "Summary.accountability",
            "description": "Summary of the company's accountability status regarding the submission of annual accounts (prestação de contas).",
            "type": "object"
          },
          "inLiquidation": {
            "title": "Summary.inLiquidation",
            "description": "Indicates if the company is currently marked as being in liquidation proceedings.",
            "type": "boolean"
          },
          "partnersAndQuotas": {
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/PartnersAndQuotas"
                },
                {
                  "properties": {
                    "shareRatio": {
                      "title": "shareRatio",
                      "type": "number"
                    }
                  },
                  "additionalProperties": false,
                  "type": "object"
                }
              ]
            },
            "title": "Summary.partnersAndQuotas",
            "description": "Processed list of the company's current partners/shareholders and their respective quotas/stakes.\nThis is derived from the latest relevant records and mentions and includes the calculated share ratio for each holding.\nThe share ratio is a number between 0 and 1, representing the proportion of ownership.",
            "type": "array"
          }
        },
        "required": [
          "accountability",
          "inLiquidation"
        ],
        "additionalProperties": false,
        "title": "Summary",
        "type": "object"
      },
      "Rcbe": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The full legal name of the entity."
          },
          "nipc": {
            "type": "string",
            "description": "The NIPC (Número de Identificação de Pessoa Coletiva) or company tax ID."
          },
          "country": {
            "type": "string",
            "description": "The country where the entity is registered."
          },
          "legalNature": {
            "type": "string",
            "description": "The legal nature/type of the entity (e.g., Sociedade por Quotas, Sociedade Anónima, etc.)."
          },
          "cae": {
            "type": "string",
            "description": "The CAE (Classificação das Atividades Económicas) code for the entity's main activity."
          },
          "uniqueLegalEntityId": {
            "type": "string",
            "description": "Unique legal entity identifier as assigned by the authorities."
          },
          "address": {
            "type": "string",
            "description": "The full address of the entity's registered office."
          },
          "district": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string",
                "nullable": true
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false,
            "description": "District information for the entity's address."
          },
          "municipality": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string",
                "nullable": true
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false,
            "description": "Municipality information for the entity's address."
          },
          "parish": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string",
                "nullable": true
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false,
            "description": "Parish information for the entity's address."
          },
          "institutionalEmail": {
            "type": "string",
            "format": "email",
            "description": "The official institutional email address of the entity."
          },
          "beneficiaries": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "firstName": {
                  "type": "string",
                  "description": "The beneficiary's first name(s)."
                },
                "lastName": {
                  "type": "string",
                  "description": "The beneficiary's last name (surname)."
                },
                "birthDate": {
                  "type": "string",
                  "pattern": "^(?:0[1-9]|1[0-2])-(?:19|20)\\d{2}$",
                  "description": "The beneficiary's date of birth (format: MM/YYYY)."
                },
                "nationality": {
                  "type": "string",
                  "description": "The beneficiary's nationality or nationalities (semicolon-separated if multiple)."
                },
                "isMinor": {
                  "type": "boolean",
                  "nullable": true,
                  "description": "Indicates if the beneficiary is a minor (under 18 years old)."
                },
                "isLegallyIncapacitated": {
                  "type": "boolean",
                  "nullable": true,
                  "description": "Indicates if the beneficiary is legally incapacitated (maior acompanhado)."
                },
                "informationSource": {
                  "type": "string",
                  "description": "The source of the information provided for this beneficiary."
                },
                "fullName": {
                  "type": "string",
                  "description": "The full name of the beneficiary as reported in the interest section."
                },
                "hasOwnershipOrControl": {
                  "type": "boolean",
                  "nullable": true,
                  "description": "Indicates if the beneficiary holds ownership or control of the entity."
                },
                "hasVotingRights": {
                  "type": "boolean",
                  "nullable": true,
                  "description": "Indicates if the beneficiary holds voting rights in the entity."
                },
                "ownershipRatio": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1,
                  "description": "The ratio of ownership held by the beneficiary (0 to 1, e.g., 0.25 for 25%)."
                },
                "ownershipType": {
                  "type": "string",
                  "description": "The type of ownership held (e.g., direct, indirect)."
                },
                "ownershipStructure": {
                  "type": "string",
                  "description": "The structure of the ownership (e.g., shares, quotas, other)."
                },
                "hasOtherControl": {
                  "type": "boolean",
                  "nullable": true,
                  "description": "Indicates if the beneficiary exercises any other type of direct or indirect control over the entity."
                },
                "topManagementType": {
                  "type": "string",
                  "nullable": true,
                  "description": "If the beneficiary is considered a top manager (e.g., director, board member), this field describes the type of top management role. Null if not applicable."
                }
              },
              "required": [
                "isMinor",
                "isLegallyIncapacitated",
                "hasOwnershipOrControl",
                "hasVotingRights",
                "ownershipRatio",
                "hasOtherControl"
              ],
              "additionalProperties": false
            },
            "description": "List of effective beneficiaries (beneficiários efetivos) as reported in the RCBE. Each beneficiary contains detailed information about their identity, relationship to the entity, and type of control or ownership."
          },
          "pdf": {
            "type": "string",
            "description": "The original RCBE PDF document as a base64-encoded string.",
            "format": "byte"
          }
        },
        "required": [
          "name",
          "nipc",
          "country",
          "legalNature",
          "cae",
          "uniqueLegalEntityId",
          "address",
          "district",
          "municipality",
          "parish",
          "institutionalEmail",
          "beneficiaries",
          "pdf"
        ],
        "additionalProperties": false,
        "description": "Represents a processed and structured version of a Portuguese RCBE (Registo Central do Beneficiário Efetivo) document. It contains the core entity data as reported in the RCBE, as well as the original PDF document."
      }
    }
  }
}
