> For the complete documentation index, see [llms.txt](https://docs.tonic.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tonic.ai/app/api/quick-start-guide/tonic-api-generator-assignment/generator-api-reference/iban-ibangenerator.md).

# 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
    "replaceInvalidValues": boolean, // Whether to generate values for invalid source values.
    "fallbackCountryCode": "string", // When replaceInvalidValues is true, the country code to use in the generated values.
    "replaceNullValues": boolean, // When replaceInvalidValues is true, whether to also replace NULL values.
    "isConsistent": boolean
  }
}
```

{% endcode %}

## Example replacement

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

Invalid values are replaced with values that use the GB country code (for Great Britain), and NULL values are not replaced.

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,
        "replaceInvalidValues": true,
        "fallbackCountryCode": "GB",
        "replaceNullValues": false,
        "isConsistent": false
      }
    }
  ]
}
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.tonic.ai/app/api/quick-start-guide/tonic-api-generator-assignment/generator-api-reference/iban-ibangenerator.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
