This microservice is written in Go, without any dependencies. It supports SWIFT rules updates mechanism.
IBAN validation consists of two steps:
- checking IBAN structure, based on SWIFT rules: https://www.swift.com/standards/data-standards/iban-international-bank-account-number
- validating IBAN by converting it into an integer and performing a basic mod-97 operation
For more information: https://en.wikipedia.org/wiki/International_Bank_Account_Number#Validating_the_IBAN
Makes a basic GET request with iban
parameter
curl http://127.0.0.1:8080/?iban=DK5000400440116243
Response will be returned with application/json
content type:
{
"iban": "DK5000400440116243",
"valid": true
}
, where
iban
(string) - your IBANvalid
(bool) - valid or not
API returns 400 BadRequest
if no iban
parameter provided:
{
"error": "iban param required"
}
Build service binary
Run microservice locally
Run all tests
Generate new iban/validator/rules.go
file from SWIFT rules iban/assets/swift_iban.txt
Download new SWIFT rules file to iban/assets/swift_iban.txt
and generate iban/validator/rules.go