{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/swift/json-schema/swift-bic-iso-details-schema.json",
  "title": "BicIsoDetails",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/swift-swiftref-api-v4-openapi.yml#/components/schemas/BicIsoDetails",
  "type": "object",
  "required": [
    "bic",
    "name",
    "structured_address"
  ],
  "properties": {
    "bic": {
      "$ref": "#/$defs/Bic"
    },
    "office_type": {
      "$ref": "#/$defs/OfficeType"
    },
    "name": {
      "$ref": "#/$defs/InstitutionName"
    },
    "department": {
      "$ref": "#/$defs/InstitutionDepartment"
    },
    "sub_department": {
      "$ref": "#/$defs/InstitutionDepartment"
    },
    "unstructured_address": {
      "$ref": "#/$defs/UnstructuredAddress"
    },
    "structured_address": {
      "$ref": "#/$defs/StructuredAddress"
    },
    "swift_connectivity": {
      "$ref": "#/$defs/SwiftConnectivity"
    },
    "swift_services": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SwiftService"
      },
      "description": "A list of 3-character codes and names of SWIFT FIN service codes (also called value added service codes)"
    },
    "swift_type": {
      "$ref": "#/$defs/SwiftSubtypeIndicator"
    },
    "utc_offset": {
      "$ref": "#/$defs/TimeOffset"
    }
  },
  "$defs": {
    "Bic": {
      "type": "string",
      "description": "Bank Identifier Code - ISO 9362",
      "pattern": "^[A-Z]{6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3})?$"
    },
    "CountryCode": {
      "type": "string",
      "pattern": "^[a-zA-Z]{2}$",
      "description": "2-character ISO 3166-1 country code"
    },
    "CountryName": {
      "$ref": "#/$defs/StringMax70"
    },
    "FinPlusDistinguishedName": {
      "$ref": "#/$defs/StringMax255"
    },
    "InstitutionDepartment": {
      "$ref": "#/$defs/StringMax70"
    },
    "InstitutionName": {
      "$ref": "#/$defs/StringMax140"
    },
    "IsoPostOfficeIdentifier": {
      "description": "Numbered box in a post office, assigned to a person or organisation, where letters are kept until called for",
      "type": "string",
      "minLength": 1,
      "maxLength": 16
    },
    "IsoPostalCode": {
      "type": "string",
      "minLength": 1,
      "maxLength": 16,
      "description": "Identifier consisting of a group of letters and/or numbers that is added to a postal address to assist the sorting of mail"
    },
    "OfficeType": {
      "type": "string",
      "pattern": "^[A-Z0-9]{1,2}$",
      "description": "Status of the entity in the office hierarchy"
    },
    "StringMax105": {
      "description": "Generic string definition, from 1 to 105 characters long",
      "type": "string",
      "minLength": 1,
      "maxLength": 105
    },
    "StringMax140": {
      "description": "Generic string definition, from 1 to 140 characters long",
      "type": "string",
      "minLength": 1,
      "maxLength": 140
    },
    "StringMax16": {
      "description": "Generic string definition, from 1 to 16 characters long",
      "type": "string",
      "minLength": 1,
      "maxLength": 16
    },
    "StringMax255": {
      "description": "Generic string definition, from 1 to 255 characters long",
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "StringMax35": {
      "description": "Generic string definition, from 1 to 35 characters long",
      "type": "string",
      "minLength": 1,
      "maxLength": 35
    },
    "StringMax70": {
      "description": "Generic string definition, from 1 to 70 characters long",
      "type": "string",
      "minLength": 1,
      "maxLength": 70
    },
    "StructuredAddress": {
      "type": "object",
      "description": "ISO-compliant structured address",
      "required": [
        "country_code",
        "country_name"
      ],
      "properties": {
        "street_name": {
          "$ref": "#/$defs/StringMax70"
        },
        "building_number": {
          "$ref": "#/$defs/StringMax16"
        },
        "building_name": {
          "$ref": "#/$defs/StringMax35"
        },
        "post_box": {
          "$ref": "#/$defs/IsoPostOfficeIdentifier"
        },
        "floor": {
          "$ref": "#/$defs/StringMax70"
        },
        "room": {
          "$ref": "#/$defs/StringMax70"
        },
        "post_code": {
          "$ref": "#/$defs/IsoPostalCode"
        },
        "town_name": {
          "$ref": "#/$defs/StringMax35"
        },
        "town_location_name": {
          "$ref": "#/$defs/StringMax35"
        },
        "district_name": {
          "$ref": "#/$defs/StringMax35"
        },
        "country_subdivision_name": {
          "$ref": "#/$defs/StringMax35"
        },
        "country_subdivision_code": {
          "$ref": "#/$defs/StringMax35"
        },
        "country_code": {
          "$ref": "#/$defs/CountryCode"
        },
        "country_name": {
          "$ref": "#/$defs/CountryName"
        }
      },
      "additionalProperties": false
    },
    "SwiftConnectivity": {
      "description": "Institution connection to SWIFTNet messaging services",
      "type": "object",
      "required": [
        "fin",
        "interact",
        "fileact"
      ],
      "properties": {
        "fin": {
          "type": "boolean",
          "description": "True if connected to SWIFT FIN, false otherwise"
        },
        "finplus": {
          "type": "object",
          "description": "FINplus Distinguished Names (DN), used to uniquely identify an entity that sends or receives messages over SWIFTNet.",
          "properties": {
            "future": {
              "$ref": "#/$defs/FinPlusDistinguishedName"
            },
            "live": {
              "$ref": "#/$defs/FinPlusDistinguishedName"
            },
            "pilot": {
              "$ref": "#/$defs/FinPlusDistinguishedName"
            }
          },
          "additionalProperties": false
        },
        "interact": {
          "type": "boolean",
          "description": "True if used in at least one service on SWIFTNet InterAct, false otherwise"
        },
        "fileact": {
          "type": "boolean",
          "description": "True if used in at least one service on SWIFTNet FileAct, false otherwise"
        }
      },
      "additionalProperties": false
    },
    "SwiftService": {
      "description": "SWIFT service code and name",
      "type": "object",
      "required": [
        "code",
        "name"
      ],
      "properties": {
        "code": {
          "type": "string",
          "pattern": "^[A-Z]{2}[A-Z+]$",
          "description": "Code given by the service provider (SWIFT) to uniquely identify a service it offers"
        },
        "name": {
          "$ref": "#/$defs/StringMax105"
        }
      },
      "additionalProperties": false
    },
    "SwiftSubtypeIndicator": {
      "type": "string",
      "pattern": "^[0-9A-Z]{4}$",
      "description": "SWIFT subtype indicator"
    },
    "TimeOffset": {
      "type": "string",
      "pattern": "^[±+-]\\d\\d:\\d\\d$",
      "description": "Difference in hours and minutes between two places"
    },
    "UnstructuredAddress": {
      "type": "object",
      "description": "ISO-compliant unstructured address",
      "required": [
        "address_line_1"
      ],
      "properties": {
        "address_line_1": {
          "$ref": "#/$defs/StringMax35"
        },
        "address_line_2": {
          "$ref": "#/$defs/StringMax35"
        },
        "address_line_3": {
          "$ref": "#/$defs/StringMax35"
        }
      },
      "additionalProperties": false
    }
  }
}