# EDIFACT INVOIC: Invoice Segments, VAT and Example

> EDIFACT INVOIC explained: live EANCOM invoices with UK VAT, zero-rated lines, credit notes, allowances and charges, the segment table and the X12 810 mapping.

<QuickAnswer>
EDIFACT INVOIC is the UN/EDIFACT invoice message, the equivalent of the X12 810. The supplier sends it to bill the buyer, quoting the order and despatch references. Each LIN line carries the invoiced quantity, net amount, price and a TAX segment with its VAT rate; the summary repeats totals in MOA segments and VAT per rate in TAX and MOA pairs.
</QuickAnswer>

INVOIC is the message that gets you paid. Buyers match it against their order and their goods receipt before they release payment, so an INVOIC that disagrees with your DESADV, or whose VAT does not add up, sits in an exceptions queue until somebody fixes it by hand.

This guide follows the [GS1 EANCOM 2002 INVOIC](https://www.gs1.org/sites/default/files/docs/eancom/ean02s3/part2/invoic/toc.htm) layout, with four live UK examples you can open in the inspector: a mixed-VAT invoice, an invoice with allowances and charges, a credit note, and an invoice built for three-way matching. For EDIFACT basics, start with [EDIFACT explained](/guides/edi/edifact).

<EDIGuideCTA
  badge="For EDIFACT INVOIC"
  transactionType="810"
  headline="Check an INVOIC before it reaches accounts payable"
  body="Paste an INVOIC into the free EDIFACT inspector to see every segment explained, with counts, references and GS1 check digits verified. OrderSync processes EDIFACT, EANCOM and TRADACOMS orders alongside X12, PDF, CSV and email, straight into your ERP."
  secondaryHref="/edifact-inspector"
  secondaryLabel="Try the free EDIFACT inspector"
/>

## What is an EDIFACT INVOIC?

**INVOIC is the UN/EDIFACT invoice message: a claim for payment for goods or services supplied under conditions agreed between seller and buyer.** GS1 states that the same message, with the right document code, also serves as the specification for credit notes and debit notes. One INVOIC can cover one or more orders and deliveries, and can carry payment terms and transport details.

INVOIC comes near the end of the order-to-cash flow: [ORDERS](/guides/edi/edifact-orders), [ORDRSP](/guides/edi/edifact-ordrsp), [DESADV](/guides/edi/edifact-desadv), [RECADV](/guides/edi/edifact-recadv), then INVOIC, then the buyer's remittance advice.

Like every EANCOM message, INVOIC has three sections. The **header** holds references, parties, currency, payment terms and invoice-level allowances or charges. The **detail** section holds one `LIN` group per invoiced item. The **summary** section, after `UNS+S`, holds the totals and the VAT breakdown.

```
UNH  Message header
  BGM, DTM, RFF, NAD, CUX, PAT, ALC     header: what, when, who, terms
  LIN  QTY  MOA  PRI  TAX/MOA  ALC     detail: one group per item
  UNS+S                                section control
  CNT  MOA  TAX/MOA  ALC/MOA           summary: totals and VAT by rate
UNT  Message trailer
```

## Example 1: a UK invoice with standard-rated and zero-rated lines

The fictional supplier Kestrel Valley Homeware invoices the fictional retailer Harbour Lane Stores for order HL-PO-88190. Two lines are standard-rated at 20%. The third is a printed cookbook, which is zero-rated in the UK. VAT numbers, GLNs and GTINs are made up, with valid GS1 check digits.

<EdifactSample
  title="INVOIC with 20% and 0% VAT lines"
  description="Three lines, two VAT rates, and a summary that breaks VAT down per rate."
  label="EANCOM D01B"
  raw="UNA:+.? '
UNB+UNOC:3+5098765000002:14+5012345000008:14+261009:1500+KVH000198++INVOIC'
UNH+1+INVOIC:D:01B:UN:EAN011'
BGM+380+KV-INV-20918+9'
DTM+137:20261009:102'
RFF+ON:HL-PO-88190'
DTM+171:20261005:102'
NAD+BY+5012345000008::9'
RFF+VA:GB123456789'
NAD+SU+5098765000002::9'
RFF+VA:GB987654321'
NAD+DP+5012345000107::9'
CUX+2:GBP:4'
PAT+1++5:3:D:30'
LIN+1++5098765100016:SRV'
IMD+F++:::BAMBOO CHOPPING BOARD LARGE'
QTY+47:120'
MOA+203:780.00'
PRI+AAA:6.50'
TAX+7+VAT+++:::20+S'
MOA+124:156.00'
LIN+2++5098765100023:SRV'
IMD+F++:::SALT ?+ PEPPER MILL SET'
QTY+47:40'
MOA+203:392.00'
PRI+AAA:9.80'
TAX+7+VAT+++:::20+S'
MOA+124:78.40'
LIN+3++5098765100047:SRV'
IMD+F++:::SEASONAL KITCHEN COOKBOOK'
QTY+47:30'
MOA+203:217.50'
PRI+AAA:7.25'
TAX+7+VAT+++:::0+Z'
MOA+124:0.00'
UNS+S'
CNT+2:3'
MOA+86:1623.90'
MOA+79:1389.50'
MOA+125:1389.50'
MOA+176:234.40'
TAX+7+VAT+++:::20+S'
MOA+125:1172.00'
MOA+124:234.40'
TAX+7+VAT+++:::0+Z'
MOA+125:217.50'
MOA+124:0.00'
UNT+46+1'
UNZ+1+KVH000198'"
/>

| Segment | What it says |
|---|---|
| `UNH+1+INVOIC:D:01B:UN:EAN011'` | INVOIC, directory D.01B, EANCOM 2002 subset version 011 |
| `BGM+380+KV-INV-20918+9'` | Commercial invoice (`380`), invoice number, original (`9`) |
| `DTM+137` | Invoice date. GS1 makes `137` mandatory |
| `RFF+ON` + `DTM+171` | The buyer's order number and its date |
| `NAD+BY` / `NAD+SU` + `RFF+VA` | Buyer and supplier GLNs, each with a VAT number |
| `CUX+2:GBP:4'` / `PAT+1++5:3:D:30'` | Invoiced in GBP, due 30 days after the invoice date |
| `QTY+47` / `MOA+203` / `PRI+AAA` | Invoiced quantity, line amount excluding VAT, net unit price |
| `TAX+7+VAT+++:::20+S'` + `MOA+124` | VAT at 20%, category S, and the VAT on this line |
| `TAX+7+VAT+++:::0+Z'` + `MOA+124:0.00'` | Zero rate, category Z, no VAT due |
| `MOA+86`, `79`, `125`, `176` | Invoice total, line total, taxable amount, total VAT |
| Summary `TAX` + `MOA+125` + `MOA+124` | One block per rate: taxable amount and VAT at that rate |
| `UNT+46+1'` | 46 segments from UNH to UNT inclusive |

The arithmetic: 780.00 + 392.00 + 217.50 = 1,389.50 taxable. VAT is 20% of 1,172.00 = 234.40, plus nothing on the 217.50 at zero rate. Invoice total 1,389.50 + 234.40 = 1,623.90.

## INVOIC segment reference

Status and repeat counts are from the GS1 EANCOM 2002 S3 INVOIC structure chart. "M" is mandatory, "C" conditional. Where a segment heads a segment group, the repeat count is for the group.

| Segment | Name | Status | Repeats | Carries | X12 810 equivalent |
|---|---|---|---|---|---|
| `UNH` | Message header | M | 1 | Message type and version | `ST` |
| `BGM` | Beginning of message | M | 1 | Document code (380, 381...), number, function | `BIG02`, `BIG07` |
| `DTM` | Date/time/period | M | 35 | Invoice date (137), delivery date (35) | `BIG01`, `DTM` |
| `PAI` | Payment instructions | C | 1 | How to pay | (by partner) |
| `FTX` | Free text | C | 99 | Notes for the whole invoice | `NTE` |
| `RFF` (SG1) | Reference | M in group | 99,999 | Order (ON), despatch advice (AAK), delivery note (DQ), invoice (IV) | `BIG04`, `REF` |
| `NAD` (SG2) | Name and address | M in group | 99 | Buyer, supplier, delivery point, invoicee by GLN | `N1` to `N4` |
| `RFF` (SG3) | Party reference | M in group | 9,999 | VAT number (VA) for that party | `REF` |
| `TAX` (SG6) | Duty/tax/fee details | M in group | 5 | Tax for the whole invoice | `TXI` |
| `CUX` (SG7) | Currencies | M in group | 99 | Invoicing currency | `CUR` |
| `PAT` (SG8) | Payment terms basis | M in group | 10 | Terms, discounts for early payment | `ITD` |
| `TOD` (SG12) | Terms of delivery | M in group | 5 | Incoterms or delivery terms | `FOB` |
| `ALC` (SG16) | Allowance or charge | M in group | 9,999 | Invoice-level charges such as freight | `SAC` |
| `AJT` (SG24) | Adjustment details | M in group | 1 | Reason for a credit or debit note | (by partner) |
| `LIN` (SG26) | Line item | M in group | 9,999,999 | GTIN of the invoiced item | `IT1` |
| `PIA` | Additional product id | C | 25 | Supplier or buyer item codes | `IT1` qualifiers |
| `IMD` | Item description | C | 99 | Description | `PID` |
| `QTY` | Quantity | C | 5 | Invoiced (47), delivered (46) | `IT102` |
| `MOA` (SG27) | Monetary amount | M in group | 99 | Line amount (203) | Calculated, not sent |
| `PRI` (SG29) | Price details | M in group | 25 | Net (AAA) or gross (AAB) unit price | `IT104` |
| `RFF` (SG30) | Line reference | M in group | 10 | Line-level order or delivery reference | `REF` in IT1 loop |
| `TAX` (SG34) | Line tax | M in group | 99 | VAT rate and category for the line | `TXI` in IT1 loop |
| `ALC` (SG39) | Line allowance or charge | M in group | 30 | Line discounts and charges | `SAC` in IT1 loop |
| `UNS` | Section control | M | 1 | Start of summary (`UNS+S`) | None |
| `CNT` | Control total | C | 10 | Number of lines (2) | `CTT` |
| `MOA` (SG50) | Summary amount | M in group | 100 | Totals: 86, 79, 125, 176, 131, 129, 9 | `TDS` |
| `TAX` (SG52) | Summary tax | M in group | 10 | VAT per rate, with up to 9 MOA | `TXI` |
| `ALC` (SG53) | Summary allowance or charge | M in group | 15 | Totals per allowance or charge type | `SAC` |
| `UNT` | Message trailer | M | 1 | Segment count and reference | `SE` |

## How VAT works in INVOIC

VAT is carried by **TAX and MOA pairs**, in up to three places: on each line, at header level for the whole invoice, and in the summary once per rate.

### The TAX segment

`TAX+7+VAT+++:::20+S'`

| Position | Value | Meaning |
|---|---|---|
| Function qualifier | `7` | Tax (`5` would be customs duty) |
| Tax type | `VAT` | Value added tax (`GST` is also allowed) |
| Rate | `:::20` | 20%, in the fourth component of the rate composite |
| Category | `S` | Standard rate |

### UK rates and category codes

The UK has three VAT rates: [standard 20%, reduced 5% and zero 0%](https://www.gov.uk/vat-rates). Exempt supplies are not a rate at all.

| UK treatment | Rate in TAX | Category code | Where the code comes from |
|---|---|---|---|
| Standard rate | `:::20` | `S` | EANCOM restricted list |
| Reduced rate | `:::5` | Partner-specific | Ask your customer |
| Zero rate | `:::0` | `Z` (zero rated goods) | UN/EDIFACT code list 5305 |
| Exempt | (no rate) | `E` | EANCOM restricted list |
| Mixed rate | (varies) | `A` | EANCOM restricted list |

This is where generic examples go wrong. EANCOM 2002 restricts the category code to `A` (mixed), `E` (exempt) and `S` (standard), and says that tax types and categories differ by country and are defined by national guidelines. `Z` for zero-rated goods comes from the full UN/EDIFACT 5305 code list, the same list [Peppol uses](https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL5305/). Some UK partners want `Z`, some want `S` with a 0 rate, and the reduced rate has no single agreed code. Take every category code from your customer's guide.

### Line, header and summary

- **Line level.** Each LIN group has its own `TAX` and an `MOA+124` with the VAT on that line. EANCOM also allows `MOA+125` here for the taxable amount.
- **Header level.** A `TAX` group in the header applies to the whole invoice. GS1 says header tax amounts are added to any amounts in the detail section to get the summary totals. Example 2 below uses this for VAT on a freight charge.
- **Summary level.** One `TAX` per rate, each followed by `MOA+125` (taxable amount at that rate) and `MOA+124` (VAT at that rate). Example 1 has two summary TAX blocks, one at 20% and one at 0%.

### What HMRC expects on a VAT invoice

HMRC's [record keeping notice (VAT Notice 700/21)](https://www.gov.uk/guidance/record-keeping-for-vat-notice-70021) lists what a full VAT invoice must show. The INVOIC fields that carry each one:

| HMRC requirement | Where it goes in INVOIC |
|---|---|
| Unique sequential invoice number | `BGM` document number |
| Time of supply (tax point), and date of issue if different | `DTM+137`, plus whatever date your partner specifies for the tax point |
| Supplier's name, address and VAT number | `NAD+SU` and `RFF+VA` |
| Customer's name and address | `NAD+BY` (and `NAD+IV` if the invoicee differs) |
| Description, quantity and unit price | `IMD`, `QTY+47`, `PRI` |
| VAT rate and amount excluding VAT per line | Line `TAX` and `MOA+203` |
| Rate of any cash discount | `PAT` and `PCD` |
| Total VAT in sterling | `MOA+176` |

A GLN is a code, not a name and address. EANCOM only allows the name and address parts of `NAD` when a coded identifier cannot do the job, so agree with your customer how the legal invoice details are held: in the message, or in master data the customer holds against your GLN.

### Rounding

Buyers' systems check every sum: line VAT against the summary, the summary against `MOA+176`, and `MOA+125` plus `MOA+176` against `MOA+86`. Rounding is the usual failure. If you round VAT per line and your customer rounds per rate, totals drift by a penny. Agree the rule before go-live and build your test invoices around awkward prices.

## Example 2: allowances and charges with ALC

`ALC` groups carry discounts and surcharges. They appear in the header (for the whole invoice), on each line, and in the summary. GS1 is explicit that header and line allowances are independent: a line `ALC` does not override a header `ALC`, it adds to it.

Here Kestrel Valley gives a 10% quantity discount on 200 tea towels and adds a 25.00 freight charge to the invoice.

<EdifactSample
  title="INVOIC with a line discount and a freight charge"
  description="Gross price with a 10% line allowance, a header freight charge with its own VAT, and summary totals that include it."
  label="EANCOM D01B"
  raw="UNA:+.? '
UNB+UNOC:3+5098765000002:14+5012345000008:14+261016:1100+KVH000211++INVOIC'
UNH+1+INVOIC:D:01B:UN:EAN011'
BGM+380+KV-INV-20957+9'
DTM+137:20261016:102'
RFF+ON:HL-PO-88412'
DTM+171:20261012:102'
NAD+BY+5012345000008::9'
RFF+VA:GB123456789'
NAD+SU+5098765000002::9'
RFF+VA:GB987654321'
NAD+DP+5012345000107::9'
CUX+2:GBP:4'
PAT+1++5:3:D:30'
ALC+C++6++FC'
MOA+23:25.00'
TAX+7+VAT+++:::20+S'
MOA+124:5.00'
LIN+1++5098765100030:SRV'
QTY+47:200'
MOA+203:405.00'
PRI+AAB:2.25'
TAX+7+VAT+++:::20+S'
MOA+124:81.00'
ALC+A+++1+QD'
PCD+1:10'
MOA+204:45.00'
LIN+2++5098765100016:SRV'
QTY+47:60'
MOA+203:390.00'
PRI+AAA:6.50'
TAX+7+VAT+++:::20+S'
MOA+124:78.00'
UNS+S'
CNT+2:2'
MOA+86:984.00'
MOA+79:795.00'
MOA+125:820.00'
MOA+176:164.00'
MOA+131:25.00'
TAX+7+VAT+++:::20+S'
MOA+125:820.00'
MOA+124:164.00'
ALC+C++++FC'
MOA+131:25.00'
UNT+44+1'
UNZ+1+KVH000211'"
/>

| Segment | What it says |
|---|---|
| `ALC+C++6++FC'` + `MOA+23:25.00'` | Header charge, paid by the customer (`6`), freight (`FC`), 25.00 |
| `TAX` + `MOA+124:5.00'` after it | The freight charge carries 20% VAT |
| `PRI+AAB:2.25'` | Gross price. With `AAB`, the allowances must follow so the buyer can calculate the net |
| `ALC+A+++1+QD'` + `PCD+1:10'` + `MOA+204:45.00'` | Line allowance, calculation step 1, quantity discount, 10%, worth 45.00 |
| `MOA+203:405.00'` | Line amount after the allowance: 200 x 2.25 less 45.00 |
| Summary `MOA+131:25.00'` | Header charges, which turn the line total (795.00) into the taxable amount (820.00) |
| `ALC+C++++FC'` + `MOA+131` | Summary total per charge type |

Three rules from the EANCOM manual keep ALC sane:

1. **Allowances are sent as positive numbers.** `ALC+A` makes the amount a deduction. Do not add a minus sign.
2. **Gross or net, not both.** `PRI+AAB` (gross) means allowances and charges must follow for the calculation. `PRI+AAA` (net) means they are already included and any `ALC` is for information.
3. **Sequence matters when allowances stack.** The calculation sequence code (`1` to `9`) says which allowance applies first when each one is calculated on the price left by the previous one.

## Example 3: a credit note (BGM 381)

Six chopping boards from invoice KV-INV-20931 arrived damaged. Kestrel Valley issues a credit note in the same INVOIC message, with document code `381`, a reference to the original invoice, and an adjustment reason.

<EdifactSample
  title="Credit note for damaged goods"
  description="BGM 381 referencing the original invoice with RFF+IV, adjustment reason AJT+3, and all amounts positive."
  label="EANCOM D01B"
  raw="UNA:+.? '
UNB+UNOC:3+5098765000002:14+5012345000008:14+261020:0930+KVH000219++INVOIC'
UNH+1+INVOIC:D:01B:UN:EAN011'
BGM+381+KV-CN-00412+9'
DTM+137:20261020:102'
RFF+IV:KV-INV-20931'
DTM+171:20261015:102'
RFF+ON:HL-PO-88231'
DTM+171:20261011:102'
NAD+BY+5012345000008::9'
RFF+VA:GB123456789'
NAD+SU+5098765000002::9'
RFF+VA:GB987654321'
CUX+2:GBP:4'
AJT+3'
LIN+1++5098765100016:SRV'
QTY+47:6'
MOA+203:39.00'
PRI+AAA:6.50'
TAX+7+VAT+++:::20+S'
MOA+124:7.80'
UNS+S'
CNT+2:1'
MOA+86:46.80'
MOA+79:39.00'
MOA+125:39.00'
MOA+176:7.80'
TAX+7+VAT+++:::20+S'
MOA+125:39.00'
MOA+124:7.80'
UNT+29+1'
UNZ+1+KVH000219'"
/>

What makes this a credit note:

- **`BGM+381`** is "credit note, goods and services". The message structure is identical to an invoice.
- **`RFF+IV`** names the invoice being credited. GS1 says this is how a credit note points at its invoice.
- **`AJT+3`** gives the reason: damaged goods. EANCOM also lists `5` (price query) and `9` (invoice error), and only allows AJT on credit and debit notes.
- **Every amount is positive.** EANCOM's rule is that numeric values are positive and the receiving application uses the document code to turn a credit note's values negative. A credit sent as `380` with minus signs will be rejected by most buyers.

### Document codes and message functions

The `BGM` document code says what kind of financial document this is. These are from the EANCOM 2002 restricted list:

| Code | Document |
|---|---|
| `380` | Commercial invoice |
| `381` | Credit note, goods and services |
| `383` | Debit note, goods and services |
| `384` | Corrected invoice |
| `385` | Consolidated invoice |
| `386` | Prepayment invoice |
| `389` | Self-billed invoice |
| `261` | Self-billed credit note |
| `325` | Proforma invoice |

GS1 advises checking with local tax authorities before using `384`, because some countries do not allow corrected invoices. Its recommended route for a wrong invoice is to cancel it and issue a new one, or to issue a credit or debit note that references it.

The third element of `BGM` is the message function: `9` original, `1` cancellation, `5` replacement, `7` duplicate, `31` copy.

### Self-billing (BGM 389)

In a self-billing arrangement the customer raises the invoice for the supplier. In INVOIC, that is document code `389` (or `261` for a self-billed credit note). For UK VAT, HMRC says a self-billed invoice [must include the reference "self billing"](https://www.gov.uk/guidance/vat-guide-notice-700), and the arrangement must meet the conditions in Self-billing (VAT Notice 700/62), including a written agreement between the parties. If your customer asks to self-bill, settle the agreement before you map the message.

## Example 4: an invoice built for three-way matching

Retail accounts payable teams match three documents before they pay: the order, the goods receipt, and the invoice. Make the match easy by quoting both the order and the despatch advice, and by invoicing exactly what you shipped.

Harbour Lane ordered 120 boards, 60 mill sets and 48 tea towels on [order HL-PO-88231](/guides/edi/edifact-orders). Kestrel Valley shipped 120 boards and 40 mill sets on [despatch advice KV-DES-7781](/guides/edi/edifact-desadv). The invoice bills those 160 items, not the 228 ordered.

<EdifactSample
  title="INVOIC quoting the order and the despatch advice"
  description="RFF+ON and RFF+AAK with their dates, delivered and invoiced quantities per line, and the actual delivery date."
  label="EANCOM D01B"
  raw="UNA:+.? '
UNB+UNOC:3+5098765000002:14+5012345000008:14+261015:1630+KVH000207++INVOIC'
UNH+1+INVOIC:D:01B:UN:EAN011'
BGM+380+KV-INV-20931+9'
DTM+137:20261015:102'
DTM+35:20261015:102'
RFF+ON:HL-PO-88231'
DTM+171:20261011:102'
RFF+AAK:KV-DES-7781'
DTM+171:20261013:102'
NAD+BY+5012345000008::9'
RFF+VA:GB123456789'
NAD+SU+5098765000002::9'
RFF+VA:GB987654321'
NAD+DP+5012345000107::9'
CUX+2:GBP:4'
PAT+1++5:3:D:30'
LIN+1++5098765100016:SRV'
QTY+46:120'
QTY+47:120'
MOA+203:780.00'
PRI+AAA:6.50'
TAX+7+VAT+++:::20+S'
MOA+124:156.00'
LIN+2++5098765100023:SRV'
QTY+46:40'
QTY+47:40'
MOA+203:392.00'
PRI+AAA:9.80'
TAX+7+VAT+++:::20+S'
MOA+124:78.40'
UNS+S'
CNT+2:2'
MOA+86:1406.40'
MOA+79:1172.00'
MOA+125:1172.00'
MOA+176:234.40'
TAX+7+VAT+++:::20+S'
MOA+125:1172.00'
MOA+124:234.40'
UNT+39+1'
UNZ+1+KVH000207'"
/>

| Segment | Why it helps the match |
|---|---|
| `DTM+35:20261015:102'` | Actual delivery date, which the buyer compares with its goods receipt |
| `RFF+ON:HL-PO-88231'` + `DTM+171` | Links the invoice to the order and its date |
| `RFF+AAK:KV-DES-7781'` + `DTM+171` | Links the invoice to the despatch advice. EANCOM's code for a delivery note number is `DQ`; use whichever your customer's guide asks for |
| `QTY+46` and `QTY+47` | Delivered quantity and invoiced quantity, side by side |
| No line for tea towels | Nothing shipped, so nothing billed. Line numbering stays 1 and 2 |

If the buyer sends a [RECADV](/guides/edi/edifact-recadv) showing fewer items received than you despatched, expect a deduction or a request for a credit note like Example 3.

## INVOIC vs the X12 810

| Data | EDIFACT INVOIC | X12 810 |
|---|---|---|
| Invoice number and date | `BGM` + `DTM+137` | `BIG02`, `BIG01` |
| Order reference | `RFF+ON` | `BIG04` |
| Despatch reference | `RFF+AAK` or `RFF+DQ` | `REF*BM` or `REF*PK`, by partner |
| Credit vs invoice | `BGM` code (`380`, `381`) | `BIG07` transaction type, or an [812](/guides/edi/812-credit-debit-adjustment) |
| Parties | `NAD+BY`, `NAD+SU`, `NAD+DP` with GLN | `N1*BT`, `N1*RE`, `N1*ST` |
| Payment terms | `PAT` | `ITD` |
| Line quantity and price | `QTY+47`, `PRI+AAA` | `IT102`, `IT104` |
| Line amount | `MOA+203` | Calculated, not sent |
| Allowances and charges | `ALC` + `PCD` / `MOA` | `SAC` |
| Line tax | `TAX` + `MOA+124` | `TXI` (where used) |
| Invoice total | `MOA+86` | `TDS01` (implied decimals) |
| Tax total | `MOA+176`, plus `TAX`/`MOA` per rate | `TXI` at summary level |
| Line count | `CNT+2` | `CTT01` |

Two differences matter most in practice. First, EDIFACT sends amounts with an explicit decimal mark (`1406.40`), while the X12 `TDS01` total uses implied decimals (`140640`). Second, sales tax in US X12 invoices is often a single summary figure, while EDIFACT invoices to VAT-registered buyers carry VAT per line and per rate. A mapping from one to the other has to rebuild the VAT breakdown, not just copy a total. See the [EDI 810 guide](/guides/edi/810-invoice) for the X12 side.

## INVOIC and e-invoicing mandates

EDIFACT INVOIC is an EDI format agreed between trading partners. Most new government e-invoicing mandates name other formats:

- **Peppol** uses UBL-based [Peppol BIS Billing 3.0](https://docs.peppol.eu/poacc/billing/3.0/), exchanged through Peppol access points.
- **Germany** requires B2B invoices that conform to the European standard EN 16931, typically XRechnung or ZUGFeRD. German guidance addresses when existing EDI invoice flows can continue, so check the current position for your case.
- **France** requires structured e-invoices exchanged through approved platforms. Every VAT-registered business must be able to receive them from 1 September 2026; see our [France mandate guide](/guides/e-invoicing/france-e-invoicing-mandate-2026).
- **The UK** will require all VAT invoices to be issued as e-invoices [from April 2029](https://www.gov.uk/government/publications/budget-2025-document/budget-2025-html), with an implementation roadmap due at Budget 2026. The format had not been fixed when this guide was updated.

A mandate may require a compliant invoice flow alongside your EDIFACT one, or instead of it. Our [country-by-country mandate guide](/guides/e-invoicing/peppol-vs-e-invoicing-mandates) has the detail.

## UK retailer INVOIC requirements

Every UK grocer takes invoices by EDI, but the format, the credit note rules and the move off paper differ. Confirm the current specification with each retailer during onboarding.

### Tesco

- Send invoices and credit notes by EDI, as EANCOM INVOIC or TRADACOMS `INVFIL`, depending on your setup.

See the [Tesco EDI requirements](/edi-compliance/tesco) page.

### Sainsbury's

- Send invoices as EDIFACT INVOIC or TRADACOMS `INVFIL`, using the Supplier ID and GLN Sainsbury's issues to you.

See the [Sainsbury's EDI requirements](/edi-compliance/sainsburys) page.

### Morrisons

- Send invoices and credit or debit notes by EDI. Morrisons' message set is EDIFACT D96A, so invoices are INVOIC, with credit notes as INVOIC `BGM+381` (see Example 3 above).
- Invoice the quantities on your DESADV, after any [ORDCHG](/guides/edi/edifact-ordchg) amendments.

See the [Morrisons EDI requirements](/edi-compliance/morrisons) page.

### Marks & Spencer

- Where your account is on self-billing, M&S raises the invoice from your ASN and you do not send INVOIC at all. Where it is not, send invoices by EDI. Our [self-billing (ERS) guide](/blog/self-billing-ers-explained) covers how to reconcile self-billed invoices.

See the [Marks & Spencer EDI requirements](/edi-compliance/marks-and-spencer) page.

### Retailers that invoice in TRADACOMS

- [Asda](/edi-compliance/asda), the [Co-op](/edi-compliance/co-op) and [Boots](/edi-compliance/boots) take invoices as TRADACOMS `INVFIL` and credit notes as `CREHDR`.
- [Ocado](/edi-compliance/ocado) takes invoices as `INVFIL` but does not accept credit or debit notes by EDI.
- [Waitrose](/edi-compliance/waitrose) runs a parallel phase in which you send EDI invoices with test qualifiers alongside paper copies, then moves you fully to EDI within a set window.

The [TRADACOMS INVFIL guide](/guides/edi/tradacoms-invfil) and [CREHDR guide](/guides/edi/tradacoms-crehdr) map each field to its INVOIC equivalent.

## Common INVOIC errors and fixes

| Error | What the buyer sees | Fix |
|---|---|---|
| Invoicing ordered quantities | Mismatch against the goods receipt | Invoice what the DESADV says you shipped |
| Totals that do not reconcile | Invoice held or rejected | Check 79 + 131 = 125 and 125 + 176 = 86, to the penny |
| VAT rounding drift | A penny out per rate | Agree per-line or per-rate rounding |
| Missing supplier VAT number | Not valid for VAT recovery | Send `RFF+VA` after `NAD+SU` |
| Wrong VAT category code | Tax validation failure | Use the codes in the customer's guide |
| Credit sent as `380` with negatives | Rejected | Use `381`, positive amounts and `RFF+IV` |
| Gross price with no allowance | Amount does not equal quantity x price | Send `ALC` with `PRI+AAB`, or use `PRI+AAA` |
| Wrong UNT or CNT count | Syntax rejection, often via CONTRL | Recount after every mapping change |
| Unescaped apostrophe or plus | Segment ends early | Escape as `?'` and `?+` |

## INVOIC testing checklist

1. **Get the customer's INVOIC guide** and confirm the directory (D.96A or D.01B), the EANCOM version in `UNH`, and the mandatory segments.
2. **Confirm VAT codes.** Write down the exact `TAX` category for each UK rate you invoice, including zero-rated and exempt lines.
3. **Agree the rounding rule** for line VAT and summary VAT.
4. **Build one test invoice per case:** standard rate only, mixed rates, a line allowance, a header charge, and a credit note.
5. **Check the references.** Every invoice should carry the order number, and the despatch or delivery note number if the customer matches on it.
6. **Paste each file into the [EDIFACT inspector](/edifact-inspector)** to check the envelope, `UNT` and `CNT` counts, escapes and GS1 check digits.
7. **Reconcile the totals by hand** for at least one invoice per case, then compare with what the customer's test system calculates.
8. **Send through the real connection** (AS2, SFTP or VAN) and confirm you receive the customer's CONTRL or APERAK.

## Frequently Asked Questions

### What does BGM+380 mean?

`380` is the UN/EDIFACT document name code for a commercial invoice. A credit note uses `381` and a debit note `383`, all in the same INVOIC message structure.

### How is VAT shown in an EDIFACT invoice?

With a `TAX` segment giving the tax type, rate and category, followed by an `MOA+124` with the tax amount. This appears on each line and again in the summary, once per VAT rate, with `MOA+125` for the taxable amount at that rate. `MOA+176` carries the total VAT for the invoice.

### How do I show a zero-rated line in INVOIC?

Send the line with a 0 rate, for example `TAX+7+VAT+++:::0+Z'` and `MOA+124:0.00'`, and give the zero rate its own TAX block in the summary. `Z` is the UN/EDIFACT code for zero-rated goods, but EANCOM leaves category codes to national guidelines, so confirm the code with your customer.

### Are credit note amounts negative in EDIFACT?

No. EANCOM says amounts are sent as positive values and the document code tells the receiver to treat them as negative. A credit note is `BGM+381` with positive quantities and amounts.

### What is the difference between MOA+79, MOA+125 and MOA+86?

`MOA+79` is the total of the line amounts. `MOA+125` is the taxable amount: the line total adjusted by invoice-level allowances and charges. `MOA+86` is the taxable amount plus VAT.

### What is the TRADACOMS equivalent of INVOIC?

The TRADACOMS invoice file, made of INVFIL (header), INVOIC (one per invoice), VATTLR (VAT trailer) and INVTLR (file trailer) messages. See the [TRADACOMS invoice file guide](/guides/edi/tradacoms-invfil) and the [TRADACOMS overview](/guides/edi/tradacoms).

### Can OrderSync handle EDIFACT invoices?

Yes. OrderSync supports EDIFACT, EANCOM and TRADACOMS alongside X12, PDF, CSV and email.

## Related guides

- **[EDIFACT explained](/guides/edi/edifact)**: syntax, envelopes and the full X12 mapping
- **[EDIFACT ORDERS](/guides/edi/edifact-orders)** and **[DESADV](/guides/edi/edifact-desadv)**: the order and despatch the invoice references
- **[EDIFACT RECADV](/guides/edi/edifact-recadv)**: the receiving advice that drives deductions
- **[EDIFACT CONTRL](/guides/edi/edifact-contrl)** and **[APERAK](/guides/edi/edifact-aperak)**: the acknowledgements your invoice gets back
- **[EDIFACT message types](/guides/edi/edifact-message-types)**: every message, grouped by business flow
- **[UBL vs X12 vs EDIFACT](/guides/e-invoicing/ubl-vs-x12-vs-edifact)**: how the invoice maps across all three standards
- **[EDI 810 invoice](/guides/edi/810-invoice)**: the X12 counterpart
- UK retailer requirements: [Tesco](/edi-compliance/tesco), [Sainsbury's](/edi-compliance/sainsburys), [Asda](/edi-compliance/asda), [Morrisons](/edi-compliance/morrisons), [Waitrose](/edi-compliance/waitrose)

## Sources

- [EANCOM 2002 S3: INVOIC invoice message](https://www.gs1.org/sites/default/files/docs/eancom/ean02s3/part2/invoic/toc.htm) (structure chart, segment layouts and example), GS1
- [EANCOM 2002 S3 Part 1: syntax and numeric representation](https://www.gs1.org/sites/default/files/docs/eancom/ean02s3/part1/part1_05.htm), GS1
- [UNCL5305 duty or tax or fee category code](https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL5305/), OpenPeppol
- [VAT rates](https://www.gov.uk/vat-rates), GOV.UK
- [Record keeping (VAT Notice 700/21)](https://www.gov.uk/guidance/record-keeping-for-vat-notice-70021), HMRC
- [VAT guide (VAT Notice 700), section 17.4 on self-billing](https://www.gov.uk/guidance/vat-guide-notice-700), HMRC
- [Budget 2025](https://www.gov.uk/government/publications/budget-2025-document/budget-2025-html), HM Treasury
- [Peppol BIS Billing 3.0](https://docs.peppol.eu/poacc/billing/3.0/), OpenPeppol

Check your INVOIC totals, counts and escapes in the free [EDIFACT inspector](/edifact-inspector) before your customer's accounts payable team does.
