You need to programmatically verify whether the IBAN “IT60X0542811101000000123456” is structurally valid before you accept a beneficiary or submit an international wire. By the end of this article, you’ll validate this IBAN via a single API call, interpret the response reliably, and plug it into your onboarding and payment flows with proper caching and error handling.
What you can validate about an IBAN without sending a payment
Before a transfer, you want to confirm that an IBAN is well-formed for its country and passes the ISO 13616 mod-97 checksum. Structural validation reduces typos and immediate rejections downstream. The BankDataStack IBAN endpoint checks:
- Country code and expected length per ISO 13616.
- Check digits (mod-97) to catch transcription errors.
- BBAN structure (country-specific alphanumeric pattern) where applicable.
This is fast, deterministic, and safe to perform during user entry. It does not move funds, and it does not require talking to the destination bank. For example, “IT60X0542811101000000123456” is an Italian IBAN: IT = Italy, 60 = check digits, and the remaining part is the BBAN.
Endpoint, authentication, and request format
Use the IBAN validation endpoint to confirm the structure and checksum of an IBAN:
- Method: POST
- URL: https://www.bankdatastack.com/api/v1/iban/validate
- Headers: X-API-Key for authentication; Content-Type: application/json
- Body: JSON with a single field “iban”
You can create an API key in minutes. See Register. Reference endpoint details in the Documentation.
Plan note: Starter is $49.99/month with a 7-day trial, which is enough to stand up validation in staging and begin production rollout.
Validate the target IBAN via cURL
The following request validates the specific IBAN in question. Copy and run as-is, replacing YOUR_API_KEY with your key:
curl -X POST "https://www.bankdatastack.com/api/v1/iban/validate" -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" -d '{"iban":"IT60X0542811101000000123456"}'
Official JSON response example and field guide
This is a representative successful response from the same call above:
{
"status": "success",
"data": {
"iban": "IT60X0542811101000000123456",
"valid": true,
"countryCode": "IT",
"checkDigits": "60",
"bban": "X0542811101000000123456"
}
}
How to interpret:
- status: “success” indicates the request was processed.
- data.iban: Echo of the input for correlation.
- data.valid: Boolean. true if checksum and structure pass.
- data.countryCode: Two-letter ISO country code parsed from the IBAN.
- data.checkDigits: The two-digit checksum from the IBAN.
- data.bban: The country-specific Basic Bank Account Number portion.
Typical usage: if data.valid is true, you can proceed to collect the beneficiary’s name and other details, and queue a payment. If false, prompt the user to recheck their entry before allowing submission.
Python example: validate and branch your flow
This Python snippet demonstrates how to call the endpoint, parse the response, and implement basic decisioning suitable for onboarding or payment initiation.
import json
import sys
import urllib.request
API_KEY = "YOUR_API_KEY"
URL = "https://www.bankdatastack.com/api/v1/iban/validate"
def validate_iban(iban: str) -> dict:
req = urllib.request.Request(
URL,
data=json.dumps({"iban": iban}).encode("utf-8"),
headers={
"X-API-Key": API_KEY,
"Content-Type": "application/json"
},
method="POST"
)
with urllib.request.urlopen(req) as resp:
body = resp.read().decode("utf-8")
return json.loads(body)
def ensure_iban_is_valid(iban: str) -> None:
result = validate_iban(iban)
status = result.get("status")
data = result.get("data", {})
if status != "success":
print("Upstream error; hold the form submission and retry later.")
sys.exit(1)
if data.get("valid") is True:
cc = data.get("countryCode")
bban = data.get("bban")
print(f"IBAN OK: {iban} (country={cc}, bban={bban})")
# Continue: attach to beneficiary record, enable 'Submit transfer'
else:
cd = data.get("checkDigits")
print(f"IBAN invalid (checkDigits={cd}) — ask user to recheck and re-enter.")
if __name__ == "__main__":
ensure_iban_is_valid("IT60X0542811101000000123456")
Additional JSON responses you should test against
Use a range of cases during development to confirm your form-handling and error messaging. Keep the same response fields; do not rely on any undocumented keys.
1) Invalid Italian IBAN (bad checksum)
{
"status": "success",
"data": {
"iban": "IT00X0542811101000000123456",
"valid": false,
"countryCode": "IT",
"checkDigits": "00",
"bban": "X0542811101000000123456"
}
}
Expected UX: block submission; suggest the user verifies the digits or copies the IBAN again from their bank statement.
2) Malformed Italian IBAN (wrong length)
{
"status": "success",
"data": {
"iban": "IT60X05428111010000001234",
"valid": false,
"countryCode": "IT",
"checkDigits": "60",
"bban": "X05428111010000001234"
}
}
Expected UX: show a length-specific hint. Italian IBANs are fixed-length; a missing or extra character should be caught in-line before submission.
3) Valid UK IBAN (fixture for cross-checks)
{
"status": "success",
"data": {
"iban": "GB82WEST12345698765432",
"valid": true,
"countryCode": "GB",
"checkDigits": "82",
"bban": "WEST12345698765432"
}
}
Use this to confirm your internationalization handling. Note that the USA does not use IBANs; U.S. domestic transfers rely on ABA routing numbers instead.
4) Italian IBAN with character typo inside BBAN
{
"status": "success",
"data": {
"iban": "IT60X0542811101000000123457",
"valid": false,
"countryCode": "IT",
"checkDigits": "60",
"bban": "X0542811101000000123457"
}
}
A single-character swap typically flips the checksum. Your UI should prevent continuation until the user corrects the value.
How to wire this into onboarding and payment flows
Place IBAN validation at the point of data entry, and re-validate immediately before queuing a payment. This ensures a stable IBAN through the entire lifecycle and catches accidental edits.
- During onboarding: call the endpoint when the field loses focus; if invalid, show inline errors and disable “Continue.” If valid, store the IBAN and parsed countryCode for downstream routing rules.
- Before execution: re-validate the IBAN from your database to guard against silent corruption or partial saves. If invalid, stop the job and flag the beneficiary record.
- Change management: if a user edits a beneficiary’s IBAN, require a fresh validation pass and logging for audit.
In all cases, log status, countryCode, and a normalized IBAN as returned by the API. Do not attempt to reformat into a spaced form for storage; render whitespace on the client only.
IBAN format and checksum essentials (Italy focus)
IBANs are uppercase alphanumeric. The first two letters are the country code (e.g., IT), followed by two check digits (00–99), then a country-specific BBAN. The checksum is computed with a mod-97 algorithm defined by ISO 13616, which detects most single-character and many transposition errors.
- Fixed length: each country has a fixed IBAN length; Italy’s IBAN length must match the Italian standard.
- Checksum: changing any character typically invalidates the mod-97 remainder.
- BBAN content: specific positions within the BBAN encode bank/branch references; structural rules vary by country.
For “IT60X0542811101000000123456”, the countryCode is IT, checkDigits are 60, and the rest is BBAN (“X0542811101000000123456”). Validation confirms this structure and checksum are coherent.
Caching the response safely
IBAN format rules are stable, so you can cache “valid: true/false” responses keyed by the exact IBAN string. Suggested approach:
- Key: the normalized IBAN value (uppercase, no spaces).
- Value: an object containing {valid, countryCode, checkDigits, bban, validatedAt}.
- TTL: 24–72 hours is reasonable in most flows to minimize latency and cost.
- Eviction: any edit by the user invalidates the cache entry immediately.
Since validation is deterministic, cache hits will remain accurate for the lifetime of the IBAN string. Avoid permanently storing negative results for more than a day; the user might have mistyped.
Handling “not found,” invalid, and transient errors
Interpretation tips for robust UX and ops handling:
- valid: false — The IBAN fails checksum and/or format. Treat as user error; prompt correction.
- valid: true — Structure and checksum pass. You can proceed with compliance checks and payment setup. Structural validity does not confirm account existence or balance.
- Transport or 5xx errors — Treat as transient; retry with exponential backoff. Keep the form disabled until a definitive response is obtained.
“Not found” in the context of structural validation generally means the format did not pass checks or is not a supported IBAN country code; in both cases, valid will be false in the data section. Reserve hard failure handling (e.g., page-level error) for network or authentication problems.
Comparing identifiers you might see in payments
If you are normalizing multi-region inputs, you will likely encounter multiple identifiers. Here is a quick comparison relevant to this workflow:
| Identifier | Region/Usage | Format | Validation Endpoint | Notes |
|---|---|---|---|---|
| IBAN | Europe and other IBAN countries | Country code (2) + check digits (2) + BBAN | /api/v1/iban/validate | USA does not use IBAN; validate checksum via API before wires |
| SWIFT/BIC | Global bank identification | 8 or 11 alphanumeric (e.g., CHASUS33) | /api/v1/swift/validate | Pairs with IBAN to route international transfers |
| Routing Number (ABA) | USA domestic ACH/wire | 9 digits with checksum (e.g., 021000021) | /api/v1/routing/validate | Used instead of IBAN in the USA |
| Card BIN | Card issuing identification | First 6+ digits of PAN (e.g., 424242) | /api/v1/bin/validate | Never store full PAN; use only BIN for issuer insights |
Test data you can rely on
BankDataStack provides fixtures suitable for development and demos. Keep these handy in unit tests and Postman collections:
- IBAN: GB82WEST12345698765432 (valid UK IBAN)
- SWIFT: CHASUS33
- Routing: 021000021
- BIN: 424242
While your target in this article is the Italian IBAN “IT60X0542811101000000123456,” the GB and U.S. fixtures help you validate branching logic where you accept multiple identifier types depending on the corridor.
Security, privacy, and PCI considerations
- IBANs are not payment cards; PCI scope differs. Treat IBANs as customer financial data and protect them with encryption at rest and in transit.
- Never store full card numbers. If you also process cards, persist only the BIN and a tokenized PAN from your PSP or vault.
- Restrict who can view raw IBANs in your back-office UI. Redact when not needed (e.g., show last 4–6 characters).
- Log only what you need for reconciliation: the IBAN string, validation result, and timestamp.
Putting it together: end-to-end flow outline
- User enters IBAN into a single-line text field (uppercase, strip spaces).
- On blur or submit, call POST /api/v1/iban/validate with the IBAN.
- If data.valid is true, persist the IBAN and countryCode, and enable “Continue.”
- If data.valid is false, show a corrective hint and disable progression.
- Cache the positive result with a 24–72 hour TTL to reduce repeat calls.
- Re-validate immediately prior to instruction submission to prevent stale data from being sent to your payment rail.
FAQ
Does a valid IBAN guarantee that the account exists?
No. Structural validity confirms format and checksum only. It does not verify account existence, name match, or funds availability.
How should I handle spaces, dashes, or lowercase in user input?
Normalize by removing spaces and dashes and converting to uppercase before sending to the API. Store the normalized value and format for display as needed.
Can I validate U.S. bank details with the same method?
The USA does not use IBAN. Use routing number validation instead. If your flow accepts both, branch by country selection and run the appropriate validator.
What should I log for audits?
Log the normalized IBAN, validation result (true/false), countryCode, and the timestamp. Avoid logging PII unrelated to the transfer.
How often should I re-validate stored IBANs?
Checksum rules do not change, so re-validation is cheap and deterministic. Validate on entry and again right before payment submission to catch accidental edits or data corruption.
Ready to validate “IT60X0542811101000000123456” and ship your IBAN checks to production? Create an API key and follow the examples above: Register. For more implementation details and additional identifier validators, see the Documentation.

