Build rules

Location rules: countries, states and postal codes

Target shipping addresses by country, state or province, and postal code lists, prefixes or numeric ranges — and how each is matched at checkout.

3 min read · Updated

Location conditions check the shipping address at checkout. Use them to hide fast options for remote areas, offer a method only in certain regions, or rename a rate for one country.

Condition Comparisons Plan
Shipping country is any of, is none of All plans
Shipping state / province is any of, is none of Growth and up
Shipping postal code is any of, is none of, starts with any of, starts with none of, is between, is not between Growth and up

Countries

Type two-letter country codes such as US or GB and press Enter, or pick a country from Add a country…. The condition lists each country by name and code.

States and provinces

Write each state or province as a country-code pair, for example US-CA, US-NY or CA-ON. Including the country means the same state code in two countries can’t be mixed up.

Postal codes

Postal codes can be matched three ways:

Comparison Enter Example
is any of / is none of Exact codes 90210, 10001
starts with any of / starts with none of Prefixes SW1 or 902
is between / is not between A numeric range, lowest first 90000 to 90299

How postal codes are compared:

  • Spaces and dashes are ignored, and letters aren’t case-sensitive. SW1A 1AA and sw1a1aa are the same.
  • Ranges use numbers. ShipRule reads the digits at the start of the code, so 90210-1234 counts as 90210. Codes that don’t start with digits never fall inside a range.
  • Paste long lists. Paste codes separated by commas or new lines. A condition can hold up to 500 values.

Tip: Prefixes keep lists short. starts with any of 96, 99 is one short condition, where a list of every code in those areas could fill your checkout capacity.

When the address is missing a value

If an address has no postal code (or no state), the positive comparisons — is any of, starts with any of, is between — don’t match, and the negative ones — is none of, starts with none of, is not between — do. The same applies to countries.

Several delivery groups

If a checkout has more than one group of delivery options, each group is checked against its own shipping address.

Examples

Goal Condition Action
Hide next-day delivery for remote postal codes Shipping postal code starts with any of 96, 99 Hide methods whose name contains Next day, Overnight
Hide a method for some countries Shipping country is any of CA Hide methods whose name contains Economy
Offer local delivery only nearby Shipping postal code is not between 90000 and 90299 Hide delivery type Local delivery (Pro)
Show only your free rate in two states on larger orders Shipping state / province is any of US-CA, US-OR and Cart subtotal is at least 100 Show only methods whose name contains Free

The first two are ready-made templates; see Rule templates.

Checkout capacity

Shopify limits how much rule data reaches checkout. Long postal code lists use the most. The Checkout capacity meter in the rule editor and on Shipping rules shows how much you use. If you go over, ShipRule won’t save the change and asks you to shorten long lists or turn off rules you don’t need.

Didn’t find what you need?Email [email protected] and we’ll help you set it up.
Email support