ANSI X12 837P - 5010 ST & SE Transaction Set Header & Trailer

Image Description

May 07, 2026

The ST (Transaction Set Header) and SE (Transaction Set Trailer) segments define the boundaries of a single transaction set within the ANSI X12 837 Professional (5010) healthcare claim file. These segments operate inside the GS/GE functional group envelope and ensure that each claim transaction is properly identified, counted, and validated.

The ST/SE pair is mandatory and appears once for each transaction set. Each ST segment begins a transaction (such as an 837 claim), and the corresponding SE segment closes that transaction. Together, they ensure data integrity by tracking control numbers and segment counts.

While the ST/SE segments define a single transaction set, that transaction can contain multiple claims – not just one. In practice, senders often group claims together within a single transaction set based on shared characteristics such as:

  • Payer
  • Line of Business
  • Claim Type (e.g., Professional vs. Institutional)
  • Billing Provider

These groupings help ensure that claims are processed efficiently and routed correctly by clearinghouses and payers.

👉 Example:

  • One ST/SE per payer
  • One ST/SE per billing provider

As a result, a single 837 file may contain multiple ST/SE transaction sets, each representing a logical grouping of claims within the same GS/GE functional group.

Sample 837P (5010) – ST / SE Transaction Set Envelope

> Transaction Set Header & Trailer
  • ISA*00*          *00*          *ZZ*SENDERID       *ZZ*RECEIVERID     *250918*0535*^*00501*000000011*1*P*:~
  • GS*HC*SENDERCODE*RECEIVERCODE*20250918*0535*10022*X*005010X222A1~
    • ST*837*0001*005010X222A1~
    • ... (claims detail segments) ...
    • SE*39*0001~
    GE*1*10022~
  • IEA*1*000000011~

In this example:

  • ST02 and SE02 both contain the Transaction Set Control Number (0001), which must match exactly. This control number should be unique within the specific ISA/IEA interchange, although the same value may be reused in other interchanges.
  • SE01 indicates the total number of segments within the transaction set, including the ST and SE segments.
  • ST01 identifies the transaction type – for 837 Professional, this is always 837.

Reminder: If the control numbers between ST and SE do not match, or if the segment count is incorrect, the transaction set will be rejected—even if the surrounding GS/GE and ISA/IEA envelopes are valid.

HIPAA Guide – 837P [5010]

[Mandatory]

Segment Field Name Definition
ST 01 Transaction Set Identifier Code Identifies the type of transaction set.
CodeDefinition
837Health Care Claim
ST 02 Transaction Set Control Number Unique control number assigned by the sender. This value must match SE02.
ST 03 Implementation Convention Reference Identifies the implementation guide version.
CodeDefinition
005010X222A1 837 Professional Implementation Guide (5010 version).
SE 01 Number of Included Segments Total number of segments in the transaction set, including ST and SE.
SE 02 Transaction Set Control Number Must match ST02 exactly.
Important: The segment count in SE01 must include every segment from ST through SE. Miscounts are one of the most common causes of claim rejection in 837 processing.

Note: Each transaction set must be fully enclosed by a matching ST/SE pair. If ST02 and SE02 do not match, or if SE01 does not equal the actual segment count, the transaction will fail validation at the transaction level.


We hope you found this article helpful! Please reach out to us with questions/feedback.