# X12 Validator Transaction Set Notes

Use these notes to focus validation explanations by transaction set after `validate_x12` returns errors or warnings.

## Envelope Checks

For any X12 document, pay attention to:

- ISA and IEA control-number agreement.
- GS and GE control-number agreement.
- ST and SE control-number agreement.
- SE segment count.
- Presence of required envelope segments.

## 850 Purchase Order

Common validation focus areas:

- BEG must identify purchase order purpose, type, number, and date according to the transaction version.
- N1 loops often carry buyer, seller, bill-to, or ship-to parties.
- PO1 loops should contain line item identifiers, quantities, units of measure, and product IDs as required by the implementation.
- CTT totals should be consistent with line counts when present.

## 810 Invoice

Common validation focus areas:

- BIG should carry invoice date and invoice number.
- IT1 loops should carry invoice line details.
- TDS should carry invoice total according to trading-partner monetary conventions.
- SAC, TXI, and summary segments may be partner-required even when the base standard allows variation.

## 856 Advance Ship Notice

Common validation focus areas:

- BSN should identify shipment notice purpose, shipment ID, date, and time.
- HL loops must preserve valid hierarchy.
- TD segments often carry carrier and routing details.
- MAN segments often carry package marks or tracking identifiers.

## 997 Functional Acknowledgment

Common validation focus areas:

- AK1 should match the acknowledged functional group.
- AK2 should identify acknowledged transaction sets when present.
- AK5 and AK9 should carry valid acknowledgment status codes.
- Control numbers should match the original interchange or group being acknowledged.
