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

# I-file format

> Field-level reference for the I-file format, including transaction records, subrecords, summary records, and claim records.

> [!WARNING]
>
> The I-file is a legacy format and is not offered to new customers. For new integrations, use the [XML I-file](https://docs.fexco.com/dcc/developer-resources/file-formats/xml-i-file.md) instead.

The I-file is a fixed-length text format for transaction import, and this page
lists the fields of every record type it contains. Use it alongside the
[Build and submit an I-file](https://docs.fexco.com/dcc/guides/transaction-import/build-and-submit/i-file.md)
guide, which covers file structure, naming, submission, and the header and
trailer records (VOL1, UHL1, and UTL1).

> [!NOTE]
>
> The I-file uses ASCII or UTF-8 character encoding, with every field at an
> exact character position. Verify field positions using a code editor with
> column view, such as UltraEdit or GNU Emacs.

## Data type conventions

The following abbreviations appear in all field tables on this page. Each
table entry uses these conventions to specify how data must be formatted at
that character position.

| Abbreviation | Meaning |
| :- | :- |
| `N` | Numeric. Characters 0–9 only. |
| `A` | Alphabetic. Letters only. |
| `AN` | Alphanumeric. Characters 0–9, A–Z, and a–z, including spaces. |
| `BH` | Binary and hexadecimal. Left-justified, space-filled. All letters must be uppercase (A–F). |
| `R` | Right-justified. Pad with zeros for numeric fields or spaces for alpha and alphanumeric fields. |
| `L` | Left-justified. Applies to alpha and alphanumeric fields only. Pad with spaces or zeros on the right as specified. |
| Space fill | Fill the specified positions with blank spaces. |
| Zero fill | Fill the specified positions with zeros. |

## Transaction record

Each transaction record occupies a single line of 173 characters. The line
is split into two segments. Segment 1 (positions 1–90) holds card, merchant,
terminal, and transaction data. Segment 2 (positions 91–173) holds currency
conversion data.

Use code `J1` for a sale transaction and `J2` for a refund.

### Segment 1 fields (positions 1–90)

The following table lists all fields in Segment 1 of the transaction record.

| Position | Length | Type | Field | Description |
| :- | :- | :- | :- | :- |
| 1–3 | 3 | N | Card number prefix | Zero fill. |
| 4–13 | 10 | N | Bank Identification Number (BIN) | First 6 to 10 digits of the card number. Identifies the issuing bank and card currency. Left-justified, zero-filled. |
| 14–19 | 6 | N | Card number suffix | Zero fill. |
| 20–21 | 2 | AN | Transaction code | `J1` for a sale. `J2` for a refund. |
| 22–32 | 11 | AN | Terminal ID | Terminal or ATM identifier as defined by the acquirer. Right-justified, space-filled. |
| 33–36 | 4 | N | Reserved | Zero fill. |
| 37–47 | 11 | N | Base amount | Transaction amount in the merchant's pricing currency. Unsigned minor units as defined by [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html). Right-justified, zero-filled, no decimal point. For currencies with zero minor units (for example, JPY, KRW, CLP), right-pad with `00`. See [Currency precision codes](https://docs.fexco.com/dcc/developer-resources/codes/currency-precision.md) for the correct format per currency. |
| 48–53 | 6 | AN | Transaction date | Calendar date. Format: `bYYDDD` where `b` is a blank space, `YY` is the two-digit year, and `DDD` is the ordinal day of the year (Julian date). Mandatory. |
| 54–59 | 6 | N | Transaction time | Time of transaction on a 24-hour clock. Format: `HHMMSS`. Mandatory. |
| 60–67 | 8 | AN | Authorization code | Code returned from the authorization network. Right-justified, space-filled. Space-fill if not used. |
| 68–79 | 12 | AN | Originator's transaction reference | Reference allocated by the merchant. Populate with `PARTIAL APP` if the transaction was partially approved by the issuer (field 39 = `10`). Space-fill if not used. |
| 80 | 1 | AN | Switch card issue | First digit of a two-digit card issue number, or the only digit if the issue number is single-digit. Space-fill or zero-fill if not used. |
| 81 | 1 | AN | ATM/POS terminal type | Terminal capability code. One of: `1` (unspecified), `2` (ICC reader only), `3` (magnetic stripe only), `4` (ICC and magnetic stripe), `5` (no card reader), `A` (contactless only). Space-fill for e-commerce transactions. |
| 82 | 1 | AN | Switch card issue number | Second digit of a two-digit card issue number, or the only digit if the issue number is single-digit. Space-fill or zero-fill if not used. |
| 83 | 1 | AN | Customer instructions | Describes how the transaction was completed. Accepted values are listed in the table below. Space-fill if not applicable. |
| 84–90 | 7 | N | Record sequence number | Position of this record within the file. Zero-filled, right-justified. |

The following table lists the accepted values for the customer instructions
field at position 83.

| Value | Description |
| :- | :- |
| `1` | Signed voucher. |
| `2` | Mail or telephone order. |
| `3` | Continuous authority. |
| `4` | PIN verified offline. |
| `5` | Signed voucher, magnetic stripe captured. |
| `6` | Signed voucher, keyed at point of sale. |
| `7` | Unattended device without PIN verification. |
| `8` | PIN verified (card) transaction, recovered after sale. |
| `D` | Downgraded Integrated Circuit Card (ICC), track 2 data only. |
| `F` | IC card fallback to magnetic stripe read. |
| `G` | e-Commerce: secure transaction with cardholder certificate. |
| `H` | e-Commerce: non-authenticated security transaction with card acceptor certificate. |
| `J` | e-Commerce: non-authenticated security transaction without card acceptor certificate using channel encryption. |
| `L` | e-Commerce: non-authenticated security transaction with card acceptor certificate using channel encryption. |
| `M` | Full contactless EMV (Europay, Mastercard, Visa) transaction. |
| `N` | Contactless transaction with track 2 magnetic stripe format only. |
| `W` | Contactless online PIN transaction. |

> [!NOTE]
>
> An unsupported value in the customer instructions field causes transaction
> rejection code 11. See
> [Troubleshoot transaction import](https://docs.fexco.com/dcc/guides/transaction-import/troubleshoot.md)
> for the full list of rejection codes.

### Segment 2 fields (positions 91–173)

The following table lists all fields in Segment 2 of the transaction record,
which holds currency conversion data.

| Position | Length | Type | Field | Description |
| :- | :- | :- | :- | :- |
| 91–107 | 17 | AN | Statement narrative | Optional free-text field for fault finding and reporting. Space-fill if not used. |
| 108–115 | 8 | A | Reserved | Space fill. |
| 116–128 | 13 | AN | Exchange rate | Rate applied at the point of sale. Floating-point decimal, right-justified, zero-filled, padded to 13 characters. Set to `00000001.0000` for domestic (non-DCC) transactions. Examples: `00001.7532981`, `00000013.8329`. |
| 129 | 1 | AN | Reserved | Space fill. |
| 130 | 1 | N | Type of purchase transaction | Always `0`. |
| 131–137 | 7 | N | Reserved | Space fill. |
| 138–148 | 11 | N | Currency amount | Amount in the transaction currency. Unsigned minor units as defined by [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html). Right-justified, zero-filled, no decimal point. For currencies with zero minor units (for example, JPY, KRW, CLP), right-pad with `00`. For domestic transactions, this value matches the base amount. |
| 149–151 | 3 | AN | Not for use | Space fill. |
| 152–159 | 8 | AN | EPOS identifier 1 | Electronic point-of-sale (EPOS) device identifier within the merchant's EPOS population. Used for per-till hit rate reporting. Space-fill if not used. |
| 160–163 | 4 | N | Transaction currency code | [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) numeric currency code, zero-padded to 4 digits. For example, `0978` for EUR and `0840` for USD. See [Currency codes](https://docs.fexco.com/dcc/developer-resources/codes/currency.md) for a reference. |
| 164–167 | 4 | N | EPOS transaction number | Four-digit transaction sequence number within the merchant's EPOS system. Zero-fill if not used. |
| 168–171 | 4 | N | EPOS identifier 2 | Numeric EPOS device identifier for per-till reporting. Zero-fill if not used. |
| 172–173 | 2 | N | Additional data identifier | Zero fill. |

## Subrecord formats

Subrecords are optional supplemental lines that follow a transaction record.
Each subrecord is 90 characters long. The I-file supports three subrecord
types: multi-currency pricing (MCP), Integrated Circuit Card (ICC) addendum,
and authorization network reference data.

Only one subrecord of each type is permitted per transaction. A transaction
may have multiple subrecords of different types, each on its own line with
its own sequence number.

### MCP subrecord (code 07)

The MCP subrecord reports the Dynamic Currency Conversion (DCC) or
multi-currency pricing offered currency and the method used to detect it.

The following table describes the fields in the MCP subrecord.

| Position | Length | Type | Field | Description |
| :- | :- | :- | :- | :- |
| 1–4 | 4 | N | Subrecord counter | Number of this subrecord relative to its parent transaction. `0001` for the first subrecord, `0002` for the second. Zero-filled, right-justified. |
| 5–19 | 15 | AN | Reserved | Space fill. |
| 20–21 | 2 | N | Transaction code | Always `07`. |
| 22–25 | 4 | N | MCP offered currency | [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) numeric currency code offered to the cardholder, zero-padded to 4 digits. For example, `0978` for EUR. |
| 26 | 1 | AN | Final currency detection method | Method used to determine the offered currency. One of: `1` (not available), `2` (IP geolocation), `3` (browser language), `4` (dropdown list), `5` (user profile), `6` (cardholder billing address), `7` (DCC), `8` (cookie). Zero-fill if not used. |
| 27–29 | 3 | N | Country of residence | [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_numeric) numeric country code for the cardholder's country of permanent residence. Zero-filled, right-justified. |
| 30–40 | 11 | AN | Cashier ID | Identifier of the point-of-sale operator. Used for hit rate reporting by cashier. Optional. Space-filled, left-justified. |
| 41–83 | 43 | AN | Reserved | Space fill. |
| 84–90 | 7 | N | Record sequence number | Position of this record within the file. Zero-filled, right-justified. |

### ICC addendum subrecord (code 10)

The ICC addendum subrecord captures the application currency code read from
the card's integrated circuit (EMV tag 9F42) during a chip transaction.

The following table describes the fields in the ICC addendum subrecord.

| Position | Length | Type | Field | Description |
| :- | :- | :- | :- | :- |
| 1–4 | 4 | N | Subrecord counter | Number of this subrecord relative to its parent transaction. `0001` for the first subrecord, `0002` for the second. Zero-filled, left-justified. |
| 5–19 | 15 | AN | Reserved | Space-fill or zero-fill. |
| 20–21 | 2 | N | Transaction code | Always `10`. |
| 22–25 | 4 | N | Application currency code | Currency code stored on the card's integrated circuit, per EMV tag 9F42. ISO 4217 three-digit code, zero-padded to 4 digits. For example, `0978` for EUR and `0826` for GBP. |
| 26–83 | 58 | AN | Reserved | Space-fill or zero-fill. |
| 84–90 | 7 | N | Record sequence number | Position of this record within the file. Zero-filled, right-justified. |

### Authorization network reference data subrecord (code 26)

The authorization network reference data subrecord captures reference data
returned in the card scheme's authorization response.

The following table describes the fields in the authorization network
reference data subrecord.

| Position | Length | Type | Field | Description |
| :- | :- | :- | :- | :- |
| 1–4 | 4 | N | Subrecord counter | Number of this subrecord relative to its parent transaction. `0001` for the first subrecord, `0002` for the second. Zero-filled, left-justified. |
| 5–16 | 12 | AN | Reserved | Space-fill or zero-fill. |
| 17–19 | 3 | N | Authorization reference type | `001` for acquirer reference data. `002` for scheme reference data. Mandatory. |
| 20–21 | 2 | N | Transaction code | Always `26`. |
| 22–27 | 6 | N | Authorization network reference date | Date from the authorization network response. For Mastercard, populate with DE 16 (MMDD format). Mandatory. Space-filled, left-justified. |
| 28–83 | 56 | AN | Authorization network reference data | Reference data from the authorization response. For Mastercard, populate with DE 48 Subelement 63 (Trace ID). Mandatory. Space-filled, left-justified. |
| 84–90 | 7 | N | Record sequence number | Position of this record within the file. Zero-filled, right-justified. |

## Net summary record

A net summary record totals all transactions for a specific combination of
merchant, terminal, and currency during the reporting period. The record is
90 characters long.

Use code `E4` when the value of sales equals or exceeds the value of refunds.
Use code `E5` when the value of refunds exceeds the value of sales.

The following table describes the fields in the net summary record.

| Position | Length | Type | Field | Description |
| :- | :- | :- | :- | :- |
| 1–19 | 19 | N | Unused | Zero fill. |
| 20–21 | 2 | A | Transaction code | `E4` for a net sales summary. `E5` for a refund summary. |
| 22–32 | 11 | AN | Terminal ID | Same terminal identifier as the corresponding transaction records. Right-justified, space-filled. |
| 33–36 | 4 | N | Currency code | [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) numeric currency code, zero-padded to 4 digits. Identifies the currency of the transactions in this summary. |
| 37–47 | 11 | N | Net amount | Net base-currency equivalent of all transactions in this summary group. Unsigned minor units. Calculated as J1 (sales) total minus J2 (refunds) total. |
| 48–58 | 11 | N | Value of debit items | Total value of all J1 (sale) transactions in this group, in base currency. Right-justified. |
| 59–69 | 11 | N | Value of credit items | Total value of all J2 (refund) transactions in this group, in base currency. Right-justified. |
| 70–76 | 7 | N | Count of debit items | Total number of J1 (sale) transactions in this group. Right-justified. |
| 77–83 | 7 | N | Count of credit items | Total number of J2 (refund) transactions in this group. Right-justified. |
| 84–90 | 7 | N | Record sequence number | Position of this record within the file. Right-justified. |

## Net claim record

A net claim record totals all net summary records for a single merchant. One
claim record exists per merchant. The record is 90 characters long.

Use code `E8` when the merchant's total sales equal or exceed total refunds.
Use code `E7` when total refunds exceed total sales.

The format of the claim record depends on the length of the merchant ID. Do
not mix short and long merchant IDs in the same I-file. All merchant IDs in
a single file must use the same format.

### Short merchant IDs (11 characters or fewer)

The following table describes the net claim record format when merchant IDs
are 11 characters or fewer.

| Position | Length | Type | Field | Description |
| :- | :- | :- | :- | :- |
| 1–19 | 19 | N | Reserved | Zero fill. |
| 20–21 | 2 | A | Transaction code | `E8` for claim by merchant (sales equal or exceed refunds). `E7` for payment by merchant (refunds exceed sales). |
| 22–32 | 11 | AN | Merchant ID | Unique merchant identifier, also referred to as the Merchant Originator tag in Mercury (Fexco's merchant configuration system). Provided by Fexco. Right-justified, space-filled. |
| 33–36 | 4 | N | Reserved | Space fill. |
| 37–47 | 11 | N | Net amount | Net base-currency equivalent for the merchant in unsigned minor units. |
| 48–58 | 11 | N | Value of debit summaries | Total value of all E4 summary records for this merchant. Right-justified. |
| 59–69 | 11 | N | Value of credit summaries | Total value of all E5 summary records for this merchant. Right-justified. |
| 70–76 | 7 | N | Count of debit summaries | Total number of E4 summary records for this merchant. Right-justified. |
| 77–83 | 7 | N | Count of credit summaries | Total number of E5 summary records for this merchant. Right-justified. |
| 84–90 | 7 | N | Record sequence number | Position of this record within the file. Right-justified. |

### Long merchant IDs (12 to 16 characters)

The following table describes the net claim record format when merchant IDs
are 12 to 16 characters long.

| Position | Length | Type | Field | Description |
| :- | :- | :- | :- | :- |
| 1–3 | 3 | N | Reserved | Zero fill. |
| 4–19 | 16 | AN | Merchant ID | Unique merchant identifier. Right-justified. |
| 20–21 | 2 | A | Transaction code | `E8` for claim by merchant (sales equal or exceed refunds). `E7` for payment by merchant (refunds exceed sales). |
| 22–32 | 11 | N | Reserved | Zero fill. |
| 33–36 | 4 | A | Reserved | Space fill. |
| 37–47 | 11 | N | Net amount | Net base-currency equivalent for the merchant in unsigned minor units. |
| 48–58 | 11 | N | Value of debit summaries | Total value of all E4 summary records for this merchant. Right-justified. |
| 59–69 | 11 | N | Value of credit summaries | Total value of all E5 summary records for this merchant. Right-justified. |
| 70–76 | 7 | N | Count of debit summaries | Total number of E4 summary records for this merchant. Right-justified. |
| 77–83 | 7 | N | Count of credit summaries | Total number of E5 summary records for this merchant. Right-justified. |
| 84–90 | 7 | N | Record sequence number | Position of this record within the file. Right-justified. |

## Next steps

The following resources complement this format reference.

* [Build and submit an I-file](https://docs.fexco.com/dcc/guides/transaction-import/build-and-submit/i-file.md):
  step-by-step guide for building, encrypting, and submitting the
  I-file, including the header and trailer record formats.
* [Troubleshoot transaction import](https://docs.fexco.com/dcc/guides/transaction-import/troubleshoot.md):
  full tables of file rejection codes (R01–R15) and transaction
  rejection codes.
* [Currency precision codes](https://docs.fexco.com/dcc/developer-resources/codes/currency-precision.md):
  the correct minor unit format for each currency, needed for the
  base amount and currency amount fields.


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