Swift/BIC codes follow this convention:
AAAA BB CC DDD
AAAA Bank code A-Z
4 letter code. It usually looks like a shortened version of that bank's name.
BB Country code A-Z
2 letter code. It says which country that bank is in.
CC Location code 0-9 A-Z
2 digit location code that could be either 2 letters or numbers. It says where that bank's head office is.
DDD Branch Code 0-9 A-Z
Optional 3 digit code. It specifies a particular branch, instead of the bank's head office. 'XXX' for head office.
There are sites where you can get the list of Swift codes by country, in order to validate the user input, they are in json format. PeterNotenboom/SwiftCodes
on github
IBAN codes (International Bank Account Number) follow this convention:
2 letters with the ISO 3166-1 alpha-2 country code
2 digits as control codes
up to 30 digits Basic Bank Account Number (BBAN) is country specific, and there are different rules for validation.
Resuming:
You can split the BIC field in four INPUT
and validate it to a json list of banks. The country code you may get from a SELECT
, as there is a list of countries in the ISO norm.
You can split the IBAN into three separate INPUT
boxes. The country code you may get from a SELECT
, as there is a list of countries in the ISO norm. The third INPUT
is country specific and it may vary a lot from country to country.
P.S. Currently there are 105548 different Swift/BIC codes....