> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tesouro.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Payment reference normalization

> Learn how Tesouro handles payment references.

<Note>This information applies to only to Open Banking (SEPA Credit) payments.</Note>

## Overview

The payment reference is an identifier used to identify a specific payment transaction. Tesouro [payment links](/finops/guides/payments/payment-links) use one of the following as the payment reference:

* invoice document number (if the payment link was created for a payable or receivable invoice),
* [`payment_reference`](/finops/reference/openapi/payment-links/post-payment-links#request.body.payment_reference) value (if the link was created for an external invoice or a one-off payment).

<br />

Most banks have rules for the format of payment reference. For example, the payment reference length is usually limited to **18 characters**, and most special characters are forbidden.

When passing Open Banking payment details to the payment processing provider, Tesouro normalizes the payment reference value to make it compatible with common bank requirements. Keep this in mind when reconciling payments.

Normalization works as follows:

* Leading and trailing spaces are removed.
* Characters other than `A-Z a-z 0-9 / -` and spaces are replaced with spaces.
* If the resulting string is longer than 18 characters:
  * Consecutive spaces are replaced with a single space.
  * The string is trimmed to 18 characters.

<Info>
  The payment reference value in Tesouro payment links remains unchanged. We only pass the modified
  value to the payment processing provider.
</Info>

## Examples

Payment references that do not require normalization:

```lines theme={null}
00123
PRJ123-INV-2024
BILL/2024/12/0045
Repair work 05/12
INV   12345
```

Examples of normalized payment references:

| Payment reference          | Normalized value         |
| -------------------------- | ------------------------ |
| `INV#12345`                | `INV 12345`              |
| `INV 12.05.2024`           | `INV 12 05 2024`         |
| `INV_C1-6189-28`           | `INV C1-6189-28`         |
| <code> INV   12345 </code> | <code>INV   12345</code> |
| `+++010/8068/17183+++`     | `010/8068/17183`         |
| `Repair work 12th May`     | `Repair work 12th M`     |
