How do postcode lists, prefixes and ranges work?
On this page
The Postcode condition matches the postcode of the delivery address. Click Add country, enter the Country code, then the Postcodes for that country. Add more countries the same way.
What you can type
Separate entries with commas, semicolons or new lines. Each entry is one of:
| Entry | Meaning | Example |
|---|---|---|
| Exact postcode | Only this postcode | 27498 |
Prefix (ends with *) |
Every postcode that starts with these characters | 35* matches 35001, 35500… |
Range (from-to, both sides the same length) |
Every postcode whose first characters fall in the range | 57030-57039 |
* alone |
Every postcode in that country | * |
Ranges compare the leading characters of the postcode. 9000-9499 therefore matches the Portuguese postcode 9000-123 and every postcode up to 9499-999.
A single hyphen between sides of different lengths is read as part of an exact postcode, so 9500-123 is the single postcode 9500-123.
Ranges can also be written with full postcodes that contain hyphens themselves, such as 9500-000-9599-999 (Portugal) or 00-001-00-999 (Poland); the app looks for the one cut that leaves two sides of the same length. 57030..57039 and 57030–57039 work too. An entry with several hyphens that is not such a range is refused.
UK-style postcodes (GB, Jersey, Guernsey, Isle of Man) are compared by district: E1* covers E1 and E1W but not E10 to E18, E1 alone covers every E1 postcode, and E1-E9 covers districts E1 to E9.
Spaces, hyphens and capital letters
Postcodes are compared without spaces, hyphens and dots, and without regard to upper or lower case. 27 498 and 27498 are the same for the rule, and a country prefix the buyer types, such as DE-27498 or NL 1234 AB, is ignored. Write postcodes the way you like; the buyer can too.
Countries
Each list belongs to one country, written as a two-letter code (DE, ES, IT…). Shopify lists some territories as their own countries (for example AX Åland, RE Réunion); use * for the whole territory. A postcode in the list only matches when the delivery address is in that country, so 20* for France (Corsica) does not affect Italian postcodes starting with 20.
Is one of / is not one of
- is one of: the condition matches when the postcode is in one of the lists.
- is not one of: the condition matches when it is not. An address in a country you did not list counts as not in the list.
When the buyer has not entered a postcode yet
Until checkout knows the delivery address, a postcode condition does not match, neither with is one of nor with is not one of, so nothing fires for an unknown destination. A * entry matches as soon as the country is known; every other entry also needs the postcode. Rules that depend on the postcode take effect once the buyer enters the address.
Errors in the editor
The editor will not save a postcode condition with no country (“Add at least one country.”), a country without postcodes (“Add postcodes for DE, or * for the whole country.”), or an entry it can’t read (“… is not a postcode, prefix (35*) or range (57030-57039).”). Fix the highlighted field, then save.
Start from a preset
For EU islands and special territories, EU presets fill in the postcode lists for you. See Use EU presets.