Validate Account Number: United Kingdom
Country Name: United 
Kingdom
ISO Code: 
GB
Syntax:
validateAccount(string keycode, string field1,string field2,string field3,string field4,string countryId,string countrySpec)
  123556
  
  
     
   Field 
     Explanation 
     Format 
     Example  
     
   keycode 
     Your 
      Validate keycode 
      
      
     
   field1 
     Sort Code 
    6n 
      
       
 12-34-56
 12:34:56
 etc
     
   field2 
     Account number 
      8-10n 
     12345678 
     
   field3 
     Not 
      Used 
      
      
     
   field4 
     Not 
      Used 
      
      
     
   countryId 
     The ISO 
      Country Code 
     2a 
     GB 
      countrySpec 
     The 
      number of the sub branch  
     1-2n 
     1 
2) When you sort code and Account number as one variable the 14 digit UK electronic transmission format or Traditional representation can be used by
  i) 12345612345678
  
  
     
   Field 
     Explanation 
     Format 
     Example  
     
   keycode 
     Your 
      Validate keycode 
      
      
     
   field1 
     Account 
      Structure 
    14-16n 
      
       
 ii) 12-34-5612345678 
      
     
   field2 
     Not 
      Used 
    
     
     
   field3 
     Not 
      Used 
      
      
     
   field4 
     Not 
      Used 
      
      
     
   countryId 
     The ISO 
      Country Code 
     2a 
     GB 
      countrySpec 
     The number of the sub branch 
     1-2n 
     1 
Returned 
data 
An object paccnum containing the following fields:
| 
        Name  | 
    
       Type  | 
    
        Description  | 
| 
        field1  | 
    
       String  | 
    
        field 1 from the original request (or 
      transposed version if applicable)   | 
| 
        field2  | 
    
       String  | 
    
        field 2 from the original request (or 
      transposed version if applicable)  | 
| 
        field3  | 
    
       String  | 
    
        field 3 from the original request   | 
| 
        field4  | 
    
       String  | 
    
        field 4 from the original request   | 
| 
        validity  | 
    
       String  | 
    
        String ‘Valid’ if the account number is valid. 
       String ‘Invalid’ if the account numbers not valid.  | 
| 
       bic  | 
    
       String  | 
    
        The 
      full Bank Identification Code (BIC) of the account holding branch - if 
      available   | 
| 
        branchTitle  | 
    
       String  | 
    
        The 
      account holding branch title as defined by the bank   | 
| 
        institutionName  | 
    
       String  | 
    
        The 
      parent financial institution of the account holding branch   | 
| 
        city  | 
    
       String  | 
    
        The 
      city that the account holding branch is located   | 
| 
        address1  | 
    
       String  | 
    
        Address line 1 of the account holding branch 
        | 
| 
        address2  | 
    
       String  | 
    
        Address line 2 of the account holding 
      branch   | 
| 
        address3  | 
    
       String  | 
    
        Address line 3 of the account holding 
      branch   | 
| 
        address4  | 
    
       String  | 
    
        Address line 4 of the account holding 
      branch   | 
| 
        postcode  | 
    
       String  | 
    
        The 
      postcode/zipcode of the account holding branch   | 
| 
        country  | 
    
       String  | 
    
        The 
      country that the account holding branch is located   | 
| 
        tel1  | 
    
       String  | 
    
        Telephone number 1 of the account holding 
      branch   | 
| 
        tel2  | 
    
       String  | 
    
        Telephone number 2 of the account holding 
      branch - often but not always the fax number   | 
| 
       transposed  | 
    
       Bool  | 
    
        Flag to show 
      if the account number was transposed as part of the validation. If True 
      the account number was transposed.  Field1 and Field2 will hold the 
      transposed account details.  | 
| 
       accountCode  | 
    
       String  | 
    
       Default is 
      0  | 
| 
       numSubBranch  | 
    
       String  | 
    
       The Number of sub-branches associated with a 
      particular sort code.  | 
| 
       subBranchSuffix  | 
    
       String  | 
    
       The index 
      number of the current sub-branch  | 
| 
        errorCode  | 
    
       String  | 
    
        If 
      an error occurs during processing the error number will be here. See 
      the error section for more details.  | 
| 
        errorText  | 
    
       String  | 
    
        If 
      an error occurs during processing the error textually description will be 
      here. See the error section for more details.  | 
None Standard Account Numbers
Some electronic payment systems such as BACS and Faster Payments require an account number of exactly eight digits. They are strict about this rule and will fail any payment using account numbers that are not the correct length.
Validate automatically fixes 
these, so called, none standard account numbers using a technique known as 
transposition. Therefore you should submit standard and non-standard 
account numbers to Validate but used the returned transposed account numbers 
(and in some cases sort codes) for submission to e-Payment systems.
The transposition process uses the 
following rules.
6 Digit Account Numbers 
The account number is transposed into an 8 digit 
account number.
The Boolean field 'transposed' - 
returned in the paccnum object - is set True.
If the 
account number check returns valid, it is the transposed account number that 
should be used for e-Payment submissions.
The transposed 
account number is returned in the paccnum object in field2.
7 Digit Account Numbers 
The account number is transposed into an 8 digit account 
number.
The Boolean field 'transposed' - returned in the 
paccnum object - is set True.
If the account number 
check returns valid, it is the transposed account number that should be used for 
e-Payment submissions.
The transposed account number is 
returned in the paccnum object in field2.
9 Digit Account Numbers 
The account number is transposed into an 8 
digit account number. The sort code may also be modified.
The Boolean field 'transposed' - returned in the paccnum 
object - is set True.
If the account number check 
returns valid, it is the transposed account number AND sort code that should be 
used for e-Payment submissions.
The transposed soft code 
is returned in the paccnum object in field1.
The 
transposed account number is returned in the paccnum object in field2.
10 Digit Account Numbers 
The account number is transposed into an 8 
digit account number.
The Boolean field 'transposed' - 
returned in the paccnum object - is set True.
If the 
account number check returns valid, it is the transposed account number that 
should be used for e-Payment submissions.
The transposed 
account number is returned in the paccnum object in field2.
The account code is returned in the accountCode 
field of paccnum object. e-Payment system usually require this 
number if using a 10 digit account number. 
Supported Versions
Validate Web Service Version 1.x
Errors
| 1501 | Details could not be checked | 
| 1502 | Failed Modulus Check | 
| 1503 | Foreign currency account | 
| 1504 | An undetermined error prevented validation | 
| 1505 | Incorrect number of digits, should be n for cc account number | 
| 1506 | The account details cannot be checked. [because ….] | 
| 1507 | Input error. The supplied details are not in the correct format | 
| 1508 | The supplied sort code could not be found | 
Example Code
c# 
The 
following sample show how to use the validateAccount function using c#.
As with all examples, please see the section Adding a 
reference to the Validate Web Service . 
|  c# Example 1 
       validate.validate wsObject = new validate.validate();  | 
 c# Example 2  using System; {          
      validate.validate wsObject = new validate.validate();          
      Console.WriteLine(acObject.validity);
  
  
     
       
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
   class Program
   {
      static void 
      Main(string[] 
      args)
      {
         
      string 
      keycode = "qwerty";
         
      string sortCode = "074456";
         
      string accountNumber = 
      "12345112";
         
      string countryCode = "GB";
         
      string countrySpec = "";
         
      validate.paccnum acObject = 
      wsObject.validateAccount(keycode,sortCode,accountNumber,null,null,countryCode,countrySpec);
         
      Console.WriteLine(acObject.institutionName);
         
      Console.WriteLine(acObject.errorCode);
         
      Console.WriteLine(acObject.errorText);
         
      Console.ReadLine();
      }
   }
}
Visual Basic .net 
|  Visual Basic.net Example ` Dim wsobject As New validate.validate() Dim anObject As validate.paccnum anObject = wsobject.validateAccount("qwerty", "074456", "12345112", "", "", "GB")  | 
 Module 
      Module1 End
  
  
       Visual Basic.net Example 2 
       
   
      Sub Main()
      
      Dim keycode As 
      String = "qwerty"
      
      Dim sortCode As 
      String = "074456"
      
      Dim accountNumber As 
      String = "12345112"
      
      Dim countryCode As 
      String = "GB"
      Dim countrySpec As String = ""
            ' 
      Create a web service object
      
      Dim wsobject As 
      New validate.validate() 
            ' 
      create a account number object for the returning data
      Dim anObject As validate.paccnum 
            ' 
      Call the web service function - validateBic
      
      anObject = wsobject.validateAccount(keycode, sortCode, 
      accountNumber, "", 
      "", 
      countryCode,countrySpec)
            ' display the 
      validity and institution name - or error message
      
      Console.WriteLine(anObject.validity)
      
      Console.WriteLine(anObject.institutionName)
      
      Console.WriteLine(anObject.errorCode)
      
      Console.WriteLine(anObject.errorText)
      
      Console.ReadLine()
         End Sub
      
Java
The following sample show how to use the validateAccount 
function using Java.
 Java Example 
      1 public class Main {     public static void main(String[] args) 
      {         
      validate.Validate service = new validate.Validate();         
      java.lang.String keyCode = "qwerty" ;         
      validate.paccnum result = port.validateAccount(keyCode, accver1, accver2, 
      "", "", country, "");     }
  
  
     
       
        
      validate.ValidateSoap port = service.getValidateSoap12();
        
      java.lang.String accver1 = "074456" ;
        
      java.lang.String accver2 = "12345112" ;
        
      java.lang.String country = "GB" ;
        
      System.out.println( "Result = " 
      +result.getValidity());
        
      System.out.println( "Institution = " 
      +result.getInstitutionName());
        
      System.out.println( "Error Code = " 
      +result.getErrorCode());
        
      System.out.println( "Error Message = " 
      +result.getErrorText());
}
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:validateAccount>
      <tns:keyCode>qwerty</tns:keyCode>
      <tns:accver1>074456</tns:accver1>
      <tns:accver2>12345112</tns:accver2>
      <tns:accver3/>
      <tns:accver4/>
      <tns:country>GB</tns:country>
      <tns:countryspec/>
    
</tns:validateAccount>
  
</soap:Body>
</soap:Envelope>
Below is a typical XML message response
<?
xml version="1.0" encoding="utf-8"?>URL Encoding
Below is an example of using validateAccount via a URL encoded GET request
serviceUrl.asmx/accountnum2.aspx?keycode=qwerty&field1=074456&field2=1234511212&countryId=GB
  
     
    
 ![]()  | 
    
       ©Copyright 2023 Paygate Solutions Limited  |