> ## 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.

# Builder

> iso8583sim.core.builder

`iso8583sim.core.builder`

## `ISO8583Builder`

```python theme={null}
ISO8583Builder(version: ISO8583Version = ISO8583Version.V1987)
```

Builder for creating ISO 8583 messages with network support

### `build()`

```python theme={null}
def build(message: ISO8583Message) -> str
```

Build raw ISO 8583 message string from message object

### `build_bytes()`

```python theme={null}
def build_bytes(message: ISO8583Message, wire_format: WireFormat | None = None) -> bytes
```

Build a message as bytes in a wire format (binary bitmap, BCD, EBCDIC...).

Defaults to ASCII with a binary bitmap. See iso8583sim.wire.WireFormat for the presets.

### `build_with_mac()`

```python theme={null}
def build_with_mac(
    message: ISO8583Message,
    key: str | bytes,
    algorithm: int = 3,
    padding: int = 1,
) -> str
```

Build a message and fill in its MAC (field 64, or 128 with a secondary bitmap).

Requires the security extra. See iso8583sim.security.sign\_message.

### `create_message()`

```python theme={null}
def create_message(mti: str, fields: dict[int, str]) -> ISO8583Message
```

Create an ISO8583Message object with validation

### `create_response()`

```python theme={null}
def create_response(
    request: ISO8583Message,
    response_fields: dict[int, str],
) -> ISO8583Message
```

Create a response message based on a request message

### `create_reversal()`

```python theme={null}
def create_reversal(
    original: ISO8583Message,
    additional_fields: dict[int, str] | None = None,
) -> ISO8583Message
```

Create a reversal message

### `create_network_management_message()`

```python theme={null}
def create_network_management_message(
    message_type: str,
    network: CardNetwork | None = None,
) -> ISO8583Message
```

Create a network management message

### `build_emv_data()`

```python theme={null}
def build_emv_data(emv_tags: dict[str, str]) -> str
```

Build EMV data field (field 55) from tags


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