How to do SWIFT code and IBAN validation in c#

3.9k views Asked by At

I need to validate IBAN and SWIFT from c#. I can see for the IBAN part there is a nuget package I am going to test:

IBAN NUGET

However for the SWIFT part I haven't found much information. Anyone knows how to do this kind of validation from c#?

1

There are 1 answers

0
Steve On

There is information here on the format of SWIFT codes: https://www.theswiftcodes.com/

Extract:

The code formatted as below:
AAAA BB CC DDD
First 4 characters - bank code (only letters)
Next 2 characters - ISO 3166-1 alpha-2 country code (only letters)
Next 2 characters - location code (letters and digits) (passive participant will have "1" in the second character)
Last 3 characters - branch code, optional ('XXX' for primary office) (letters and digits)

Clearly, some of these elements can be individually validated to determine whether a particular code is plausible.

However, unlike the IBAN there appears to be no check digit element.

Therefore, the only way to validate is to refer to a current definitive list of SWIFT codes, and I believe that data is proprietary and obviously will be subject to updates/change over time.