# IBAN (IbanGenerator)

The IBAN generator generates a valid International Bank Account Number (IBAN).

## Link object structure

The metadata object is populated from `IbanMetadata` object. It includes:

* `preserveCountryCode` - Whether to preserve the original country code in the generated value.
* `preserveBankCode` - Whether to preserve the original bank code in the generated value. Note that if you preserve the bank code, then you must preserve the country code.

If the original values are not IBANs, then do not enable these options.

Here is the basic structure of a link object for the IBAN generator.

{% code overflow="wrap" %}

```json
{
  "schema": "string",
  "table": "string",
  "column": "string",
  "path": "string",  //JSON fields only
  "dataType": "string",  //MongoDB, Amazon DynamoDB, and JSON fields only
  "metadata": {  
    "presetId": "string",
    "generatorId": "IbanGenerator",
    "encryptionProcessor": "x-on", //To use configured Structural data encryption
    "customValueProcessor": "string" //If custom value processor applied
    "preserveCountryCode": boolean,
    "preserveBankCode": boolean, // If true, then preserveCountryCode is automatically true
    "isConsistent": boolean
  }
}
```

{% endcode %}

## Example replacement

The following example generates IBAN values that preserve the bank code and country code from the original values. Consistency is not enabled.

{% code overflow="wrap" %}

```json
{
  "name": "acctno",
  "schema": "public",
  "table": "accounts",
  "links": [
    {
      "column": "acctno",
      "table": "accounts",
      "schema": "public",
      "metadata": {
        "presetId": "IbanGenerator",
        "generatorId": "IbanGenerator",
        "preserveCountryCode": true,
        "preserveBankCode": true,
        "isConsistent": false
      }
    }
  ]
}
```

{% endcode %}
