Chat on WhatsApp

ZIP/PIN Code Validation at Checkout for Magento 2

ZIP/PIN Code Validation at Checkout - validate postal codes against configurable country-specific ranges before customers place an order. Ships with pre-loaded ranges for India, US, UK, Canada, Australia, and Europe, a full-featured admin grid, CSV/JSON import-export, and real...

Magento 2.4.6–2.4.8 PHP 8.1–8.4 Hyva + Luma Ready Free

Key Features:

  • Country-specific ranges
  • Multiple range types
  • Pre-loaded country data
  • Allow-list or block-list mode

Additional Services

$0.00
In stock
SKU
panth-zipcode-validation
Links
Pay with Wise
Lifetime Updates Every Magento release
1-Year Free Support Email + WhatsApp
Adobe-Certified Magento 2 Developer
Free Forever No subscription, no upsell
What you get

Everything in the box

Built-in from day one. No add-ons, no upsell, no licence keys to renew.

Country-specific ranges

configure valid postal code ranges per country (e.g., 110000-110099 for Delhi, 90001-90210 for Los Angeles)

Multiple range types

numeric ranges, alphanumeric patterns (UK, Canada), exact-match lists, and regex patterns

Pre-loaded country data

India, US, UK, Canada, Australia, and major European countries ready to go

Allow-list or block-list mode

either restrict to serviceable areas or block specific excluded ranges

Overview

The ZIP/PIN Code Validation extension for Magento 2 is a checkout postal-code gate for Magento 2 and Adobe Commerce that blocks orders from non-serviceable areas before payment. It validates ZIP and PIN codes against configurable country-specific ranges with real-time AJAX feedback during the shipping-address step.

Ten countries ship pre-loaded out of the box: India (all 28 states plus 8 union territories), United States (all 50 states plus DC), United Kingdom, Canada, Australia, Germany, France, Italy, Spain, and Netherlands. Range types cover numeric ranges, alphanumeric patterns for UK and Canada, exact-match lists, and regex. Validation runs in allow-list mode (only listed ranges accepted) or block-list mode (listed ranges rejected) per store view, so multi-country stores can enforce different rules per storefront.

The ZIP/PIN Code Validation extension for Magento 2 fires debounced AJAX requests (default 400 ms) to /panth_zipcode/validate/check, returning under 30 ms thanks to indexed lookups and per-country cache. Customers see "Sorry, we do not deliver to this area" inline the moment they finish typing, and the Place Order button stays disabled until the postcode clears. CSV and JSON bulk import handles 100K+ pincodes via CLI. Hyva (Alpine.js) and Luma (Knockout.js), Magento 2.4.4 - 2.4.8, PHP 8.1 - 8.4.

Best for:

  • Courier and delivery businesses limiting orders to serviceable PIN codes in India
  • Regional retailers restricting shipments to specific US ZIP codes or UK postcode districts
  • Multi-country Magento stores enforcing different serviceable areas per store view

What you get

The ZIP/PIN Code Validation extension for Magento 2 gates non-serviceable orders end-to-end:

  • Pre-loaded ranges for India, US, UK, Canada, Australia, and five European countries
  • Numeric ranges, alphanumeric patterns, exact-match lists, and regex per country
  • Allow-list and block-list modes, per-store scope, per-country error messaging
  • Real-time AJAX validation, debounced, sub-30 ms response, indexed lookups
  • Admin grid with inline edit, mass actions, plus CSV and JSON bulk import / export
  • Address book validation, guest plus logged-in support, Hyva and Luma theme-aware

Key Features

ZIP / PIN Code Validation Engine

  • Country-specific ranges — configure valid postal code ranges per country (e.g., 110000-110099 for Delhi, 90001-90210 for Los Angeles)
  • Multiple range types — numeric ranges, alphanumeric patterns (UK, Canada), exact-match lists, and regex patterns
  • Pre-loaded country data — India, US, UK, Canada, Australia, and major European countries ready to go
  • Allow-list or block-list mode — either restrict to serviceable areas or block specific excluded ranges
  • Per-store configuration — different range sets for different store views (useful for multi-country stores)

Admin Grid

  • Full-featured UI component grid — search, filter, sort, bulk actions, pagination
  • Inline add/edit/delete — manage ranges without page reloads
  • Status toggles — enable/disable individual ranges on the fly
  • Audit fields — created-at and updated-at timestamps tracked automatically
  • Mass actions — enable/disable/delete in bulk

CSV / JSON Import-Export

  • Bulk import — upload thousands of pincodes via CSV or JSON in one go
  • Bulk export — download all configured ranges for backup or editing offline
  • Validation on import — duplicate detection, format checks, clear error messages
  • Template downloads — CSV and JSON sample templates provided in admin

Real-time AJAX Validation

  • Instant feedback at checkout — customers see validation errors the moment they type a postcode
  • Debounced AJAX requests — no server flooding while customers type
  • Customizable error messages — configure per-country "We do not deliver to this area" messaging
  • Graceful fallback — if AJAX fails, server-side validation still runs on form submit
  • Works on both Hyva and Luma — via Panth\Core\Helper\Theme detection

Storefront Behaviour

  • Blocks checkout on invalid postcode — customers cannot proceed to payment if postcode is outside serviceable area
  • Custom message per country — India, US, UK, etc. each get their own rejection message
  • Guest and logged-in support — validation runs for both customer types
  • Address book integration — validates postcodes when customers save new addresses too

Security & Performance

  • MEQP compliant — passes Adobe's Magento Extension Quality Program
  • Indexed lookups — optimized database schema with indexes on country_id and range fields
  • Cached country data — pre-loaded ranges cached per store view for fast AJAX response
  • Built on Panth Core — reuses shared admin foundation, zero duplication

Pre-loaded Country Ranges

The module ships with curated postal code range data for the following countries:

Country Format Coverage
India 6-digit PIN codes All 28 states + 8 union territories
United States 5-digit ZIP codes All 50 states + DC
United Kingdom Alphanumeric postcodes England, Scotland, Wales, N. Ireland
Canada Alphanumeric postal codes All 10 provinces + 3 territories
Australia 4-digit postcodes All 6 states + 2 territories
Germany 5-digit postleitzahl Nationwide
France 5-digit code postal Nationwide
Italy 5-digit CAP Nationwide
Spain 5-digit código postal Nationwide
Netherlands Alphanumeric postcodes Nationwide

You can enable, disable, override, or extend any country dataset from the admin grid.


Admin Grid

Access the admin grid at Panth Infotech → Zipcode Validation → Ranges:

  • Search by country, range start, range end, or label
  • Filter by country, status, or date
  • Sort any column ascending/descending
  • Inline edit labels and status
  • Bulk enable/disable/delete with mass actions
  • Full keyboard navigation
  • Exports respect current filters (export only what you searched)

CSV / JSON Import-Export

Import

  1. Go to Panth Infotech → Zipcode Validation → Import
  2. Download the CSV or JSON template
  3. Fill in your pincode/ZIP ranges
  4. Upload the file — the module validates format, detects duplicates, and reports errors per row

CSV format:

country_id,range_start,range_end,label,status
IN,110000,110099,Delhi,1
IN,400001,400099,Mumbai,1
US,90001,90210,Los Angeles,1
US,10001,10099,Manhattan,1

JSON format:

[
 {"country_id": "IN", "range_start": "110000", "range_end": "110099", "label": "Delhi", "status": 1},
 {"country_id": "US", "range_start": "90001", "range_end": "90210", "label": "Los Angeles", "status": 1}
]

Export

Click Export → CSV or Export → JSON from the ranges grid. Current grid filters are respected, so you can export only the rows you care about.


Real-time AJAX Validation

When a customer types a postcode in the shipping address form, the storefront JS debounces keystrokes and fires an AJAX request to the validation endpoint (/panth_zipcode/validate/check). The server responds with either:

  • {"valid": true} — postcode is in a serviceable range
  • {"valid": false, "message": "Sorry, we do not deliver to this area."} — postcode is invalid for the selected country

The form shows an inline error under the postcode field and, if Block Checkout on Invalid is enabled, the "Next" / "Place Order" button is disabled until the customer enters a serviceable postcode.

Validation is theme-aware — on Hyva storefronts the module uses Alpine.js, on Luma it uses Knockout.js, detected via Panth\Core\Helper\Theme.


Quick Links


Ready to upgrade your Magento 2 checkout?


SEO Keywords: magento 2 zipcode validation, pin code validation, postal code validation, india pincode magento, delivery area validation, magento 2 checkout zipcode, magento 2 serviceable area, magento 2 pincode checker, magento 2 zip code restriction, magento 2 postcode validator, india pincode checkout magento, us zip validation magento, uk postcode checkout, canada postal code magento, australia postcode magento, european postcode validation, magento 2 ajax postcode, real-time zipcode check, magento 2 delivery restriction, courier serviceable pincode, magento 2 shipping restriction by pincode, panth zipcode validation, panth infotech, hire magento developer, top rated plus upwork, kishan savaliya magento, mage2kishan, mage2sk, magento marketplace developer, custom magento development india, magento 2 hyva development, magento 2.4.8 module, php 8.4 magento, magento 2 checkout optimization

Compatibility

Requirement Versions Supported
Magento Open Source 2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.8
Adobe Commerce 2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.8
Adobe Commerce Cloud 2.4.4 — 2.4.8
PHP 8.1.x, 8.2.x, 8.3.x, 8.4.x
MySQL 8.0+
MariaDB 10.4+
Hyva Theme 1.0+
Luma Theme Native support
Required dependency mage2kishan/module-core (free)

Installation

Composer Installation (Recommended)

composer require mage2kishan/module-zipcode-validation
bin/magento module:enable Panth_Core Panth_ZipcodeValidation
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f
bin/magento cache:flush

Manual Installation via ZIP

  1. Download the release ZIP from Packagist or the Adobe Commerce Marketplace
  2. Extract to app/code/Panth/ZipcodeValidation/
  3. Ensure Panth_Core is also installed (required dependency)
  4. Run the same commands as above

Verify Installation

bin/magento module:status Panth_ZipcodeValidation
# Expected output: Module is enabled

After installation, navigate to:

Admin → Panth Infotech → Zipcode Validation
Admin → Stores → Configuration → Panth Extensions → Zipcode Validation

Configuration

Settings live under Stores → Configuration → Panth Extensions → Zipcode Validation:

Setting Default Description
Enable Module Yes Master toggle for all zipcode validation
Validation Mode Allow-list Allow-list (only listed ranges accepted) or Block-list (listed ranges rejected)
Enabled Countries India, US, UK, CA, AU Which country datasets to activate for the current store
Real-time AJAX Validation Yes Validate postcodes as the customer types at checkout
AJAX Debounce (ms) 400 Delay before firing AJAX validation request
Error Message "Sorry, we do not deliver to this area." Default message shown on invalid postcode
Block Checkout on Invalid Yes Prevent customers from proceeding if postcode is out of range
Validate Address Book Yes Also validate postcodes when customers save new addresses

More Information
Module Category Cart & Checkout
Best For All Sizes

Need this customised?

Talk to Kishan directly — written quote, scope and timeline within 24 hours. No sales call.

WhatsApp

ZIP/PIN Code Validation at Checkout for Magento 2

$0.00
Step up

Customers usually upgrade to