# TRADACOMS INVFIL: The UK Invoice File Explained

> TRADACOMS INVFIL invoice files explained: INVFIL, INVOIC, VATTLR and INVTLR, ILD lines, STL VAT sub-totals, implied decimals, live examples and EANCOM INVOIC.

<QuickAnswer>
INVFIL is the TRADACOMS invoice file a UK supplier sends to its customer. It holds an INVFIL header with supplier, customer and file number, one INVOIC message per invoice with ILD lines and STL VAT sub-totals, a VATTLR message summarising VAT by rate for the whole file, and an INVTLR trailer with file totals. Its EANCOM equivalent is INVOIC.
</QuickAnswer>

The invoice file is the TRADACOMS document that gets you paid, and the one retailers check hardest. Every line, every VAT sub-total and every file total has to add up, and the numbers have no decimal points. A file that fails those checks is usually rejected rather than queried, and the invoice is not paid until a corrected file arrives.

This guide covers the four messages in an INVFIL, how the VAT arithmetic chains from line to file, and two live examples. For the EANCOM equivalent, see the [EDIFACT INVOIC guide](/guides/edi/edifact-invoic).

<EDIGuideCTA
  badge="For TRADACOMS INVFIL"
  transactionType="810"
  headline="Check an INVFIL before you send it"
  body="Paste a TRADACOMS invoice file into the free EDIFACT inspector to see each invoice, its VAT sub-totals and trailers, with MTR and END counts checked. OrderSync processes EDIFACT, EANCOM and TRADACOMS alongside X12, PDF, CSV and email, straight into your ERP."
  secondaryHref="/edifact-inspector"
  secondaryLabel="Try the free EDIFACT inspector"
/>

## What is a TRADACOMS INVFIL?

**INVFIL is the invoice file in TRADACOMS, the UK retail EDI standard maintained by the Article Numbering Association, now GS1 UK, until support ended in 2017.** The supplier sends it to the customer to bill for goods or services. One file can carry a single invoice or a whole day's invoicing to that customer.

Unlike the order file, the invoice file has **two** trailer messages. `VATTLR` summarises VAT by rate across every invoice in the file, and `INVTLR` gives the file totals. That structure reflects the standard's UK design: VAT is built into the file, rate by rate, at every level.

## INVFIL file structure

```
STX   Start of transmission (supplier to customer, APRF INVFIL)
│
├── MHD INVFIL   Invoice file header        once per file
│     TYP  SDT  CDT  FIL  (DNA  FDT  ACD)
│   MTR
│
├── MHD INVOIC   Invoice details            once per invoice, repeats
│     CLO  IRF  (PYT  DNA)
│     ODD                                   order and delivery reference
│       ILD  ILD ...                        one per invoice line
│     STL  STL ...                          one per VAT rate on this invoice
│     TLR                                   invoice totals
│   MTR
│
├── MHD VATTLR   VAT trailer                once per file
│     VRS  VRS ...                          one per VAT rate in the file
│   MTR
│
├── MHD INVTLR   Invoice file trailer       once per file
│     TOT                                   file totals and invoice count
│   MTR
│
END   End of transmission (number of messages)
```

The VATTLR and INVTLR come once, after all the invoices. A translator that writes a VATTLR after every INVOIC produces a file the customer's system does not expect; a Software AG community thread describes exactly that mistake.

## Example: one invoice, one VAT rate

Kestrel Valley Homeware invoices fictional retailer Harbour Lane Stores for the order it delivered to Harbour Lane's northern DC: 40 cases of chopping boards, 20 cases of mill sets and 10 cases of utensil sets, all standard-rated. Identifiers are made up, with valid GS1 check digits.

<EdifactSample
  title="INVFIL file with one invoice"
  description="Invoice file header, one INVOIC with three ILD lines and one STL sub-trailer at 20%, then the VATTLR and INVTLR trailers. Amounts use implied decimals."
  label="TRADACOMS"
  raw="STX=ANA:1+5098765000002:KESTREL VALLEY HOMEWARE+5012345000008:HARBOUR LANE STORES LTD+261016:170500+KV0000318+PASSW+INVFIL+B'
MHD=1+INVFIL:9'
TYP=0700+INVOICES'
SDT=5098765000002:000041207+KESTREL VALLEY HOMEWARE LTD++987654321'
CDT=5012345000008+HARBOUR LANE STORES LTD'
FIL=1207+1+261016'
MTR=6'
MHD=2+INVOIC:9'
CLO=5012345000107:00212+HARBOUR LANE NORTHERN DC'
IRF=KV-INV-20931+261016+261016'
ODD=1+HL-PO-88340::261012+KV-DN-55120:261015'
ILD=1+1+5098765100016:KV-1001+++6+40+90000+3600000+S+20000+++BAMBOO CHOPPING BOARD:LARGE'
ILD=1+2+5098765100023:KV-1002+++4+20+142000+2840000+S+20000+++SALT AND PEPPER MILL SET'
ILD=1+3+5098765100030:KV-1003+++12+10+66000+660000+S+20000+++BAMBOO UTENSIL SET'
STL=1+S+20000+3+71000+++++71000++71000+14200+85200+85200'
TLR=1+71000+++++71000++71000+14200+85200+85200'
MTR=10'
MHD=3+VATTLR:9'
VRS=1+S+20000+71000+71000+14200+85200+85200'
MTR=3'
MHD=4+INVTLR:9'
TOT=71000+71000+14200+85200+85200+1'
MTR=3'
END=4'"
/>

| Segment | What it says |
|---|---|
| `STX=...+INVFIL+B'` | Supplier to customer; application reference `INVFIL` |
| `MHD=1+INVFIL:9'` | Message 1 is the invoice file header, version 9 |
| `TYP=0700+INVOICES'` | Transaction code 0700: invoices only |
| `SDT=...++987654321'` | Supplier GLN, supplier number at the retailer, name, (no address), VAT registration number |
| `FIL=1207+1+261016'` | File generation number 1207, version 1, created 16 October 2026 |
| `CLO=5012345000107:00212+...` | The delivery location being invoiced |
| `IRF=KV-INV-20931+261016+261016'` | Invoice number, invoice date and tax point date |
| `ODD=1+HL-PO-88340::261012+KV-DN-55120:261015'` | The retailer's order number and date, and your delivery note number and date |
| `ILD=1+1+...` | Invoice line 1 under order and delivery reference 1 (broken down below) |
| `STL=1+S+20000+3+71000...` | VAT sub-trailer: standard rate, 20%, 3 lines, £710.00 net, £142.00 VAT, £852.00 payable |
| `TLR=1+71000...` | Invoice totals across one STL |
| `MTR=10'` | Ten segments in the INVOIC message |
| `VRS=1+S+20000+...` | VAT rate summary for the whole file |
| `TOT=71000+71000+14200+85200+85200+1'` | File totals: net, net after discount, VAT, payable before and after discount, and 1 invoice |
| `END=4'` | Four messages |

## Implied decimals: reading the numbers

Nothing in an INVFIL has a decimal point. Each numeric field has a fixed number of implied decimal places set by the specification. The John Lewis Partnership publishes the formats it uses, and they match how the example above is written:

| Field | Format in the JLP spec | Example value | Means |
|---|---|---|---|
| `AUCT` unit cost price | `n10.4` | `90000` | £9.0000 |
| `LEXC` extended line cost | `n10.4` | `3600000` | £360.0000 |
| `VATP` VAT percentage | `n3.3` | `20000` | 20.000% |
| `LVLA`, `VATA` and other STL, TLR, VRS and TOT amounts | `n10.2` | `71000` | £710.00 |

Line values carry four decimal places and totals two, so the move from `LEXC` to `LVLA` is where you round. Sum the line values first, then round the sub-total; rounding each line separately can leave the STL a penny out. Confirm the formats in your own partner's specification before you build.

## Segment reference

Version 9 layouts. "M" is mandatory and "O" optional in the standard. The EANCOM column gives the closest equivalent in [EDIFACT INVOIC](/guides/edi/edifact-invoic).

### INVFIL: invoice file header

| Segment | Name | Status | What it carries | EANCOM equivalent |
|---|---|---|---|---|
| `MHD` | Message header | M | Message number and `INVFIL:version` | `UNH` |
| `TYP` | Transaction type | M | 0700 invoices, 0701 self-billed, 0709 copy invoices and others | `BGM+380` and function |
| `SDT` | Supplier details | M | Supplier GLN and code, name, address, VAT number | `NAD+SU` with `RFF+VA` |
| `CDT` | Customer details | M | Customer GLN, name, address, VAT number | `NAD+BY` / `NAD+IV` |
| `DNA` | Data narrative | O | File-level notes and registered codes | `FTX` |
| `FIL` | File details | M | File generation number, version and date | No direct equivalent |
| `FDT` | File period dates | O | Invoice and delivery period end dates | `DTM` period |
| `ACD` | Audit control details | O | Location of the system that generated the file | None |
| `MTR` | Message trailer | M | Segment count | `UNT` |

### INVOIC: one per invoice

| Segment | Name | Status | What it carries | EANCOM equivalent |
|---|---|---|---|---|
| `CLO` | Customer's location | M | Delivery or invoiced location: GLN and codes | `NAD+DP` |
| `IRF` | Invoice references | M | Invoice number, invoice date, tax point date | `BGM` number, `DTM+137`, `DTM+131` |
| `PYT` | Settlement terms | O | Settlement discount terms | `PAT` |
| `DNA` | Data narrative | O | Invoice-level notes | `FTX` |
| `ODD` | Order and delivery references | M, repeats | Customer order number and date, delivery note number and date, proof of delivery | `RFF+ON`, `RFF+DQ` |
| `ILD` | Invoice line details | M, repeats | Product, pack, quantity, unit cost, line cost, VAT category and rate | `LIN`, `QTY+47`, `PRI+AAA`, `MOA+203`, `TAX+7` |
| `CIA` | Complex invoice line adjustments | O | Line-level allowances and charges | `ALC` at line level |
| `DNC` | Narrative details | O | Line-level notes | `FTX` at line level |
| `STL` | VAT rate invoice sub-trailer | M, one per rate | Lines, net value, discounts, surcharges, VAT and payable for one VAT rate | Summary `TAX+7` with `MOA+125` and `MOA+124` |
| `TLR` | Invoice trailer | M | Totals across all STL segments | `MOA+79`, `MOA+125`, `MOA+176`, `MOA+86` |

### VATTLR and INVTLR: file trailers

| Message | Segment | What it carries | EANCOM equivalent |
|---|---|---|---|
| `VATTLR` | `VRS` VAT rate summary, one per rate | Net, VAT and payable totals for one VAT rate across every invoice in the file | None; each EANCOM invoice stands alone |
| `INVTLR` | `TOT` file totals | Net, VAT and payable totals for the file, and the number of invoices | None |

## Reading the ILD invoice line

| Position | Field | In `ILD=1+1+5098765100016:KV-1001+++6+40+90000+3600000+S+20000+++BAMBOO CHOPPING BOARD:LARGE'` |
|---|---|---|
| 1 | `SEQA` links the line to its `ODD` order and delivery reference | `1` |
| 2 | `SEQB` line number within that reference | `1` |
| 3 | `SPRO` GTIN of the traded unit, supplier's code, DUN-14 | `5098765100016:KV-1001` |
| 4 | `SACU` consumer unit EAN | empty |
| 5 | `CPRO` customer's own-brand EAN and item code | empty |
| 6 | `UNOR` consumer units per traded unit | `6` |
| 7 | `QTYI` traded units invoiced | `40` |
| 8 | `AUCT` unit cost after line discount, before VAT | `90000` (£9.00) |
| 9 | `LEXC` extended line cost, `AUCT` x `QTYI` | `3600000` (£360.00) |
| 10 | `VATC` VAT category | `S` |
| 11 | `VATP` VAT rate | `20000` (20%) |
| 12 to 13 | `MIXI` mixed VAT indicator, `CRLI` credit line indicator | empty |
| 14 | `TDES` description | `BAMBOO CHOPPING BOARD:LARGE` |

Further optional positions carry recommended and marked retail prices, unit cost before discount (`BUCT`), discount value and percentage, and the VAT type of supply. The common VAT category codes are `S` standard, `Z` zero, `L` lower (reduced) rate, `X` exempt and `A` mixed-rate item.

## How the VAT arithmetic chains together

The totals in an INVFIL are layered, and each layer must equal the sum of the one below:

1. **ILD:** `LEXC` = `AUCT` x `QTYI` for each line.
2. **STL, one per VAT rate per invoice:** `LVLA` is the sum of `LEXC` at that rate. `EVLA` = `LVLA` less quantity and value discounts plus surcharges. `ASDA` = `EVLA` less settlement discount. `VATA` is the VAT. `APSE` = `EVLA` + `VATA` and `APSI` = `ASDA` + `VATA`.
3. **TLR, one per invoice:** each total is the sum of the matching STL field, and `NSTL` counts the STLs.
4. **VRS, one per VAT rate per file:** sums of the STL values at that rate across every invoice.
5. **TOT, one per file:** sums of the VRS values, plus `FTNI`, the number of invoices.

A retailer's system re-adds every layer. If your ERP calculates VAT per line and the retailer's per rate, the totals can disagree by a penny, and a penny is enough to fail the file.

## Example: two invoices, two VAT rates

Two store invoices in one file. The Leeds invoice is all standard-rated. The York invoice adds a recipe book, which is zero-rated under UK VAT, so it has two `STL` segments. The `VATTLR` then carries one `VRS` per rate across both invoices, and `TOT` adds them up.

<EdifactSample
  title="INVFIL file with two invoices and a VAT summary"
  description="Two INVOIC messages, one with standard and zero-rated lines. VATTLR summarises each VAT rate across the file and INVTLR counts two invoices."
  label="TRADACOMS"
  raw="STX=ANA:1+5098765000002:KESTREL VALLEY HOMEWARE+5012345000008:HARBOUR LANE STORES LTD+261017:170500+KV0000319+PASSW+INVFIL+B'
MHD=1+INVFIL:9'
TYP=0700+INVOICES'
SDT=5098765000002:000041207+KESTREL VALLEY HOMEWARE LTD++987654321'
CDT=5012345000008+HARBOUR LANE STORES LTD'
FIL=1208+1+261017'
MTR=6'
MHD=2+INVOIC:9'
CLO=5012345000114:0114+HARBOUR LANE LEEDS'
IRF=KV-INV-20932+261017+261017'
ODD=1+HL-PO-88341::261012+KV-DN-55121:261014'
ILD=1+1+5098765100016:KV-1001+++6+4+90000+360000+S+20000+++BAMBOO CHOPPING BOARD:LARGE'
ILD=1+2+5098765100047:KV-1004+++10+3+38000+114000+S+20000+++LINEN TEA TOWEL TWIN PACK'
STL=1+S+20000+2+4740+++++4740++4740+948+5688+5688'
TLR=1+4740+++++4740++4740+948+5688+5688'
MTR=9'
MHD=3+INVOIC:9'
CLO=5012345000121:0121+HARBOUR LANE YORK'
IRF=KV-INV-20933+261017+261017'
ODD=1+HL-PO-88350::261013+KV-DN-55122:261015'
ILD=1+1+5098765100016:KV-1001+++6+2+90000+180000+S+20000+++BAMBOO CHOPPING BOARD:LARGE'
ILD=1+2+5098765100054:KV-2001+++1+6+45000+270000+Z+0+++KESTREL KITCHEN RECIPE BOOK'
STL=1+S+20000+1+1800+++++1800++1800+360+2160+2160'
STL=2+Z+0+1+2700+++++2700++2700+0+2700+2700'
TLR=2+4500+++++4500++4500+360+4860+4860'
MTR=10'
MHD=4+VATTLR:9'
VRS=1+S+20000+6540+6540+1308+7848+7848'
VRS=2+Z+0+2700+2700+0+2700+2700'
MTR=4'
MHD=5+INVTLR:9'
TOT=9240+9240+1308+10548+10548+2'
MTR=3'
END=5'"
/>

Check the chain: Leeds pays £56.88 and York £48.60, so the file total payable is £105.48 (`10548`). The standard-rate `VRS` adds the two standard-rate STLs (£47.40 + £18.00 = £65.40 net, £13.08 VAT), and the zero-rate `VRS` carries the book alone.

## Settlement discount, surcharges and reconciliation

- **Settlement discount.** If you offer a prompt payment discount, show it in `PYT` and carry the discount in each STL's `SEDA`. `ASDA` and `APSI` then show the after-discount values, and `TLR` and `TOT` repeat both sets of totals.
- **Carriage and other surcharges.** These go in the STL `SURA` field for the VAT rate they attract, and roll up into `EVLA`. The JLP spec, for instance, lists registered codes in `DNA` for carriage and miscellaneous charges.
- **The RSGRSG reconciliation message.** Some partners want an extra message at the end of the transmission, `RSGRSG`, which repeats the sender's transmission reference and the receiver's code so the file can be reconciled. The JLP invoice specification asks for it, and changes the `STX` syntax identifier from `ANA` to `ANAA` when it is sent.
- **Test and live references.** JLP also uses the `STX` application reference to separate test files (`INVTES`) from live ones (`INVFIL`). Ask your partner whether they do the same before you go live.

## INVFIL to EANCOM INVOIC

| Business data | TRADACOMS invoice file | EANCOM INVOIC |
|---|---|---|
| Document type | `TYP=0700` | `BGM+380` |
| Invoice number and date | `IRF` | `BGM` and `DTM+137` |
| Tax point date | `IRF` third element | `DTM+131` |
| Order and delivery note | `ODD` | `RFF+ON` and `RFF+DQ` |
| Supplier VAT number | `SDT` | `NAD+SU` with `RFF+VA` |
| Line quantity | `ILD` `QTYI` | `QTY+47` |
| Unit price | `ILD` `AUCT`, implied decimals | `PRI+AAA`, explicit decimal |
| Line amount | `ILD` `LEXC` | `MOA+203` |
| Line VAT rate | `ILD` `VATC`, `VATP` | `TAX+7+VAT+++:::20+S` |
| VAT per rate | `STL` | Summary `TAX` with `MOA+125` and `MOA+124` |
| Invoice totals | `TLR` | `MOA+79`, `MOA+125`, `MOA+176`, `MOA+86` |
| File VAT summary and totals | `VATTLR`, `INVTLR` | None; each invoice is self-contained |

The X12 counterpart is the [810 invoice](/guides/edi/810-invoice). Credit notes do not go in an INVFIL: TRADACOMS has a separate [credit note file, CREHDR](/guides/edi/tradacoms-crehdr).

## Which UK retailers take INVFIL

- **Waitrose** and the wider John Lewis Partnership take TRADACOMS INVFIL invoices, and publish the field-level specification on the JLP supplier site. See the [Waitrose page](/edi-compliance/waitrose).
- **Ocado** takes INVFIL invoices but does not accept credit or debit notes by EDI, per ecosio. See the [Ocado page](/edi-compliance/ocado).
- **Co-op** requires invoices by EDI in TRADACOMS version 9, or through its SNC portal, and warns that late invoices can be paid late. See the [Co-op page](/edi-compliance/co-op).
- **Asda** trades invoices and credit notes in TRADACOMS, per ecosio. See the [Asda page](/edi-compliance/asda).
- **Boots** trades invoices in TRADACOMS, per Cegedim. See the [Boots page](/edi-compliance/boots).

## Common INVFIL errors

1. **A VATTLR after every invoice.** VATTLR and INVTLR appear once per file, after the last INVOIC.
2. **Rounding per line instead of per rate.** Sum `LEXC` values, then round the STL. Recalculate VAT from the STL net, not by adding line VAT.
3. **STL count wrong.** `TLR` `NSTL` must equal the number of STL segments in that invoice, and each STL `NRIL` the number of ILD lines at that rate.
4. **MTR and END counts.** `MTR` counts every segment from `MHD` to `MTR` inclusive. `END` counts every message, including the INVFIL header and both trailers, so one invoice gives `END=4`.
5. **File generation number out of sequence.** `FIL` generation numbers run in sequence per file type and trading partner. The JLP specification states that files out of sequence are rejected, so never reuse or skip one, and send a corrected file with the next number unless your partner says otherwise.
6. **Invoicing ordered quantities.** Invoice what was delivered and accepted. If the retailer sent a [delivery confirmation (DLCHDR)](/guides/edi/tradacoms-dlchdr) showing a shortage, invoice the received quantity or expect a debit.

## How OrderSync handles INVFIL

OrderSync builds INVFIL files from the orders and deliveries already in your system, with VAT calculated per rate the way TRADACOMS expects, so the STL, TLR, VRS and TOT layers agree before the file leaves. The same order can be invoiced as TRADACOMS, EANCOM, X12 or PDF depending on the customer.

## Frequently Asked Questions

### What is INVFIL in EDI?

INVFIL is the TRADACOMS invoice file used in UK retail. Strictly it is the name of the file header message, but the whole invoice file is usually called INVFIL. It contains the header, one INVOIC message per invoice, a VATTLR VAT summary and an INVTLR file trailer.

### What is the difference between INVFIL and INVOIC?

INVFIL is the header message sent once per file with the supplier and customer details. INVOIC is the detail message sent once per invoice. The EDIFACT standard also has a message called INVOIC, but it is a different format with different segments.

### What do VATTLR and INVTLR do?

VATTLR summarises VAT for the whole file, with one VRS segment per VAT rate. INVTLR closes the file with a TOT segment holding the file totals and the number of invoices. The customer's system checks both against the invoices before accepting the file.

### Can a TRADACOMS invoice file contain credit notes?

Not in the standard layout. Credit notes go in a separate credit note file with a CREHDR header, CREDIT messages and their own trailers. Some partners do not accept credit notes by EDI at all, so check before you build one.

### What is the EDIFACT equivalent of INVFIL?

The EANCOM INVOIC message with document code `BGM+380`. Each EANCOM invoice is self-contained, so the file-level VATTLR and INVTLR summaries have no direct equivalent.

## Related guides

- **[TRADACOMS explained](/guides/edi/tradacoms)**: syntax, STX and END, and how files work
- **[TRADACOMS ORDHDR](/guides/edi/tradacoms-ordhdr)**: the order file you are invoicing against
- **[TRADACOMS CREHDR](/guides/edi/tradacoms-crehdr)**: the credit note file
- **[TRADACOMS file types](/guides/edi/tradacoms-file-types)**: every file type and its EANCOM equivalent
- **[EDIFACT INVOIC](/guides/edi/edifact-invoic)**: the EANCOM invoice

## Sources

- [EDI - Tradacoms invoice specifications](https://www.jlpsuppliers.com/supplier-finance-queries/new-connections/edi-tradacoms-invoice-specifications), John Lewis Partnership
- [TRADACOMS release 9 INVOIC layout](https://www.kasoftware.com/schema/edi/tradacoms/9/messages/INVOIC/), KA Software schema reference, including the ILD, STL, TLR and TOT segment pages
- [TRADACOMS EDI Connector](https://docs.mulesoft.com/tradacoms-edi-connector/latest), MuleSoft: INVFIL, INVOIC, VATTLR and INVTLR file structure
- [Tradacoms invoices](https://techcommunity.softwareag.com/t/tradacoms-invoices/108914), Software AG Tech Community
- [Co-op supplier guidelines](https://supplier.coop.co.uk/supplierguidelines), Co-op
- [Setting up an EDI connection with Ocado](https://ecosio.com/en/blog/setting-up-an-edi-connection-with-ocado/), ecosio
- [Ending support for TRADACOMS](https://www.gs1uk.org/insights/news/ending-support-for-tradacoms), GS1 UK

Check an INVFIL's structure, counts and trailers in the free [EDIFACT inspector](/edifact-inspector).
