Purpose
The LIN (Line Item) segment marks the beginning of a detail line within an EDIFACT message. Each LIN segment represents one item, product, or service being ordered, invoiced, shipped, or otherwise referenced. It assigns a sequential line number and typically identifies the product using a standardized code such as a GTIN (Global Trade Item Number, formerly EAN article number).
The LIN segment is the anchor of the detail section. Other segments that follow it within the same segment group (such as QTY, MOA, PIA, IMD, and PRI) provide additional information about that specific line item. When a new LIN segment appears, it starts a new line item and its associated detail segments.
Data Elements
The LIN segment contains the following data elements:
- 1082 - Line Item Identifier: A sequential number identifying the line item within the message (e.g., 1, 2, 3). This provides a simple way to reference specific lines.
- 1229 - Action Code (conditional): Indicates the action to be taken for this line item. Used primarily in change orders or amendments. Values include:
- 1 - Added
- 2 - Deleted
- 3 - Changed
- 5 - Accepted without amendment
- C212 - Item Number Identification: The product identification composite.
- 7140 - Item Identifier: The actual product code (e.g., a GTIN/EAN-13 number).
- 7143 - Item Type Identification Code: Specifies the type of product code. Common values: SRV (GS1 Global Trade Item Number), EN (EAN article number), UP (UPC), BP (buyer's part number), SA (supplier's article number).
Format and Syntax
The general format of a LIN segment is:
LIN+lineNumber++itemNumber:itemTypeCode' When the action code is used:
LIN+lineNumber+actionCode+itemNumber:itemTypeCode' The empty element between line number and item identification (when action code is absent) is represented by consecutive plus signs.
Messages That Use LIN
The LIN segment appears in any message that has a detail section with line items:
- ORDERS - Each ordered product is a LIN item
- INVOIC - Each invoiced product or service
- DESADV - Each item in a shipment
- PRICAT - Each product in a price catalogue
- RECADV - Each received item
- ORDRSP - Each order response line item
Example
A line item for a product identified by GTIN:
LIN+1++5410738000015:SRV' This is line item 1, with no action code, identifying the product by its GTIN 5410738000015 using the SRV (GS1) code type.
A line item in a change order where the item is being deleted:
LIN+3+2+8712345678901:EN' Line item 3 with action code 2 (deleted), identifying the product by EAN number 8712345678901.
In context, a LIN segment is followed by its detail segments:
LIN+1++5410738000015:SRV'
QTY+21:48'
MOA+203:960.00' This shows line item 1 with a quantity of 48 units and a line item amount of 960.00.