/iban-country-checkValidate an IBAN's format and mod-97 checksum, derive its country code, and optionally compare it to an expected country. Format/checksum/country only — no bank-account verification.
{
"description": "Provide an IBAN; expected_country is optional.",
"properties": {
"expected_country": {
"description": "Optional ISO 3166-1 alpha-2 code to compare against, e.g. \"NL\".",
"type": "string"
},
"iban": {
"description": "IBAN, spaces allowed, e.g. \"NL91ABNA0417164300\" or \"NL91 ABNA 0417 1643 00\".",
"type": "string"
}
},
"required": [
"iban"
],
"type": "object"
}{
"properties": {
"country": {
"description": "Two-letter code read from the IBAN (echoed even when the length table does not support it).",
"type": [
"string",
"null"
]
},
"country_matches": {
"description": "null when no expected_country was supplied.",
"type": [
"boolean",
"null"
]
},
"expected_country": {
"type": [
"string",
"null"
]
},
"format_valid": {
"description": "true only when both the per-country length and the mod-97 checksum are correct.",
"type": "boolean"
},
"iban": {
"type": "string"
}
},
"type": "object"
}{
"expected_country": "NL",
"iban": "NL91ABNA0417164300"
}{
"country": "NL",
"country_matches": true,
"expected_country": "NL",
"format_valid": true,
"iban": "NL91ABNA0417164300"
}