X12 278 PER04 Field Guide: Communication Number Values and Common Mistakes
PER04 looks like a phone number field until the qualifier next to it turns it into an email address or a fax line — and a validator that assumes digits-only breaks the moment a real trading partner sends anything else.
PER04 is the actual contact value in the PER segment of an X12 278 — a phone number, fax number, or email address — and what kind of value it is depends entirely on the qualifier code carried in PER03 immediately before it.
What the value looks like, by qualifier
Example
PER04 holds 8005557321, a phone number, because the preceding qualifier (PER03) is TE. An extension of 4482 follows via the EX qualifier. Synthetic test data.
Where this trips people up
Validation logic that hardcodes a phone-number pattern against PER04 works fine until PER03 carries EM instead of TE, and the same field position now holds an email address that fails a digits-and-dashes regex. The fix isn't a looser pattern — it's reading PER03 first and validating PER04 against whichever format that qualifier actually promises.