How to limit Shopify orders to a list of delivery postal codes
Short answer: Allow checkout only when the shipping postal code is inside your delivery area — ideal for local bakeries, florists and grocery delivery. In Checkpost, choose “Only allow listed postal codes (local delivery)” from Templates, adjust the values, test it, then save and enable the rule.
The problem
Local businesses such as bakeries, florists, grocers and restaurants deliver only within a small radius. Shoppers outside it still place orders, which then have to be refunded or turned into pickups by phone.
How to set it up
- Install Checkpost from the Shopify App Store.
- Open Templates and choose Only allow listed postal codes (local delivery).
- Replace the list with the postal codes (or prefixes) you deliver to.
- Use Try this rule to test a sample cart, then click Save rule.
The rule
Checkout is blocked when all of these conditions is true:
- ZIP / postal code starts with none of 685, 686
Shoppers see: “We only deliver within our local area. Please choose store pickup instead.” at the zip / postal code field, once they reach checkout.
Rule definition (JSON)
{
"name": "Outside delivery area",
"match": "all",
"conditions": [
{
"kind": "text",
"field": "ship_zip",
"op": "not_starts_with_any",
"values": [
"685",
"686"
]
}
],
"message": "We only deliver within our local area. Please choose store pickup instead.",
"target": "zip",
"runOn": "checkout"
}Where this rule works
These are cart and checkout validations, including supported accelerated checkouts. They are current-cart policies; they do not track previous purchases of a SKU. Shopify excludes POS, recurring subscription orders and native pre-order/Try Before You Buy flows from this API. See Shopify's validation compatibility.
Tips
- List every postal code (or prefix) you deliver to and use "starts with none of".
- Add a Delivery method type condition (is any of SHIPPING, LOCAL) so shoppers outside your area can still choose store pickup.
- Mention your pickup option in the error message so the shopper has a way forward.
Can you do this without an app?
Shopify's Local delivery settings can limit delivery by postal code or radius, but only for the local delivery method itself. A checkout rule also stops courier shipping or other methods outside your area.
FAQ
Does this work for Indian PIN codes?
Yes. PIN codes are treated like any postal code, so a prefix like 685 covers a whole district.
Can I allow a few customers outside the area?
Add a customer tag condition (has none of "delivery-exception") and tag those customers.
Related rules
Block PO Box addresses
Stop checkout when the shipping address contains a PO Box, so carriers that cannot deliver to PO Boxes never receive the order.
Block shipping to specific countries
Prevent orders from being placed with a shipping address in countries you cannot or do not want to serve.
Block specific ZIP / postal codes
Block checkout for postal codes you can't deliver to, using exact codes or prefixes (for example remote islands or rural areas).
Restrict products in certain states
Block checkout when a restricted product (for example knives, vapes, supplements or CBD) is shipped to a state or province where it can't be sold.
Add only allow listed postal codes (local delivery) to your store