---
title: IeaSegment
summary: API reference for IeaSegment.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-15
library: SAIF.Framework.Common.Files
reference_type: package
---

# IeaSegment

`IeaSegment` models the X12 IEA interchange trailer, the final segment of an EDI interchange envelope that closes out the corresponding `IsaSegment` header. Its control number is always emitted as exactly nine digits via `ToString("D9")` on `Build()`, matching the fixed nine-digit format used by the ISA control number ([BR-043](../../business-rules.md#br-043-iea-control-number-emitted-as-nine-digits)).

## Purpose
- Represents the IEA segment identity via `SegmentId` returning the literal `"IEA"` ([BR-020](../../business-rules.md#br-020-first-element-is-the-segment-identifier)).
- Carries `NumberOfFuntionalGroups`, the count of functional groups contained in the interchange.
- Carries `ControlNumber`, formatted as a fixed nine-digit string on `Build()` to match the paired `IsaSegment.ControlNumber` format ([BR-043](../../business-rules.md#br-043-iea-control-number-emitted-as-nine-digits)).

## Context
- Namespace: `SAIF.Common.Files.Edi.Segments`
- Assembly/package: `SAIF.Framework.Common.Files`

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| SegmentId | `string SegmentId { get; }` | Returns the literal X12 segment identifier `"IEA"`. |
| NumberOfFuntionalGroups | `int NumberOfFuntionalGroups { get; set; }` | The number of functional groups included in the interchange (IEA01), element 1. |
| ControlNumber | `long ControlNumber { get; set; }` | The interchange control number matching the paired `IsaSegment.ControlNumber` (IEA02), emitted as a fixed nine-digit string on `Build()` ([BR-043](../../business-rules.md#br-043-iea-control-number-emitted-as-nine-digits)). |
| Build | `IEdiSegment Build()` | Creates a `SegmentBuilder("IEA")`, adds `NumberOfFuntionalGroups` at element 1 and `ControlNumber.ToString("D9")` at element 2, returning the built segment ([BR-043](../../business-rules.md#br-043-iea-control-number-emitted-as-nine-digits)). |
| Fill | `void Fill(IEdiSegment segment)` | Reads elements 1-2 via `GetChildValue`, converting to `int`/`long`, into `NumberOfFuntionalGroups` and `ControlNumber`. |
| Parse | `static IeaSegment Parse(IEdiSegment segment)` | Instantiates a new `IeaSegment`, calls `Fill(segment)` on it, and returns it. |

## Sources
- Common\SAIF.Common.Files\Edi\Segments\IeaSegment.cs
