BAV (VOP) API

The BAV API checks whether a name matches the holder of a bank account before you send a payment. You send an account and the name you expect. The API asks the account holder's bank and tells you whether the name matches, nearly matches or does not match. For a near match it can also return the name the bank holds.

You can identify the account in two ways: by IBAN, or by a domestic bank code and account number for the United Kingdom and the United States.

What's new in version 4

  • Domestic mode. You can now verify UK and US accounts without an IBAN. Send country_code, bank_code (sort code or ABA routing number) and account instead of IBAN.
  • IBAN-mode requests and responses are unchanged from version 3. To upgrade, change /v3/ to /v4/ in the URL.

Endpoint

POSThttps://api.iban.com/clients/api/verify/v4/
  • Only POST is accepted. Any other method returns 405 METHOD_NOT_ALLOWED.
  • The body must be JSON, sent with Content-Type: application/json. Any other content type returns 415 UNSUPPORTED_FORMAT.
  • Send your API key in the X-API-Key header.
  • Responses are always JSON (application/json; charset=UTF-8).
  • Allow at least 180 seconds before timing out. The answer comes from the account holder's bank, and some banks are slow.
Keeping the key safe
  • Never put the key in a URL or query string. URLs end up in logs and browser history.
  • Call the API from your server, never from a browser or mobile app, where the key can be read.
  • Restrict the key to your server IP addresses in your account. Requests from other addresses then return 401 IP_NOT_ALLOWED.

Request

Headers
HeaderRequiredValueDescription
X-API-KeyYesstringYour API key. If it is missing you get 400 MISSING_API_KEY.
Content-TypeYesapplication/jsonA charset parameter (e.g. application/json; charset=utf-8) is allowed. Anything else returns 415.
Body

The body is a JSON object. Which fields you send decides the mode:

  • IBAN mode: send IBAN and name.
  • Domestic mode (GB, US): send country_code, bank_code, account and name, and leave IBAN out.

If IBAN is present and not empty, IBAN mode is used and country_code, bank_code and account are ignored. Field names are case-sensitive. Any other fields are ignored.

FieldRequiredValueDescription
IBANIBAN modestringThe account's IBAN. Spaces and punctuation are removed and letters are upper-cased, so de89 3704-0044 0532 0130 00 is accepted.
nameAlwaysstringThe name you expect the account to be held in: a person or a company, UTF-8.
country_codeDomestic modestringISO 3166 two-letter country code: GB or US. Letters are upper-cased and anything else is removed.
bank_codeDomestic modestringThe bank's national code. GB: 6-digit sort code. US: 9-digit ABA routing number. Spaces and dashes are removed, so 20-00-00 is accepted.
accountDomestic modestringThe account number. Spaces and punctuation are removed.

Supported countries

IBAN mode
AT  AustriaBE  BelgiumCY  Cyprus
DE  GermanyEE  EstoniaES  Spain
FI  FinlandFR  FranceGB  United Kingdom
GR  GreeceHR  CroatiaIE  Ireland
IT  ItalyLT  LithuaniaLU  Luxembourg
LV  LatviaMT  MaltaNL  Netherlands
PT  PortugalSI  SloveniaSK  Slovakia
Domestic mode
Countrybank_codeClearing system
GB United KingdomSort code (6 digits)UK Domestic Sort Code (GBDSC)
US United StatesABA routing number (9 digits)ABA / Fedwire (USABA)

Any other country returns 400 COUNTRY_NOT_SUPPORTED. For a UK account you can use either mode.

Example request

IBAN mode
curl "https://api.iban.com/clients/api/verify/v4/" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"IBAN":"DE89370400440532013000","name":"Max Mustermann"}' \
  --max-time 180
Domestic mode (UK sort code)

The code is the same as above with a different body. With curl:

curl "https://api.iban.com/clients/api/verify/v4/" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"country_code":"GB","bank_code":"20-00-00","account":"55779911","name":"Jane Smith"}' \
  --max-time 180

For a US account, send "country_code":"US" with the 9-digit ABA routing number as bank_code.

Response

A completed verification returns HTTP 200 with three members:

  • query: what was checked, after spaces and punctuation were removed.
  • result: the verdict.
  • error: a code explaining the verdict, or an empty string.

The query fields depend on the mode. The result fields are the same in both modes.

Match (IBAN mode)
{
   "query": {
      "IBAN": "DE89370400440532013000",
      "name": "Max Mustermann",
      "success": true
   },
   "result": {
      "valid": true,
      "name_match": "yes",
      "bic": "COBADEFFXXX",
      "suggested_name": ""
   },
   "error": ""
}
Match (domestic mode)
{
   "query": {
      "country_code": "GB",
      "bank_code": "200000",
      "account": "55779911",
      "name": "Jane Smith",
      "success": true
   },
   "result": {
      "valid": true,
      "name_match": "yes",
      "bic": "BARCGB22XXX",
      "suggested_name": ""
   },
   "error": ""
}
Response fields
FieldModeTypeDescription
query.IBANIBANstringThe IBAN that was checked, cleaned and upper-cased.
query.country_codeDomesticstringGB or US.
query.bank_codeDomesticstringThe sort code or routing number, digits only.
query.accountDomesticstringThe account number, cleaned.
query.nameBothstringThe name you sent. Non-ASCII characters come back escaped, e.g. Müller.
query.successBothbooleanAlways true on a 200.
result.validBothboolean or nulltrue: the bank accepted the account (the name may still not match exactly; check name_match). false: the bank rejected the account and name pair. null: no verdict.
result.name_matchBothstringyes, partial, no or unavailable.
result.bicBothstringThe bank's BIC, always 11 characters (8-character BICs get XXX added).
result.suggested_nameBothstringOn a partial match, the name the bank holds, if it shares it. Otherwise empty.
errorBothstringEmpty, or a code from Completed verifications.
Partial match

The name is close but not exact, e.g. a typo or a missing middle name. The bank may return the name it holds.

{
   "query": {
      "IBAN": "DE89370400440532013000",
      "name": "Max Musterman",
      "success": true
   },
   "result": {
      "valid": true,
      "name_match": "partial",
      "bic": "COBADEFFXXX",
      "suggested_name": "Max Mustermann"
   },
   "error": "NAME_PARTIAL_MATCH"
}
No match
{
   "query": {
      "IBAN": "DE89370400440532013000",
      "name": "John Doe",
      "success": true
   },
   "result": {
      "valid": false,
      "name_match": "no",
      "bic": "COBADEFFXXX",
      "suggested_name": ""
   },
   "error": "NAME_NOT_MATCH"
}
Name could not be checked

The bank answered but gave no name verdict.

{
   "query": {
      "IBAN": "DE89370400440532013000",
      "name": "Max Mustermann",
      "success": true
   },
   "result": {
      "valid": true,
      "name_match": "unavailable",
      "bic": "COBADEFFXXX",
      "suggested_name": ""
   },
   "error": ""
}
Refused request

When a request is refused, the body has only an error member, with no query or result:

{"error":"COUNTRY_NOT_SUPPORTED"}

Response codes

Refused requests

Checks run in the order below; you get the first one that fails.

HTTPCodeMeaningQuery usedWhat to do
405METHOD_NOT_ALLOWEDThe request was not POST.NoUse POST.
415UNSUPPORTED_FORMATContent-Type is missing or is not application/json.NoSet the header.
400MISSING_API_KEYNo X-API-Key header.NoAdd the header.
400INVALID_JSONThe body is empty or is not valid JSON.NoFix the body.
400MISSING_INPUT_IBANNeither IBAN nor country_code was sent.NoSend an IBAN, or the domestic fields.
400MISSING_INPUT_NAMEname is missing or empty.NoSend a name.
401INVALID_API_KEYThe key is not known.NoCheck the key in your account.
401IP_NOT_ALLOWEDThe key is restricted to other IP addresses.NoAdd your server's IP to the key's access list.
401USER_NOT_ALLOWEDThe BAV service is not active on your account.NoContact us to enable it.
401SUBSCRIPTION_EXPIREDYour BAV subscription has expired.NoRenew the subscription.
401NO_CREDITS_AVAILABLEYour query balance is used up.NoBuy more queries.
400COUNTRY_NOT_SUPPORTEDThe IBAN's country, or country_code in domestic mode, is not supported.NoDon't retry.
500INTERNAL_SERVER_ERROR:BNFDBSThe bank code (from the IBAN, or bank_code) was not found in our bank directory. This includes a missing bank_code in domestic mode.NoCheck the bank details. Don't retry unchanged.
400INVALID_IBAN_CHECKSUMIBAN mode only: the IBAN's check digits are wrong. The bank code is looked up first, so if the typo is in the bank code you get BNFDBS instead.YesAsk the payer to check the IBAN.
500INTERNAL_SERVER_ERROR:UNERSPThe request to the bank network failed or returned an unexpected answer.YesRetry later. A retry uses another query.
429—More than 20 requests per second.NoSlow down and retry.
500INTERNAL_SERVER_ERROR:…Any other server error.—Match on the INTERNAL_SERVER_ERROR prefix. Retry later.
Completed verifications

Every row below is HTTP 200 with query.success = true, and uses one query.

errorname_matchvalidMeaning
""yestrueThe name matches the account holder.
NAME_PARTIAL_MATCHpartialtrueClose match. The bank's name may be in suggested_name.
NAME_NOT_MATCHnofalseThe bank holds a different name.
""unavailabletrueThe bank answered without a name verdict.
""nofalseThe bank rejected the account for a reason other than the name, e.g. the account is closed or does not exist.
VERIFICATION_NOT_SUPPORTEDunavailablenullThe bank or account is not part of the verification scheme.
VOP_REQUEST_FAILEDunavailablenullThe bank did not give an answer.

Handling errors

You getWhat to do
400, 405, 415Fix the request. Retrying the same request gives the same answer.
401Fix the account or key issue named in error. Don't retry in a loop.
429Back off for a second and retry.
500 …:BNFDBSTreat it as bad bank details. Ask the payer to check them.
500 …:UNERSP or other 500Retry later with backoff. Remember that each UNERSP uses a query.
TimeoutMake sure you wait at least 180 seconds. If you time out first, the query may still have been used.

Reading the result

  • Decide using name_match, not valid on its own. valid: true also covers partial matches and answers with no name verdict.
  • yes: safe to pay as far as the name is concerned.
  • partial: show the payer the name the bank holds, if one is returned, and let them confirm or correct it.
  • no: warn the payer that the name does not match. If error is empty, the account itself was rejected.
  • unavailable or valid: null: the name was not verified. Tell the payer the check could not be completed.

Sandbox

POSThttps://sandbox.iban.com/clients/api/verify/v4/

The sandbox is free and uses no queries. Use the key testkey. These keys return the matching 401 refusals:

KeyReturns
nomorecredits401 NO_CREDITS_AVAILABLE
serviceexpired401 SUBSCRIPTION_EXPIRED
usernotallowed401 USER_NOT_ALLOWED
ipnotallowed401 IP_NOT_ALLOWED

Response times

  • Each verification waits for an answer from the account holder's bank, so response times depend on that bank. Most answers take from a fraction of a second to several seconds.
  • Refused requests return immediately, without contacting a bank.
  • Set your HTTP client timeout to at least 180 seconds to cover the occasional slow bank.

Checking your balance

The services endpoint returns every service on your account with its remaining queries and expiry date, the same information as My Services. Poll it from your monitoring to catch a low balance before the API starts answering 401 NO_CREDITS_AVAILABLE. It takes your api_key and a format (json or xml) and does not use a query.

GEThttps://api.iban.com/clients/api/v4/services/?api_key=YOUR_API_KEY&format=json
GEThttps://api.iban.com/clients/api/v4/services/?api_key=YOUR_API_KEY&format=xml

The response, shortened to the entry of this service (the endpoint lists every service on your account, one object each):

{
   "services": [
      {
         "service_name": "BAV (2,500 queries)",
         "credits": 52,
         "expiry_date": "2027-05-15",
         "service_expired": 0
      }
   ],
   "errors": []
}

The HTTP status is 200 in every case. With a wrong key, services is empty and errors carries code 301 ({"services":[],"errors":[{"code":"301","message":"API Key is invalid"}]}); without format the body is empty.

FieldTypeDescription
service_namestringName of the service as shown under My Services. The BAV entry carries the plan size in brackets: BAV (2,500 queries). Match on the prefix BAV.
creditsnumber or stringRemaining queries. Services without a quota return the string Unlimited instead of a number, so test the type before comparing.
expiry_datestringExpiry date of the service, YYYY-MM-DD. Requests after this date are refused as expired.
service_expired0 or 11 when the service has expired.

Rate limits and queries

  • Up to 20 requests per second per account. Requests over the limit get HTTP 429, are not processed and use no query.
  • Each completed verification (HTTP 200) uses one query, whatever the result.
  • INVALID_IBAN_CHECKSUM and INTERNAL_SERVER_ERROR:UNERSP also use one query. No other refusal uses one.
  • A dedicated API server with no per-second limit is available on request.

Glossary

TermMeaning
BAVBank Account Verification: checking that an account exists and belongs to the expected name.
VOPVerification of Payee: the EU scheme under which banks confirm the payee's name before a credit transfer.
IBANInternational Bank Account Number (ISO 13616).
BICBank Identifier Code, also called SWIFT code (ISO 9362). 8 or 11 characters; this API always returns 11.
Sort codeThe 6-digit UK code that identifies a bank branch.
ABA routing numberThe 9-digit US code that identifies a bank.
Clearing systemThe national payment system a domestic bank code belongs to (GBDSC for the UK, USABA for the US).
QueryOne unit of your BAV balance.