0151 355 4555

IsValid

Description

Checks a sort code and bank account number for validity, and returns additional information about the bank branch in a BankAccountValidationResponse structure.

You can use Bank Account Validation in one of two ways

  • Without specifying the account number - If you pass in a blank bank account number we will return information about the bank branch and not attempt to validate the bank account number. This can be useful to help fill out information on a payments system.
  • Specifying the account number - If you pass in a bank account number we will apply any validation rules that are appropriate, and calculate the associated BIC and IBAN numbers for international payments.

The system performs checks on the sort code and a checksum calculation on the bank account number to ensure no typographical errors have been entered. It does not check with the bank that the bank account is live or has any type of balance.

The returned address for the bank can be controlled using the standard address formatting options.

View all Bank Account Validation (part of the Bank Validation suite) methods

Code Samples

<!-- Import the Integr8 Ajax API -->
<!-- NOTE: Get your own API key to use in the following script tag from: -->
<!-- http://www.data-8.co.uk/integr8/Admin/Ajax.aspx -->
<script src="https://webservices.data-8.co.uk/Javascript/Loader.ashx?key=your-api-key" type="text/javascript">
</script>

<script type="text/javascript">

function loadIntegr8() {
  // Load the BankAccountValidation Integr8 service
  data8.load('BankAccountValidation');
}

function IsValid(sortCode, bankAccountNumber) {
  /// <param name="sortCode">string</param>
  /// <param name="bankAccountNumber">string</param>
  var bankaccountvalidation = new data8.bankaccountvalidation();
  
  bankaccountvalidation.isvalid(
    sortCode,
    bankAccountNumber,
    null,
    showIsValidResult
  );
}

function showIsValidResult(result) {
  // Check that the call succeeded, and show the error message if there was a problem.
  if (!result.Status.Success) {
    alert('Error: ' + result.Status.ErrorMessage);
  }
  else {
    // TODO: Process method results here.
    // Results can be extracted from the following fields:
    // result.Valid
    //   Indicates if the incoming sort code and bank account number could be validated.
    // result.SortCode
    //   The sort code that has been validated.
    // result.AccountNumber
    //   The account number that has been validated.
    // result.BICCode
    //   The BIC code of the bank branch indicated by the sort code.
    // result.IBAN
    //   The IBAN code of the bank account indicated by the sort code and account number.
    // result.BranchName
    //   The name of the bank branch indicated by the sort code.
    // result.ShortBankName
    //   A short name for the bank indicated by the sort code.
    // result.FullBankName
    //   The full name for the bank indicated by the sort code.
    // result.Address
    //   The address of the bank branch indicated by the sort code.
    // result.AcceptsBACSPayments
    //   Indicates if the bank branch can accept payments made through the BACS system.
    // result.AcceptsDirectDebitTransactions
    //   Indicates if the bank branch can accept direct debit payments.
    // result.AcceptsDirectCreditTransactions
    //   Indicates if the bank branch can accept direct credit payments.
    // result.AcceptsUnpaidChequeClaimTransactions
    //   Indicates if the bank branch can accept claims for unpaid cheques.
    // result.AcceptsBuildingSocietyCreditTransactions
    //   Indicates if the bank branch can accept credits from building societies.
    // result.AcceptsDividendInterestPaymentTransactions
    //   Indicates if the bank branch can accept dividend interest payments.
    // result.AcceptsDirectDebitInstructionTransactions
    //   Indicates if the bank branch can accept direct debit instructions.
    // result.AcceptsCHAPSPayments
    //   Indicates if the bank branch can accept payments made through the CHAPS system.
    // result.AcceptsCheques
    //   Indicates if the bank branch can accept payments made by cheque.
    // result.AcceptsFasterPayments
    //   Indicates if the bank branch can accept payments made through the Faster Payments system.
  }
}

loadIntegr8();

</script>