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

# Convert

> Convert messages between ISO 8583 versions (1987, 1993, 2003).

`iso8583sim.core.convert`

## `ConversionResult`

```python theme={null}
ConversionResult(
    message: ISO8583Message,
    dropped: dict[int, str] = dict(),
    notes: list[str] = list(),
)
```

Outcome of a version conversion.

### `lossless`

True when every field was carried over.

## Functions

### `convert_mti()`

```python theme={null}
def convert_mti(mti: str, target: ISO8583Version) -> str
```

Rewrite the MTI's version digit for the target version.

### `convert_message()`

```python theme={null}
def convert_message(message: ISO8583Message, target: ISO8583Version) -> ConversionResult
```

Convert a message to another ISO 8583 version.

The MTI version digit is rewritten, original data elements move between field 90 and
field 56 where the versions differ, and every other field is checked against the
target version's definition. Fields that don't fit are dropped and reported rather
than truncated, because a shortened value would be silently wrong.

**Parameters**

<ResponseField name="message" type="ISO8583Message" required>
  Parsed message in its source version
</ResponseField>

<ResponseField name="target" type="ISO8583Version" required>
  Version to convert to
</ResponseField>

<ResponseField name="Returns" type="ConversionResult">
  ConversionResult with the converted message, dropped fields and notes
</ResponseField>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.