View Source QRNBU.Types.IBAN (NBU payment QR v0.3.3)
Ukrainian IBAN (International Bank Account Number).
Format Specification
Ukrainian IBAN is exactly 29 characters:
- Positions 1-2: Country code "UA"
- Positions 3-4: Check digits (MOD-97 algorithm)
- Positions 5-29: Bank account number (25 digits)
Validation
- Must be exactly 29 characters
- Must start with "UA"
- Check digits must be valid (MOD-97)
- Only alphanumeric characters allowed
Examples
iex> QRNBU.Types.IBAN.new("UA303348510000026206114040874")
{:ok, %QRNBU.Types.IBAN{}}
iex> QRNBU.Types.IBAN.new("PL60102010260000042270201111")
{:error, "IBAN must start with 'UA' for Ukraine"}
iex> QRNBU.Types.IBAN.new("UA3033485100")
{:error, "IBAN must be exactly 29 characters for Ukraine"}References
- NBU Resolution No. 97, August 19, 2025
- ISO 13616:2020 IBAN standard
Summary
Types
@opaque t()
Functions
Creates a new IBAN with validation.
Returns {:ok, iban} if valid, {:error, reason} otherwise.
Extracts the string value from an IBAN.