{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/if/json-schema/if-beneficiary-list-response-schema.json",
  "title": "BeneficiaryListResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/if-beneficiaries-api-openapi.yml#/components/schemas/BeneficiaryListResponse",
  "required": [
    "connect",
    "data",
    "metadata",
    "workflow"
  ],
  "type": "object",
  "properties": {
    "workflow": {
      "$ref": "#/$defs/BeneficiaryListWorkflowContainer"
    },
    "data": {
      "$ref": "#/$defs/BeneficiariesListDataContainer"
    },
    "connect": {
      "$ref": "#/$defs/BeneficiaryListConnectContainer"
    },
    "metadata": {
      "$ref": "#/$defs/BeneficiaryListMetadataContainer"
    }
  },
  "$defs": {
    "Address": {
      "required": [
        "city",
        "country",
        "street"
      ],
      "type": "object",
      "properties": {
        "country": {
          "maxLength": 2,
          "minLength": 2,
          "pattern": "^[A-Z]{2}$",
          "type": "string"
        },
        "region": {
          "type": "string"
        },
        "postalCode": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "street": {
          "type": "string"
        },
        "houseNumber": {
          "type": "string"
        },
        "refinement": {
          "type": "string"
        }
      }
    },
    "BeneficiariesListDataContainer": {
      "type": "object",
      "properties": {
        "beneficiary": {
          "$ref": "#/$defs/BeneficiaryResourceListQueryInput"
        },
        "beneficiaries": {
          "type": "array",
          "readOnly": true,
          "items": {
            "$ref": "#/$defs/Beneficiary"
          }
        }
      }
    },
    "Beneficiary": {
      "required": [
        "clientId",
        "identity"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "clientId": {
          "type": "string",
          "description": "ID of client in UUID format",
          "format": "uuid"
        },
        "identity": {
          "$ref": "#/$defs/LegalEntityIdentity"
        },
        "contact": {
          "$ref": "#/$defs/BeneficiaryContact"
        },
        "address": {
          "$ref": "#/$defs/Address"
        },
        "title": {
          "type": "string"
        },
        "fullName": {
          "type": "string"
        },
        "bankAccounts": {
          "type": "array",
          "description": "beneficiary bank accounts",
          "readOnly": true,
          "items": {
            "$ref": "#/$defs/BeneficiaryBankAccount"
          }
        }
      },
      "description": "Beneficiary Resource Object"
    },
    "BeneficiaryBankAccount": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "accountHolderType": {
          "$ref": "#/$defs/LegalEntityType"
        },
        "beneficiaryId": {
          "type": "string",
          "format": "uuid"
        },
        "country": {
          "type": "string"
        },
        "currency": {
          "type": "string"
        },
        "routingCodes": {
          "$ref": "#/$defs/RoutingCodeMap"
        },
        "accountNumber": {
          "type": "string"
        },
        "iban": {
          "type": "string"
        },
        "bankName": {
          "type": "string"
        },
        "creationDateTime": {
          "type": "string",
          "format": "date-time"
        },
        "creatingUserUsername": {
          "type": "string"
        },
        "oneTimePasswordId": {
          "type": "string",
          "format": "uuid"
        },
        "oneTimePassword": {
          "type": "string"
        },
        "ledgerNumber": {
          "type": "string"
        }
      },
      "description": "Beneficiary Bank Account Resource Object",
      "readOnly": true
    },
    "BeneficiaryContact": {
      "type": "object",
      "properties": {
        "phone": {
          "type": "string",
          "description": "beneficiary contact phone number"
        },
        "email": {
          "type": "string",
          "description": "beneficiary contact email address"
        },
        "address": {
          "$ref": "#/$defs/Address"
        }
      },
      "description": "Beneficiary Contact Resource Object"
    },
    "BeneficiaryListConnectContainer": {
      "type": "object"
    },
    "BeneficiaryListMetadataContainer": {
      "required": [
        "page"
      ],
      "type": "object",
      "properties": {
        "page": {
          "$ref": "#/$defs/PageMetadata"
        }
      }
    },
    "BeneficiaryListWorkflowContainer": {
      "type": "object"
    },
    "BeneficiaryResourceListQueryInput": {
      "type": "object",
      "properties": {
        "clientId": {
          "type": "string",
          "format": "uuid"
        },
        "type": {
          "$ref": "#/$defs/LegalEntityType"
        },
        "country": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "owner": {
          "$ref": "#/$defs/Owner"
        }
      }
    },
    "LegalEntityIdentity": {
      "required": [
        "type"
      ],
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        }
      }
    },
    "LegalEntityType": {
      "type": "string",
      "enum": [
        "corporate",
        "individual"
      ]
    },
    "Owner": {
      "type": "string",
      "enum": [
        "organization",
        "client"
      ]
    },
    "PageMetadata": {
      "required": [
        "number",
        "size",
        "totalElements",
        "totalPages"
      ],
      "type": "object",
      "properties": {
        "size": {
          "minimum": 0,
          "type": "integer",
          "description": "number of elements in this page",
          "format": "int32"
        },
        "number": {
          "minimum": 0,
          "type": "integer",
          "description": "index of page starting from 0",
          "format": "int32"
        },
        "totalElements": {
          "minimum": 0,
          "type": "integer",
          "description": "total number of elements in all of the pages",
          "format": "int64",
          "readOnly": true
        },
        "totalPages": {
          "minimum": 0,
          "type": "integer",
          "description": "number of total pages",
          "format": "int32",
          "readOnly": true
        }
      }
    },
    "RoutingCodeMap": {
      "type": "object"
    }
  }
}