validateIban
Verifies that an IBAN is valid, decomposes the IBAN and returns useful information such as bank/branch information and BIC..
Syntax:
validateIban (string keycode , string iban )
Returned data
An object (iban) containing the following fields:
Name | Description |
validity | String
‘Valid’ if the IBAN is valid.
String ‘Invalid’ if the IBAN is not valid.
|
bankid | The Bank ID of the account holding branch. |
branchid | The branch ID of the of the account holding branch. (In the UK this is known as the sort code). |
branchname | The name of the branch of the of the account holding branch. |
bankname | The name of the bank of the of the account holding branch. |
accountnum | The domestic account number. |
checkdigit | The check digit of the domestic account (not the IBAN check digits). Note not all IBAN contain this field and it is country dependent. |
bic | The BIC of the account holding branch. |
bban | The domestic BBAN (Basic Bank Account Number). |
country | The country of the account holding branch. |
address1 | Address line 1 of the account holding branch. |
address2 | Address line 2 of the account holding branch. |
address3 | Address line 3 of the account holding branch. |
address4 | Address line 4 of the account holding branch. |
postcode | The zip or postcode of the account holding branch. |
tel1 | The primary telephone number of the account holding branch. |
tel2 | The secondary telephone number of the account holding branch. Often but not always the fax number. |
city | The city that the account holding branch is located. |
countryspec1 | Reserved |
countryspec2 | Reserved |
errorCode | If an error occurs during processing the error number will be here. See the error section for more details. |
errorText | If an error occurs during processing the error textually description will be here. See the error section for more details. |
BeMac Validate IBAN validation procedure
The IBAN validation procedure used in validateIBAN a three step process. The three steps happen automatically using a single validateIban command. An IBAN can fail overall IBAN validation at each step - the errorcode and errormessage strings contain information required to understand at which step the IBAN failed.
click to expand
Supported Versions
Validate Web Service Version 1.x
Errors
1400
Incorrect IBAN Check Digits
1401
Incorrect IBAN Format
1402
Caution - IBAN is correct but no bank or branch was
found.
1403
Incorrect IBAN Length
1404
Unknown Country with country ID: xx
1405
Domestic Account Number is
invalid
Example Code
c#
The following sample show how to use the validateIBAN function
using c#.
As with all
examples, please see the section Adding a reference to the Validate Web
Service .
c# Example 1
string keycode =
"qwerty";
string
bic = "GB23MIDL40411312345678";
validate.validate wsObject = new
validate.validate();
validate.iban ibanObject =
wsObject.validateIban(keyCode,
iban);
c# Example 2 using
validate.validate wsObject =
using System.Collections.Generic;
using
System.Text;
namespace validateIban
{
class
Program
{
static void Main(string[]
args)
{
// In this example the IBAN
(GB23MIDL40411312345678) is a valid IBAN
//
with a correct checksum - however the domestic account number
embedded
// in the IBAN is invalid and
so validate returns 'Invalid'.
string iban = "GB23MIDL40411312345678";
string keyCode = "qwerty";
validate.iban
ibanObject = wsObject.validateIban(keyCode, iban);
Console.WriteLine(ibanObject.validity);
Console.WriteLine(ibanObject.bankname);
Console.WriteLine(ibanObject.errorCode);
Console.WriteLine(ibanObject.errorText);
Console.ReadLine();
}
}
}
Visual Basic .net
The following sample show how to use the validateIBANfunction
using Visual Basic.net.
As
wlth all examaples, please see the section Adding a reference to the Validate Web
Service.
Dim wsobject
As New
validate.validate()
Visual Basic.net Example 1
Dim ibanObject As
validate.iban
ibanObject =
wsobject.validateIban("keycode", "ES9121000418450200051332")
Visual Basic.net Example 2 Module Module1Sub Main() ' define the keycode and iban to validate, both as strings. Dim keycode As String = "qwerty" Dim iban As String = "ES9121000418450200051332" ' Create a web service object Dim wsobject As New validate.validate() ' create a iban object for the returning data Dim ibanObject As validate.iban ' Call the web service function - validateIban ibanObject = wsobject.validateIban(keycode, iban) ' display the validity and institution address - or error message Console.WriteLine(ibanObject.validity) Console.WriteLine(ibanObject.address1) Console.WriteLine(ibanObject.city) Console.WriteLine(ibanObject.country) Console.WriteLine(ibanObject.errorCode) Console.WriteLine(ibanObject.errorText) Console.ReadLine() End Sub End Module |
Java
The following sample show how to use the
validateIBAN function using Java.
Java Example 1
public class Main { public static void main(String[] args)
{ java.lang.String keyCode = "qwerty"; |
XML Messages
Below is a typical XML message request
<?
xml version="1.0" encoding="utf-8"?>Below is a typical XML message response
<?
xml version="1.0" encoding="utf-8"?>
URL Encoding
Below is an example of using validateIban via a URL encoded GET request
serviceUrl.asmx/iban2.aspx?keycode=qwerty&iban=ES9121000418450200051332
![]() |
©Copyright 2023 Paygate Solutions Limited |