apyhub
Back
▣ DATA VALIDATION · FINANCE

Bank Code Validator API

What it does

Bank Code Validator checks a bank code and tells you whether it is valid. Send a value containing a SWIFT/BIC, IBAN, or IFSC code; you can also pass an optional country as an ISO 3166-1 alpha-2 code when you want to validate against a destination country.

The response includes the normalized input, a boolean valid flag, the detected identifier type, and the country_code when the code is valid. For valid codes, you also get the validator-specific fields for that code type, plus bank_details when available. That bank metadata may include the bank name, bic, lei, bank_code, branch, address, city, postal_code, and the lookup sources that filled each field.

Use Bank Code Validator when you need to validate payment instructions, reduce failed transfers, or confirm banking details before storing them in a payout or onboarding flow. If the input is invalid, the API returns an error object with a stable reason and a human-readable message, so you can handle bad formats, unsupported countries, or destination mismatches in your own workflow.

POST
Validate a bank code
https://api.eu.apyverse.com/pankajretestflows/bank-code-validator-api

QUICKSTART

GUIDE

Quickstart

Validate a bank code by sending the code value in the request body.

curl -X POST "https://api.eu.apyverse.com/pankajretestflows/bank-code-validator-api" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"value":"PK69 HABB 0018 9879 0042 9003"}'

What you'll get back

Returns a JSON object with a data field. On success, data is an object containing valid, input, identifier, country_code, bank_details, and source; on failure, data contains valid, input, identifier, and error.

{
  "data": {
    "valid": true,
    "input": "PK69HABB0018987900429003",
    "identifier": "IBAN",
    "country_code": "PK",
    "bank_details": {
      "name": "HABIB BANK LIMITED",
      "bic": "HABBPKKAXXX",
      "lei": "549300N63RJKPUYAY631",
      "bank_code": "0019",
      "branch": "MUMBAI MAIN",
      "address": "9th Floor, Habib Bank Tower, Jinnah Avenue, Blue Area Islamabad",
      "city": "Islamabad",
      "postal_code": "44000",
      "sources": ["swiftref", "gleif"],
      "city": "Islamabad"
    },
    "source": "apyhub"
  }
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
SWIFT/BIC (8 or 11 characters), IBAN or IFSC code. Spaces are ignored.
Optional ISO 3166-1 alpha-2 code of the payout destination (case-insensitive). When omitted, the country is taken from the code itself.

About this endpoint

What it does

Validates a bank code provided in the request body and returns whether it is valid, along with the detected code type and either bank details or an error object. The endpoint accepts SWIFT/BIC, IBAN, or IFSC input.

Request Body

ParameterTypeMandatoryDescription
valueStringYesSWIFT/BIC (8 or 11 characters), IBAN or IFSC code. Spaces are ignored.
countryStringNoOptional ISO 3166-1 alpha-2 code of the payout destination, case-insensitive. When omitted, the country is taken from the code itself.

Response

Returns a JSON object with a data field. On success, data is an object containing valid, input, identifier, country_code, bank_details, and source fields; on failure, data is an object containing valid, input, identifier, and error fields.

ParameterTypeMandatoryDescription
dataObjectYesSuccess response wrapper. Contains valid, input, identifier, country_code, bank_details, and source when the code is valid. On invalid responses, contains valid, input, identifier, and error.

Notes

data is a polymorphic object: when valid is true, read country_code, bank_details, and source; when valid is false, read error.code, error.reason, and error.message. The bank_details object is nullable, and any of its fields may be null when that lookup data is unavailable.

▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.