Postcode Validation
This page details Sorted's postcode validation rules for each country code.
Each country code (recorded in the address
object using the country_iso_code
property) has its own postcode validation rule, provided as a RegEx. PRO returns an error if you attempt to create a shipment containing an address for which the postal_code
does not match the validation rule for the relevant country_iso_code
.
Articles Section Contents
Country Code | RegEx |
---|---|
AD | ^AD[0-9]{3}$ |
AE | TBC |
AF | ^[0-9]{4}$ |
AG | TBC |
AI | ^AI-2640$ |
AL | ^[0-9]{4}$ |
AM | ^[0-9]{4}$ |
AO | TBC |
AR | ^[A-Za-z]?[0-9]{4}([A-Za-z]{3})?$ |
AS | ^[0-9]{5}$ |
AT | ^[0-9]{4}$ |
AU | ^[0-9]{4}$ |
AW | TBC |
AX | ^[0-9]{5}$ |
AZ | ^AZ[0-9]{4}$ |
BA | ^[0-9]{5}$ |
BB | ^BB[0-9]{5}$ |
BD | ^[0-9]{4}$ |
BE | ^[0-9]{4}$ |
BF | TBC |
BG | ^[0-9]{4}$ |
BH | ^[0-9]{3}$ |
BI | TBC |
BJ | TBC |
BL | TBC |
BM | ^[A-Za-z]{2} [0-9]{2}$ |
BN | ^[A-Za-z]{2}[0-9]{4}$ |
BO | TBC |
BQ | TBC |
BR | ^[0-9]{5}-[0-9]{3}$ |
BS | TBC |
BT | ^[0-9]{5}$ |
BW | TBC |
BY | ^[0-9]{6}$ |
BZ | TBC |
CA | ^[A-Za-z][0-9][A-Za-z] [0-9][A-Za-z][0-9]$ |
CC | ^[0-9]{4}$ |
CD | TBC |
CF | TBC |
CG | TBC |
CH | ^[0-9]{4}$ |
CI | TBC |
CK | TBC |
CL | ^[0-9]{7}$ |
CM | TBC |
CN | ^[0-9]{6}$ |
CO | ^[0-9]{6}$ |
CR | ^[0-9]{5}$ |
CU | ^[0-9]{5}$ |
CV | ^[0-9]{4}$ |
CW | TBC |
CX | ^[0-9]{4}$ |
CY | ^[0-9]{4}$ |
CZ | ^[0-9]{3} [0-9]{2}$ |
DE | ^[0-9]{5}$ |
DJ | TBC |
DK | ^[0-9]{4}$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A | TBC |
RE | ^[0-9]{5}$ |
RO | ^[0-9]{6}$ |
RS | ^[0-9]{5}$ |
RU | ^[0-9]{6}$ |
RW | TBC |
SA | ^[0-9]{5}$ |
SB | TBC |
SC | TBC |
SD | ^[0-9]{5}$ |
SE | ^[0-9]{3} [0-9]{2}$ |
SG | ^[0-9]{6}$ |
SH | ^[A-Za-z]{1,2}[0-9][A-Za-z0-9]? [0-9][A-Za-z]{2}$ |
SI | ^[0-9]{4}$ |
SJ | ^[0-9]{4}$ |
SK | ^[0-9]{3} [0-9]{2}$ |
SL | TBC |
SM | ^[0-9]{5}$ |
SN | ^[0-9]{5}$ |
SO | TBC |
SR | TBC |
ST | TBC |
SV | ^[0-9]{4}$ |
SY | TBC |
SZ | TBC |
TC | ^TKCA 1ZZ$ |
TD | TBC |
TF | TBC |
TG | TBC |
TH | ^[0-9]{5}$ |
TJ | ^[0-9]{6}$ |
TK | TBC |
TL | TBC |
TM | ^[0-9]{6}$ |
TN | ^[0-9]{4}$ |
TO | TBC |
TR | ^[0-9]{5}$ |
TT | ^[0-9]{6}$ |
TV | TBC |
TW | ^[0-9]{5}$ |
TZ | TBC |
UA | ^[0-9]{5}$ |
UG | TBC |
US | ^\d{5}(?:[-\s]\d{4})?$ |
UY | ^[0-9]{5}$ |
UZ | ^[0-9]{6}$ |
VA | ^00120$ |
VC | ^VC[0-9]{4}$ |
VE | ^[0-9]{4}$ |
VG | ^VG[0-9]{4}$ |
VI | ^[0-9]{5}$ |
VN | ^[0-9]{6}$ |
VU | TBC |
WF | ^[0-9]{5}$ |
WS | TBC |
YE | TBC |
YT | ^[0-9]{5}$ |
ZA | ^[0-9]{4}$ |
ZM | ^[0-9]{5}$ |
ZW | TBC |