X12 segment reference
N4 — Geographic Location
X12 N4 segment reference: city, state/province, postal code, and country that complete an N1/N3 address block for ship-to and remit-to routing.
N4 segment facts
- N4 completes the geographic part of an N1 address block — city, state, postal, and country used for routing and tax logic.
- State and postal-code validation in N4 is a common silent failure point for cross-DC and cross-border shipments.
- SignalEDI validates N4 state/postal formats against partner profiles before outbound documents leave the sandbox.
What the N4 segment does
N4 completes the address for a party in an N1 loop by carrying city, state or province, postal code, and country code. It follows N3 street lines and is used for routing and tax determination.
Loop: N1 loop (after N3)
Key elements
| Element | Name | Description |
|---|---|---|
| N401 | City name | City for the party's address. |
| N402 | State or province code | Two-character code; required by most US partners. |
| N403 | Postal code | ZIP or postal code; format validated by partner rules. |
| N404 | Country code | ISO country code; often US when omitted. |
Example N4 segment
N4*Columbus*OH*43004*US~
Parse and validate samples with the free EDI validator or send JSON via the JSON→X12 mapping guide.
Common N4 errors
- Invalid or missing state code for a US ship-to
- Postal code format mismatch (ZIP+4 vs 5-digit) against partner spec
- N4 present without the preceding N1/N3 context
Related reference
FAQ
Frequently asked questions
Many US partners default to US when N404 is omitted, but cross-border programs require an explicit ISO country code.