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

# Network rules

> Network-specific field format rules.

`iso8583sim.core.network_rules`

Only rules that can be traced to a published description of the field are included, so a
valid message is never rejected by a guessed format. Sources:

* Field 22 (POS entry mode): the DE022 code reference aligned to the Mastercard Customer
  Interface Specification (Feb 2024) and Visa VisaNet Authorization-Only Online Messages
  (Oct 2023), [https://docs.tech.sofi.com/pro/reference/api-reference-de022-codes](https://docs.tech.sofi.com/pro/reference/api-reference-de022-codes)
* Mastercard field 48: the Mastercard Customer Interface Specification layout of DE 48,
  a transaction category code followed by subelements (ID n-2, length n-2, data).

## Functions

### `check_pos_entry_mode()`

```python theme={null}
def check_pos_entry_mode(value: str, network: CardNetwork) -> list[str]
```

Check field 22 against the codes the network defines.

### `check_mastercard_de48()`

```python theme={null}
def check_mastercard_de48(value: str) -> list[str]
```

Check Mastercard field 48: a transaction category code, then well-formed subelements.

### `check_network_fields()`

```python theme={null}
def check_network_fields(fields: dict[int, str], network: CardNetwork) -> list[str]
```

Apply the network's field rules to the fields that are present.


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