Compliance
BSN & IBAN Validator
BSN validatie API en IBAN check API voor Nederland — wiskundige validatie via elfproef en MOD-97. Geen externe calls, razendsnel.
GET /v1/compliance/validate-finance
Validates a Dutch BSN (Burger Service Nummer) or IBAN using pure mathematics. No external APIs are called — validation is instantaneous and runs entirely in-process.
Use this endpoint to:
- Pre-screen user input before submitting to government portals
- Reject obviously invalid numbers before storing them
- Comply with KYC/AML input validation requirements
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
type | "bsn" | "iban" | ✓ | The type of number to validate |
number | string | ✓ | The raw number (spaces, dashes, and country prefix accepted) |
Example request — BSN
curl -H "X-API-Key: YOUR_KEY" \
"https://api.omnizoek.nl/v1/compliance/validate-finance?type=bsn&number=111222333"Example response — BSN valid
{
"valid": true,
"type": "bsn",
"number": "111222333",
"algorithm": "elfproef",
"detail": "BSN passed the elfproef (11-check)"
}Example request — IBAN
curl -H "X-API-Key: YOUR_KEY" \
"https://api.omnizoek.nl/v1/compliance/validate-finance?type=iban&number=NL91+ABNA+0417+1643+00"Example response — IBAN valid
{
"valid": true,
"type": "iban",
"number": "NL91ABNA0417164300",
"algorithm": "mod97",
"detail": "IBAN passed MOD-97-10 check"
}Example response — invalid
{
"valid": false,
"type": "bsn",
"number": "123456789",
"algorithm": "elfproef",
"detail": "BSN failed the elfproef (expected remainder 0, got 7)"
}Response fields
| Field | Type | Description |
|---|---|---|
valid | boolean | true if the number passes its algorithm |
type | "bsn" | "iban" | The type as provided |
number | string | Normalised number (stripped of spaces/dashes) |
algorithm | string | The algorithm used: elfproef or mod97 |
detail | string | Human-readable explanation of the result |
How the algorithms work
BSN — elfproef (11-check)
The BSN uses a weighted sum with position weights 9 8 7 6 5 4 3 2 −1. Each digit is multiplied by its weight; the sum must be divisible by 11.
weights = [9, 8, 7, 6, 5, 4, 3, 2, -1]
sum(weights[i] * digit[i] for i in 0..8) % 11 == 0IBAN — MOD-97-10
- Move the four leading characters (country code + check digits) to the end
- Replace each letter with digits:
A=10,B=11, …Z=35 - Interpret the resulting string as an integer
- The number must satisfy $n \mod 97 = 1$
Error responses
| Status | Cause |
|---|---|
422 | type is not bsn or iban |
422 | number is empty or too long |
Caching
This endpoint does not cache — every request is computed on the fly (microseconds).