Options interface allows you to customize the behavior of the createSepaXML function. These options control XML formatting and validation rules.
Interface Definition
Controls whether the generated XML should be formatted with indentation and line breaks for human readability.
true- XML is formatted with 2-space indentationfalse- XML is generated as a single line (minified)
falseNote: Pretty-printed XML is easier to read but results in larger file sizes.Controls whether IBAN validation should be performed on all IBAN fields.
true- Validates IBANs using the IBANTools libraryfalse- Skips IBAN validation
trueWhen to disable: Use false for testing with dummy IBANs or when you’ve already validated IBANs in your application.Validation performed:- IBAN format check
- Check digit verification
- Country-specific format validation
Controls whether BIC (Bank Identifier Code) validation should be performed on all BIC fields.
true- Validates BICs using the IBANTools libraryfalse- Skips BIC validation
trueWhen to disable: Use false for testing with dummy BICs or when you’ve already validated BICs in your application.Validation performed:- BIC format check (8 or 11 characters)
- Structure validation
Usage
Default Options
If no options are provided, the function uses these defaults:Pretty-Printed XML
Disable Validation for Testing
Example: Testing with Invalid Data
Validation Errors
When validation is enabled, the library throws errors for invalid data:Invalid IBAN
Invalid BIC
Best Practices
Production Use
Production Use
Keep validation enabled (
checkIBAN: true, checkBIC: true) to catch errors early and ensure generated XML files are valid.Testing and Development
Testing and Development
Disable validation (
checkIBAN: false, checkBIC: false) when working with mock data or testing edge cases.File Size Optimization
File Size Optimization
Use
prettyPrint: false (default) for production to minimize file size. Only use prettyPrint: true when debugging or when human readability is required.Validation Performance
Validation Performance
If you’ve already validated IBANs and BICs in your application layer, you can safely disable checks to improve performance, especially when generating large batches of XML files.
Related
createSepaXML
Main function documentation
SepaData
Main data structure