Validating address field and excluding PO Boxes?

Hi there,

I’m looking at options regarding trying to validate addresses. I believe our courier doesn’t ship to PO Boxes for example however, a user is able to input any address they would like to. As it doesn’t block / exclude them from inputting a PO Box address, it causes issues when we receive and go to send the items.

I’m sure there are plenty of retailers also experiencing a similar issue, so curious as to how they are resolving.

Any advice would be greatly appreciated.

Kind regards,

Guy

Remember with any implmenetation to check for different spelling of PO box , P.O. box , pobox, po box, P.0. ; last one is missing “box” etc etc ad nausem.

Pre-checkout

To try and catch invalid addresses before checkout, you want to build a shipping address form in the /cart ; typically under the guise of a shipping cost calculator this would let you inform potential customers of incompatible addresses BEFORE they go to checkout.

In checkout

To enforce address rules in the checkout itself you either need an app using the carrier service api, build your own, or be on shopify Plus and modify the checkout.

To roll your own PO box rejection use the delivery-customization shopify-function feature.

https://shopify.dev/docs/api/functions/reference/delivery-customization#:~:text=Hide%20delivery%20options%20for%20PO%20Box%20addresses

different approaches may be available in future shopify-functions [1].

Post checkout

To catch these AFTER the order is placed.

Should be able to catch most in a shopify flow automation, or maybe even utilizing shopfys free fraud filter app to try and catch PO boxes before accepting payment or sending off to fulfillment, etc.

Remember to check for different spelling of PO box , P.O. box , pobox, po box, P.0. ; last one is missing “box” .

Example flow template of advanced usages in checking addresses:

Hold fulfillments if a customer placed multiple orders to the same address in 24 hours

https://shopify.com/admin/apps/flow/web/editor/templates/178e69ed-6bfe-4fc8-8cb8-817fc28f81da

In flow checking first line address should be order.shippingAddress.address1

and second line order.shippingAddress.address2

1.Beta https://shopify.dev/docs/api/functions/reference/cart-checkout-validation ,

Beta https://shopify.dev/docs/api/functions/reference/fulfillment-constraints

Currently, the best way is using this app called Ultimate PO Box Blocker. It stops customers from punching in PO Box addresses at checkout, letting them know that shipping to that address is unavailable. It’s a simple 1-click install with no rules to set up.

Hey @XTMGuy

We have solution of your issue, You can validate/Block Po Box in shipping address using Address Validify by simply setup single rule.

Using Address Validify You can validate First name, Last name, Address Line 1 and Address Line 2, City, Zip Code, Phone, Customer Phone, Customer Email with Your Custom Messages Belongs to Perticular Field in Store Activate Language with various conditions like Missing House Number, Missing Apartment, Suite, etc., Prevent PO Box Address, Field Minimum/Maximum Length Checker, Keyword Matching Rule, Regular Expression Matching Rule, Missing Vat Number, Block Extra White Space, Block Non Latin word, Block Number.

Address Validify is also able to apply various validations as per Store Owner Requirements on Cart, and Block Perticular Zip code / Postal Code of any country without blocking Entier country

There is no need to have Shopify Plus plan anymore to validate shipping address at Shopify Checkout Page. and Our App is Just Plug & Play, there is no more modification in checkout.liquid file to Validate Shipping Address, Just Install Address Validify set validation rules as per your requirement, rest of all things will handled by our app.

Regards,
Devesha Solution.