{
  "openapi": "3.1.0",
  "info": {
    "title": "BIC Validation API",
    "version": "2",
    "summary": "Validate a BIC / SWIFT code against the official BIC directory, or search the directory by institution name.",
    "description": "Part of the BIC Validation service of IBAN.com. One request checks a BIC against the BIC directory licensed\nfrom S.W.I.F.T. SCRL and returns the institution behind it: name, branch, address, whether it is a financial\ninstitution, whether it is connected to the SWIFT network, and the network services and market\ninfrastructures it takes part in. A second endpoint searches the same directory by institution name and\ncountry. Worldwide coverage.\n\nFull documentation with recorded examples and the list of service codes: https://developer.iban.com/bic-validation-api\n\nHTTP status: **200** for every processed request, whether the BIC is valid or not (the outcome is in\n`error.code`: 8xx describes the input); **403** with the same JSON/XML structure for an account error\n(3xx); **400** with a short plain-text body when a required parameter is missing or `format` is wrong;\n**429** above 20 requests per second (HTML page); **500** with an empty body for a malformed parameter.\nBIC Validation plans have no query limit.\n",
    "termsOfService": "https://www.iban.com/terms",
    "license": {
      "name": "Proprietary — IBAN.com Terms & Conditions",
      "url": "https://www.iban.com/terms"
    },
    "contact": {
      "name": "IBAN.com support",
      "url": "https://clients.iban.com/support"
    }
  },
  "servers": [
    {
      "url": "https://api.iban.com/clients/api/swiftv2",
      "description": "Production. There is no separate sandbox."
    }
  ],
  "tags": [
    {
      "name": "BIC",
      "description": "Validate and look up a BIC."
    },
    {
      "name": "Bank search",
      "description": "Search the directory by institution name and country."
    }
  ],
  "paths": {
    "/bic/": {
      "post": {
        "tags": [
          "BIC"
        ],
        "operationId": "validateBic",
        "summary": "Validate a BIC (POST)",
        "description": "Parameters as an `application/x-www-form-urlencoded` body, the key included. JSON bodies are not read\n(HTTP 400). Preferred in production: the key travels in the request body instead of the URL. Returns\nthe same response as the GET form.\n",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/BicRequest"
              },
              "examples": {
                "head_office": {
                  "summary": "Barclays Bank PLC, head office (recorded 9 Oct 2026)",
                  "value": {
                    "api_key": "YOUR_API_KEY",
                    "format": "json",
                    "bic": "BARCGB22XXX"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/BicResult"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/BicAccountError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      },
      "get": {
        "tags": [
          "BIC"
        ],
        "operationId": "validateBicGet",
        "summary": "Validate a BIC (GET)",
        "description": "The same parameters in the query string, the key included (`api_key`). With GET the key is part of the\nURL and ends up in proxy and web-server access logs: use POST in production.\n",
        "security": [
          {
            "ApiKeyQuery": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/format"
          },
          {
            "$ref": "#/components/parameters/bic"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/BicResult"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/BicAccountError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/bank/": {
      "post": {
        "tags": [
          "Bank search"
        ],
        "operationId": "searchBank",
        "summary": "Search the directory by institution name (POST)",
        "description": "Finds every record whose institution name contains `bank_name` in the given `country`, optionally\nnarrowed by `city`, and returns up to `limit` of them (default 10, maximum 100; no paging). Records come\nin the directory's own order. `bic` is not accepted on this endpoint.\n",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/BankRequest"
              },
              "examples": {
                "natwest_us": {
                  "summary": "natwest in the United States (recorded 9 Oct 2026)",
                  "value": {
                    "api_key": "YOUR_API_KEY",
                    "format": "json",
                    "country": "US",
                    "bank_name": "natwest"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/BankResult"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/BankAccountError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      },
      "get": {
        "tags": [
          "Bank search"
        ],
        "operationId": "searchBankGet",
        "summary": "Search the directory by institution name (GET)",
        "description": "The same parameters in the query string, the key included (`api_key`). Use POST in production.",
        "security": [
          {
            "ApiKeyQuery": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/format"
          },
          {
            "$ref": "#/components/parameters/country"
          },
          {
            "$ref": "#/components/parameters/bank_name"
          },
          {
            "$ref": "#/components/parameters/city"
          },
          {
            "$ref": "#/components/parameters/limit"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/BankResult"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/BankAccountError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyQuery": {
        "type": "apiKey",
        "in": "query",
        "name": "api_key",
        "description": "Your personal key, shown under *API Access* in the client area, as the `api_key` parameter. On a POST\nrequest it is a field of the form body instead. Missing: HTTP 400 with a text body; wrong or empty:\nHTTP 403 with result code 301.\n"
      }
    },
    "parameters": {
      "format": {
        "name": "format",
        "in": "query",
        "required": true,
        "description": "Response format, lower case: `json` or `xml`. Missing, empty or any other value (`JSON` or `XML` in\nupper case included) is refused with HTTP 400 and a text body.\n",
        "schema": {
          "type": "string",
          "enum": [
            "json",
            "xml"
          ]
        },
        "example": "json"
      },
      "bic": {
        "name": "bic",
        "in": "query",
        "required": true,
        "description": "The BIC to validate, 8 or 11 characters, letters and digits only, in any case (lower case is converted\nand echoed in upper case). Spaces, hyphens and other characters are not removed: they give result code\n801; any length other than 8 or 11 gives 802. An 8-character BIC is looked up as its head-office record\n(branch code `XXX`). Missing or empty: HTTP 400.\n",
        "schema": {
          "type": "string"
        },
        "example": "BARCGB22XXX"
      },
      "country": {
        "name": "country",
        "in": "query",
        "required": true,
        "description": "ISO 3166-1 alpha-2 code of the country of the institution, in any case. Anything other than two letters\ngives 807; two letters that are not a country (`UK`, `XX`) find nothing (808). Missing: HTTP 400.\n",
        "schema": {
          "type": "string"
        },
        "example": "US"
      },
      "bank_name": {
        "name": "bank_name",
        "in": "query",
        "required": true,
        "description": "Part of the institution name, at least 3 characters, matched case-insensitively as a substring of the\nname in the directory (`barclays` finds *BARCLAYS BANK PLC* and its branches). Letters, digits and\nspaces are accepted; full stops, hyphens and apostrophes pass the check and are then matched literally;\naccented and other non-ASCII letters give 806. Missing: HTTP 400.\n",
        "schema": {
          "type": "string",
          "minLength": 3
        },
        "example": "natwest"
      },
      "city": {
        "name": "city",
        "in": "query",
        "required": false,
        "description": "Narrows the search to records whose city contains the value (case-insensitive substring: `lond`\nmatches *LONDON*). Echoed in `query` when sent. A city that matches nothing gives 808.\n",
        "schema": {
          "type": "string"
        },
        "example": "london"
      },
      "limit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "description": "Maximum number of records to return: default 10, maximum 100 (larger values are capped). A value that is\nnot a positive integer is ignored and the default applies; `5.5` is read as 5. There is no paging:\nnarrow the search with `city` or a longer name when `records_found` is above 100.\n",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "default": 10
        },
        "example": 5
      }
    },
    "responses": {
      "BicResult": {
        "description": "The request was processed. `bic_valid` and `bic_active` say whether the BIC exists and is connected;\n`error` is empty when the BIC was found and carries code 801 (invalid characters), 802 (wrong length)\nor 803 (not in the directory) otherwise, with `directory_results` and `services` empty. Same members in\nthe same order in both formats.\n",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/BicResponse"
            },
            "examples": {
              "head_office": {
                "summary": "BARCGB22XXX — Barclays Bank PLC, head office (recorded 9 Oct 2026)",
                "value": {
                  "query": {
                    "bic": "BARCGB22XXX",
                    "success": true
                  },
                  "bic_valid": true,
                  "bic_active": true,
                  "directory_results": {
                    "bic": "BARCGB22XXX",
                    "bic8": "BARCGB22",
                    "bic_branch": "XXX",
                    "institution": "FINANCIAL",
                    "name": "BARCLAYS BANK PLC",
                    "branch_name": "ALL U.K. OFFICES",
                    "office": "HEAD OFFICE",
                    "address": "1 CHURCHILL PLACE",
                    "city": "LONDON",
                    "zip": "E14 5HP",
                    "country_name": "UNITED KINGDOM",
                    "iso_country_code": "GB"
                  },
                  "services": [
                    {
                      "code": "FIN",
                      "description": "MANY-TO-MANY FIN PAYMENT SERVICE"
                    },
                    {
                      "code": "SCO",
                      "description": "SCORE FIN"
                    }
                  ],
                  "error": {}
                }
              },
              "not_found": {
                "summary": "ZZZZZZ99XXX — well-formed, not in the directory, code 803 (recorded 9 Oct 2026)",
                "value": {
                  "query": {
                    "bic": "ZZZZZZ99XXX",
                    "success": true
                  },
                  "bic_valid": false,
                  "bic_active": false,
                  "directory_results": {},
                  "services": [],
                  "error": {
                    "code": "803",
                    "message": "BIC Code not found in directory."
                  }
                }
              },
              "invalid_characters": {
                "summary": "BARC$B22XXX — code 801 (recorded 9 Oct 2026)",
                "value": {
                  "query": {
                    "bic": "BARC$B22XXX",
                    "success": true
                  },
                  "bic_valid": false,
                  "bic_active": false,
                  "directory_results": {},
                  "services": [],
                  "error": {
                    "code": "801",
                    "message": "Invalid characters in BIC."
                  }
                }
              },
              "wrong_length": {
                "summary": "BARCGB22X — 9 characters, code 802 (recorded 9 Oct 2026)",
                "value": {
                  "query": {
                    "bic": "BARCGB22X",
                    "success": true
                  },
                  "bic_valid": false,
                  "bic_active": false,
                  "directory_results": {},
                  "services": [],
                  "error": {
                    "code": "802",
                    "message": "Incorrect BIC Length. Accepted BIC length 8 or 11 characters"
                  }
                }
              }
            }
          },
          "application/xml": {
            "schema": {
              "$ref": "#/components/schemas/BicResponse"
            },
            "examples": {
              "head_office": {
                "summary": "BARCGB22XXX, `format=xml` (recorded 9 Oct 2026)",
                "description": "Verbatim (one line after the declaration). An empty `error` is `<error><code/><message/></error>`:\n\n```xml\n<?xml version=\"1.0\"?>\n<result><query><bic>BARCGB22XXX</bic><success>true</success></query><bic_valid>true</bic_valid><bic_active>true</bic_active><directory_results><bic>BARCGB22XXX</bic><bic8>BARCGB22</bic8><bic_branch>XXX</bic_branch><institution>FINANCIAL</institution><name>BARCLAYS BANK PLC</name><branch_name>ALL U.K. OFFICES</branch_name><office>HEAD OFFICE</office><address>1 CHURCHILL PLACE</address><city>LONDON</city><zip>E14 5HP</zip><country_name>UNITED KINGDOM</country_name><iso_country_code>GB</iso_country_code></directory_results><services><service><code>FIN</code><description>MANY-TO-MANY FIN PAYMENT SERVICE</description></service><service><code>SCO</code><description>SCORE FIN</description></service></services><error><code/><message/></error></result>\n```\n",
                "value": {
                  "query": {
                    "bic": "BARCGB22XXX",
                    "success": true
                  },
                  "bic_valid": true,
                  "bic_active": true,
                  "directory_results": {
                    "bic": "BARCGB22XXX",
                    "bic8": "BARCGB22",
                    "bic_branch": "XXX",
                    "institution": "FINANCIAL",
                    "name": "BARCLAYS BANK PLC",
                    "branch_name": "ALL U.K. OFFICES",
                    "office": "HEAD OFFICE",
                    "address": "1 CHURCHILL PLACE",
                    "city": "LONDON",
                    "zip": "E14 5HP",
                    "country_name": "UNITED KINGDOM",
                    "iso_country_code": "GB"
                  },
                  "services": [
                    {
                      "code": "FIN",
                      "description": "MANY-TO-MANY FIN PAYMENT SERVICE"
                    },
                    {
                      "code": "SCO",
                      "description": "SCORE FIN"
                    }
                  ],
                  "error": {}
                }
              }
            }
          }
        }
      },
      "BicAccountError": {
        "description": "Account error: result code 301 (key invalid), 302 (subscription expired), 303 (no queries — not\nexpected on an unlimited plan), 304 (no access to this API), 305 (IP address not allowed). Same\nstructure as a 200 with `error` filled, `query.bic` empty and `query.success` false. 301 recorded; the\nothers follow the same path.\n",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/BicResponse"
            },
            "examples": {
              "wrong_key": {
                "summary": "Wrong key, code 301 (recorded 9 Oct 2026)",
                "value": {
                  "query": {
                    "bic": "",
                    "success": false
                  },
                  "bic_valid": false,
                  "bic_active": false,
                  "directory_results": {},
                  "services": [],
                  "error": {
                    "code": "301",
                    "message": "API Key is invalid"
                  }
                }
              }
            }
          },
          "application/xml": {
            "schema": {
              "$ref": "#/components/schemas/BicResponse"
            },
            "examples": {
              "wrong_key": {
                "summary": "Wrong key, `format=xml` (recorded 9 Oct 2026)",
                "description": "Verbatim:\n\n```xml\n<?xml version=\"1.0\"?>\n<result><query><bic/><success>false</success></query><bic_valid>false</bic_valid><bic_active>false</bic_active><directory_results/><services/><error><code>301</code><message>API Key is invalid</message></error></result>\n```\n",
                "value": {
                  "query": {
                    "bic": "",
                    "success": false
                  },
                  "bic_valid": false,
                  "bic_active": false,
                  "directory_results": {},
                  "services": [],
                  "error": {
                    "code": "301",
                    "message": "API Key is invalid"
                  }
                }
              }
            }
          }
        }
      },
      "BankResult": {
        "description": "The search was run. `records_found` is the number of matches before `limit`; `records_displayed` is the\nlimit in effect, not the number of records returned — count `directory_results`. With no match\n`error.code` is 808 and `query.success` false; 806 (name too short or with characters outside a–z, 0-9,\nspace) and 807 (country not two letters) have the same shape.\n",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/BankResponse"
            },
            "examples": {
              "natwest_us": {
                "summary": "natwest in the United States — four records (recorded 9 Oct 2026, shortened to the first two)",
                "value": {
                  "query": {
                    "country": "US",
                    "bank_name": "natwest",
                    "success": true
                  },
                  "records_found": 4,
                  "records_displayed": 10,
                  "directory_results": [
                    {
                      "bic": "RBOSUS3GXXX",
                      "bic8": "RBOSUS3G",
                      "bic_branch": "XXX",
                      "institution": "FINANCIAL",
                      "name": "NATWEST MARKETS SECURITIES INC.",
                      "branch_name": "",
                      "bic_active": true,
                      "office": "BRANCH",
                      "address": "600 WASHINGTON BLVD",
                      "city": "STAMFORD,CT",
                      "zip": "06901",
                      "country_name": "UNITED STATES OF AMERICA",
                      "iso_country_code": "US",
                      "services": [
                        {
                          "code": "FIN",
                          "description": "MANY-TO-MANY FIN PAYMENT SERVICE"
                        }
                      ]
                    },
                    {
                      "bic": "GRNWUS33FUT",
                      "bic8": "GRNWUS33",
                      "bic_branch": "FUT",
                      "institution": "FINANCIAL",
                      "name": "NATWEST MARKETS SECURITIES INC.",
                      "branch_name": "FUTURES",
                      "bic_active": true,
                      "office": "BRANCH",
                      "address": "600 WASHINGTON BLVD",
                      "city": "STAMFORD,CT",
                      "zip": "06901",
                      "country_name": "UNITED STATES OF AMERICA",
                      "iso_country_code": "US",
                      "services": [
                        {
                          "code": "FIN",
                          "description": "MANY-TO-MANY FIN PAYMENT SERVICE"
                        }
                      ]
                    }
                  ],
                  "error": {}
                }
              },
              "no_records": {
                "summary": "Nothing matches — code 808 (recorded 9 Oct 2026)",
                "value": {
                  "query": {
                    "country": "US",
                    "bank_name": "zzzzqqqqxx",
                    "success": false
                  },
                  "records_found": 0,
                  "records_displayed": 0,
                  "directory_results": [],
                  "error": {
                    "code": "808",
                    "message": "No records found in directory."
                  }
                }
              }
            }
          },
          "application/xml": {
            "schema": {
              "$ref": "#/components/schemas/BankResponse"
            },
            "examples": {
              "natwest_us": {
                "summary": "The same search with `format=xml` (recorded 9 Oct 2026, shortened to the first record)",
                "description": "In XML each record is a `record` element, `bic_active` is the numeric flag `1`, the `services`\nelement of a record is empty even when JSON lists services, and the response carries top-level\n`bic_valid` and `bic_active` elements (both `false`) that have no meaning for a search:\n\n```xml\n<?xml version=\"1.0\"?>\n<result><query><country>US</country><bank_name>natwest</bank_name><success>true</success></query><bic_valid>false</bic_valid><bic_active>false</bic_active><directory_results><record><bic>RBOSUS3GXXX</bic><bic8>RBOSUS3G</bic8><bic_branch>XXX</bic_branch><institution>FINANCIAL</institution><name>NATWEST MARKETS SECURITIES INC.</name><branch_name/><bic_active>1</bic_active><office>BRANCH</office><address>600 WASHINGTON BLVD</address><city>STAMFORD,CT</city><zip>06901</zip><country_name>UNITED STATES OF AMERICA</country_name><iso_country_code>US</iso_country_code><services/></record>…</directory_results>…</result>\n```\n",
                "value": {
                  "query": {
                    "country": "US",
                    "bank_name": "natwest",
                    "success": true
                  },
                  "records_found": 4,
                  "records_displayed": 10,
                  "directory_results": [
                    {
                      "bic": "RBOSUS3GXXX",
                      "bic8": "RBOSUS3G",
                      "bic_branch": "XXX",
                      "institution": "FINANCIAL",
                      "name": "NATWEST MARKETS SECURITIES INC.",
                      "branch_name": "",
                      "bic_active": true,
                      "office": "BRANCH",
                      "address": "600 WASHINGTON BLVD",
                      "city": "STAMFORD,CT",
                      "zip": "06901",
                      "country_name": "UNITED STATES OF AMERICA",
                      "iso_country_code": "US",
                      "services": []
                    }
                  ],
                  "error": {}
                }
              }
            }
          }
        }
      },
      "BankAccountError": {
        "description": "Account error (result codes 301–305) on the bank endpoint; `query` fields empty, `query.success` false.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/BankResponse"
            },
            "examples": {
              "wrong_key": {
                "summary": "Wrong key, code 301 (recorded 9 Oct 2026)",
                "value": {
                  "query": {
                    "country": "",
                    "bank_name": "",
                    "success": false
                  },
                  "records_found": 0,
                  "records_displayed": 0,
                  "directory_results": [],
                  "error": {
                    "code": "301",
                    "message": "API Key is invalid"
                  }
                }
              }
            }
          },
          "application/xml": {
            "schema": {
              "$ref": "#/components/schemas/BankResponse"
            }
          }
        }
      },
      "BadRequest": {
        "description": "A required parameter is missing or `format` is wrong. Plain text (`text/html; charset=UTF-8`), no\nresult code — match on the status. Recorded bodies: `Bad Request: Missing 'api_key' or 'format'\nparameter values` (also the answer to a JSON body), `Bad Request: Invalid 'format' parameter value`,\n`Bad Request` (`bic` missing or empty; `bank_name` or `country` missing).\n",
        "content": {
          "text/html": {
            "schema": {
              "type": "string"
            },
            "examples": {
              "missing_format": {
                "value": "Bad Request: Missing 'api_key' or 'format' parameter values"
              },
              "bad_format": {
                "value": "Bad Request: Invalid 'format' parameter value"
              },
              "missing_input": {
                "value": "Bad Request"
              }
            }
          }
        }
      },
      "RateLimited": {
        "description": "More than 20 requests per second. Rejected by the web server before reaching the API: not processed;\nthe body is a small HTML page, there is no `Retry-After` header. Wait a moment and resend.\n",
        "content": {
          "text/html": {
            "schema": {
              "type": "string"
            }
          }
        }
      },
      "ServerError": {
        "description": "Empty body. Recorded for a parameter sent in a form the API cannot read (`bic[]`); for anything else a temporary problem — retry with increasing delays.",
        "content": {
          "text/html": {
            "schema": {
              "type": "string"
            }
          }
        }
      }
    },
    "schemas": {
      "BicRequest": {
        "type": "object",
        "required": [
          "api_key",
          "format",
          "bic"
        ],
        "properties": {
          "api_key": {
            "type": "string",
            "description": "Your personal key, shown under *API Access* in the client area.",
            "examples": [
              "YOUR_API_KEY"
            ]
          },
          "format": {
            "type": "string",
            "enum": [
              "json",
              "xml"
            ],
            "description": "Response format, lower case; anything else is refused with HTTP 400."
          },
          "bic": {
            "type": "string",
            "description": "The BIC, 8 or 11 characters, letters and digits only, any case. Not cleaned — separators give 801.",
            "examples": [
              "BARCGB22XXX",
              "BARCGB22",
              "deutdeff500"
            ]
          }
        }
      },
      "BankRequest": {
        "type": "object",
        "required": [
          "api_key",
          "format",
          "country",
          "bank_name"
        ],
        "properties": {
          "api_key": {
            "type": "string",
            "description": "Your personal key, shown under *API Access* in the client area.",
            "examples": [
              "YOUR_API_KEY"
            ]
          },
          "format": {
            "type": "string",
            "enum": [
              "json",
              "xml"
            ],
            "description": "Response format, lower case; anything else is refused with HTTP 400."
          },
          "country": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2 code of the country, any case. Not two letters → 807; unknown pair → 808.",
            "examples": [
              "US",
              "gb"
            ]
          },
          "bank_name": {
            "type": "string",
            "minLength": 3,
            "description": "Part of the institution name, at least 3 characters (letters, digits, spaces; non-ASCII letters → 806), matched case-insensitively.",
            "examples": [
              "natwest",
              "barclays",
              "j.p. morgan"
            ]
          },
          "city": {
            "type": "string",
            "description": "Case-insensitive substring filter on the record's city; echoed in `query` when sent.",
            "examples": [
              "london"
            ]
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "default": 10,
            "description": "Records to return, 1–100 (default 10, larger values capped, invalid values ignored).",
            "examples": [
              5
            ]
          }
        }
      },
      "BicResponse": {
        "type": "object",
        "required": [
          "query",
          "bic_valid",
          "bic_active",
          "directory_results",
          "services",
          "error"
        ],
        "properties": {
          "query": {
            "type": "object",
            "required": [
              "bic",
              "success"
            ],
            "properties": {
              "bic": {
                "type": "string",
                "description": "The BIC as received, converted to upper case. Empty in the response to an account error."
              },
              "success": {
                "type": "boolean",
                "description": "`true` when the request was processed, including when the BIC failed validation (801–803); `false` only for account errors."
              }
            }
          },
          "bic_valid": {
            "type": "boolean",
            "description": "`true` when the BIC has the right form and exists in the directory; `false` for 801, 802 and 803."
          },
          "bic_active": {
            "type": "boolean",
            "description": "`true` when the directory marks the BIC as connected to the SWIFT network. `false` for a BIC that\nexists but is not connected: passive participants (8th character `1`) and disconnected institutions;\nalso `false` whenever `bic_valid` is `false`. An active BIC can still have an empty `services` list.\n"
          },
          "directory_results": {
            "description": "The directory record; an empty object (empty element in XML) when the BIC was not found.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/DirectoryRecord"
              },
              {
                "type": "object",
                "additionalProperties": false,
                "description": "Empty — BIC not found or account error."
              }
            ]
          },
          "services": {
            "type": "array",
            "description": "The SWIFT network services and market infrastructures the BIC takes part in. Empty when the BIC has none or was not found. Codes are listed on the documentation page.",
            "items": {
              "$ref": "#/components/schemas/Service"
            },
            "xml": {
              "wrapped": true
            }
          },
          "error": {
            "$ref": "#/components/schemas/ResultError"
          }
        },
        "xml": {
          "name": "result"
        }
      },
      "BankResponse": {
        "type": "object",
        "required": [
          "query",
          "records_found",
          "records_displayed",
          "directory_results",
          "error"
        ],
        "properties": {
          "query": {
            "type": "object",
            "required": [
              "country",
              "bank_name",
              "success"
            ],
            "description": "`country` and `bank_name` as received (case kept; a country value longer than two characters is cut to two), `success`, and `city` when it was sent. `success` is `false` for 806, 807, 808 and the account errors.",
            "properties": {
              "country": {
                "type": "string"
              },
              "bank_name": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "city": {
                "type": "string"
              }
            }
          },
          "records_found": {
            "type": "integer",
            "description": "Number of records that match the search before `limit` is applied; with `city` it counts the filtered records. 0 with code 808."
          },
          "records_displayed": {
            "type": "integer",
            "description": "The limit in effect (the `limit` sent, capped at 100, or 10) — not the number of records returned. 0 on an error."
          },
          "directory_results": {
            "type": "array",
            "description": "The matching records in the directory's own order (not alphabetical), each with its own `bic_active` and `services`. Empty on an error.",
            "items": {
              "$ref": "#/components/schemas/BankRecord"
            },
            "xml": {
              "wrapped": true
            }
          },
          "error": {
            "$ref": "#/components/schemas/ResultError"
          }
        },
        "xml": {
          "name": "result"
        }
      },
      "DirectoryRecord": {
        "type": "object",
        "required": [
          "bic",
          "bic8",
          "bic_branch",
          "institution",
          "name",
          "branch_name",
          "office",
          "address",
          "city",
          "zip",
          "country_name",
          "iso_country_code"
        ],
        "properties": {
          "bic": {
            "type": "string",
            "minLength": 11,
            "maxLength": 11,
            "description": "The BIC of the record, always 11 characters (`BARCGB22XXX` for an 8-character request)."
          },
          "bic8": {
            "type": "string",
            "minLength": 8,
            "maxLength": 8,
            "description": "The first eight characters: institution, country and location codes."
          },
          "bic_branch": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3,
            "description": "The branch code; `XXX` for the head-office record."
          },
          "institution": {
            "type": "string",
            "enum": [
              "FINANCIAL",
              "NONFINANCIAL"
            ],
            "description": "`NONFINANCIAL`: a corporate with its own BIC."
          },
          "name": {
            "type": "string",
            "description": "Name of the institution as registered with SWIFT, upper case."
          },
          "branch_name": {
            "type": "string",
            "description": "Branch or department; often empty, `HEAD OFFICE` for some head-office branch codes."
          },
          "office": {
            "type": "string",
            "enum": [
              "HEAD OFFICE",
              "BRANCH"
            ],
            "description": "Office type of the record. A passive or disconnected BIC can be registered as `BRANCH` even with branch code `XXX`."
          },
          "address": {
            "type": "string",
            "description": "Street address; empty when the directory has none."
          },
          "city": {
            "type": "string"
          },
          "zip": {
            "type": "string"
          },
          "country_name": {
            "type": "string",
            "description": "Country name, upper case."
          },
          "iso_country_code": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2, the same as characters 5–6 of the BIC."
          }
        }
      },
      "BankRecord": {
        "allOf": [
          {
            "$ref": "#/components/schemas/DirectoryRecord"
          },
          {
            "type": "object",
            "required": [
              "bic_active",
              "services"
            ],
            "properties": {
              "bic_active": {
                "type": "boolean",
                "description": "Connected to the SWIFT network (in XML the numeric flag `1`)."
              },
              "services": {
                "type": "array",
                "description": "The record's services (in XML this element is empty).",
                "items": {
                  "$ref": "#/components/schemas/Service"
                }
              }
            }
          }
        ],
        "xml": {
          "name": "record"
        }
      },
      "Service": {
        "type": "object",
        "required": [
          "code",
          "description"
        ],
        "properties": {
          "code": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3,
            "description": "Three-character code of a SWIFT network service (`FIN`) or a market infrastructure (`TGT`, `STG`…)."
          },
          "description": {
            "type": "string"
          }
        },
        "xml": {
          "name": "service"
        }
      },
      "ResultError": {
        "type": "object",
        "description": "Empty (`{}`; in XML empty `code` and `message` elements) on success; otherwise a three-digit string code and a message.",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "801",
              "802",
              "803",
              "806",
              "807",
              "808",
              "301",
              "302",
              "303",
              "304",
              "305"
            ],
            "description": "BIC endpoint: 801 invalid characters · 802 wrong length · 803 not in the directory. Bank endpoint:\n806 name invalid · 807 country code incorrect · 808 no records. Both, with HTTP 403: 301 key invalid ·\n302 subscription expired · 303 no queries · 304 no access · 305 IP not allowed.\n"
          },
          "message": {
            "type": "string"
          }
        },
        "additionalProperties": false
      }
    }
  }
}