validateIBAN
 
SOAP API > Validating Payments > IBAN >

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

 

  1. The format of the IBAN is checked. Each country using IBANs has a specific format. Validate initially examines the format of the IBAN to ensure it is formatted correctly. If the format is incorrect, Validate can pass back details via the error.message object. This can be useful for determining if an IBAN has been enter incorrectly.
  2. The 'check digits' within the IBAN are mathematically verified.
  3. The domestic account number and bank/branch information is validated. The domestic account number and bank/branch information is extracted from the IBAN. These details are then checked to ensure that the domestic account number is valid and that the bank and branch information resolves to a real bank / branch.

 


 

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 System;
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.validate wsObject = new validate.validate();
      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.

 Visual Basic.net Example 1

      Dim wsobject As New validate.validate()
      Dim ibanObject As validate.iban
      ibanObject = wsobject.validateIban("keycode", "ES9121000418450200051332")

 

Visual Basic.net Example 2

Module Module1
  Sub 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) {
 
    com.bemac.vtest.Validate service = new com.bemac.vtest.Validate();
    com.bemac.vtest.ValidateSoap port = service.getValidateSoap12();

    java.lang.String keyCode = "qwerty";
    java.lang.String iban = "GB23MIDL40411312345678";
 
    com.bemac.vtest.Iban result = port.validateIban(keyCode, iban);
    System.out.println("Result = "+result.getValidity());
    System.out.println(result.getErrorText());
    System.out.println(result.getErrorCode());       
   
  }
}


XML Messages

Below is a typical XML message request

<?xml version="1.0" encoding="utf-8"?>
<
soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://vtest.bemac.com/">
  <soap:Body>
    <tns:validateIban>
      <tns:keyCode>qwerty</tns:keyCode>
      <tns:iban>ES9121000418450200051332</tns:iban>
    </tns:validateIban>
  </soap:Body>
</
soap:Envelope>

 

Below is a typical XML message response

<?xml version="1.0" encoding="utf-8"?>
<
soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd
="http://www.w3.org/2001/XMLSchema">
  <soap:Body
>
    <validateIbanResponse xmlns
="http://vtest.bemac.com/">
      <validateIbanResult
>
        <validity>Valid</validity
>
        <bankid>2100</bankid
>
        <branchid>0418</branchid
>
        <bankname
/>
        <accountnum>0200051332</accountnum
>
        <checkdigit>45</checkdigit
>
        <bic
/>
        <bban>21000418450200051332</bban
>
        <country>Spain</country
>
        <tel1
/>
        <tel2
/>
        <countryspec1
/>
        <countryspec2
/>
      </validateIbanResult
>
    </validateIbanResponse
>
  </soap:Body
>
</soap:Envelope>



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