import { Callout } from "zudoku/ui/Callout";

# Dynamic Token Lengths

## Business Value

During automatic payment application, 365 business Banking breaks the purpose text of a bank transaction into individual **tokens** and compares them with the document references of open entries. Very short character sequences used to be discarded through a fixed lower bound, in order to filter noise out of the purpose text.

That fixed bound becomes a problem as soon as the actual document references are shorter – for example web shop order numbers such as `46006` with only five characters. Those documents were never found even though the number was unambiguously present in the purpose text, and had to be applied manually.

With **dynamic token lengths**, the permitted token length follows your real data instead of a fixed value.

## Feature Description

365 business Banking determines the permitted minimum and maximum token length automatically from the values that **actually exist** in your company:

1. The fields configured under **Payment Application Fields** in the **Payment Application Settings** are evaluated.
2. The values of those fields are read from the **open customer ledger entries** of the document types *Invoice* and *Credit Memo*.
3. The shortest and longest character sequence found there becomes the lower and upper bound for token extraction.

The purpose text of the payment reconciliation journal line – including the additional transaction information – is then split into tokens using exactly these bounds. Short document references are found, without diluting match quality through arbitrarily short random sequences.

The determined bounds are cached per session and refreshed whenever the entry index is rebuilt.

<Callout type="info" title="No setup required">
Dynamic token lengths are active automatically and are not set up separately. You influence them indirectly through the **Payment Application Fields**: the fields configured there determine which values are taken into account when the lengths are calculated.
</Callout>

<Callout type="note" title="Fallback values">
If no values can be determined – for example because there are no open customer ledger entries with populated payment application fields – the bounds **4 to 30 characters** apply.
</Callout>

For more information about automatic payment application, see [Bank Account Reconciliation](../../bank-reconciliation.mdx).
