EDI file rejected by a trading partner (X12 / EDIFACT control totals, ISA errors)

Last reviewed 2026-09-19

EDI messages are strict: the ISA header must be a fixed length, segments end in a terminator, and every SE, GE and IEA trailer must carry the correct segment count and control number. A file edited by hand or re-wrapped by an email or text tool often breaks those totals, and the partner's system rejects the whole interchange.

Messages you might see

  • “997 rejection / interchange control number mismatch”
  • “Segment count in SE does not match”
  • “Invalid ISA header length”

Why it happens

  • Segments split across lines by an editor or email.
  • A padded ISA header that was trimmed or changed length.
  • Missing SE, GE or IEA trailers, or trailers with the wrong counts.
  • Control numbers that don't match between header and trailer.

Try this first (free, no tool needed)

  1. Check the acknowledgement (997/999 or CONTRL) your partner returned, which usually names the failing segment.
  2. Confirm the separators your partner expects and that the ISA header is exactly the right length.
  3. Re-generate from the source system if you can, rather than editing the file.

If that didn't work

These tools run in your browser. Your file is read and repaired on your own device and is never uploaded.

Malformed EDI Repair

Reads the separators from the file, rejoins segments split across lines, re-pads a malformed ISA header, adds missing SE/GE/IEA (or UNT/UNZ) segments and corrects the segment counts and control numbers. Element values are never changed. It repairs the envelope; business rules and partner-specific requirements still need your system's validation.

Open Malformed EDI Repair

Common questions

Will it change my order or invoice data?

No. Element values are never edited, only the envelope structure and counts.

Is my file uploaded anywhere?

No. The tool runs as a program inside your own browser, so the file is read and repaired on your device and never sent to a server.

Related guides