To summarize the general problem: Most companies are not on Shopify Plus, and therefore do not have code access to the checkout screen. The lowest-level granularity of Shipping Zones is Province (ie state in the US). So you cannot solve this problem by setting up a shipping zone. Shopify documentation instead refers you to the App marketplace.
The existing apps offer two solutions: 1) inject liquid code to check for zip code at the cart stage (though this can easily be over-ridden by the user in the Checkout), or 2) build a separate Sales Channel that has access to the full-featured Checkout Admin API. If you don't want to build a Sales Channel, but instead want a solution for an individual store, you are directed to use the Storefront API, which is less configurable than the Admin API. And even if you built a custom ShippingCarrier to calculate the delivery cost for a given address, there does not seem to be any way to have a ShippingCarrier deny a particular address. So this rules out any solution that involves redirecting the customer back to the Shopify checkout page via a web url. And if you want to use one of the `checkoutComplete` endpoints, you need to get special "Payment Processing" authorization from Shopify, which takes 7-10 business days.
Given all that, the most reasonable approach seems to be: host a private app that pulls in product data via the Admin API, enforces whatever custom shipping logic you want, processes payment info and taxes (groan), and then sends a copy of the order to Shopify so that all customer data stays in one place. Seems clunky for such a simple thing. Would be interested if someone else has found a solution that I'm missing!
I am looking for an app that I can use to provide my customers with zip code protection. Before I accept a new customer I want to be able to look up my existing customers and enter the new zip code to see if it is within a radius of my existing in order to provide zip code protection. Does anyone know of an app of this type?
Sam from Achieve Applabs here. Most zip code apps validate the zip code rather than restrict placing an order based on zip code. In this post I can already tell there are different requirements for each merchant. Some want to restrict based on existing customers like @Charms25 mentioned, others may want to restrict based on the actual zip code entered. First and foremost a zip code API is required, there are many out there for United States as well as Canada. The app should allow to make logical rules that accept or reject based on the zip code in the order. Orders API can be used to achieve this. Depending on the existing process this solution could look different for each merchant hence a rule based app.
Maybe you guys can look at some address validator apps?
Restricting acceptance of order based on postcode (Australia) is all that is required by local food delivery services such as pizza shops and cafes.
We don’t want customers ordering and paying for products long distances from our physical shop. We don’t want to ring them up and say, "Sorry, we don’t deliver to your destination". The restriction would block the order from being complete until the delivery address matches our listed criteria.
If we deliver to our only to our own and the neighbouring 4 or so postcodes, it should be a simple matter of listing those postcodes in the back end. No need for more complicated options, apps or paid plans.
Rather than adding an app or patching scripts, this functionality of selective postcodes should be implemented in the "shipping zone" section. Currently we can specify a single state in our country, but it does not drill down farther than that.
Please add my vote for implementing this simple additional functionality to the main Shopify system.