How to stop specific Shopify products shipping to certain states
Short answer: 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. In Checkpost, choose “Restrict products in certain states” from Templates, adjust the values, test it, then save and enable the rule.
The problem
Knives, vapes, supplements, CBD, ammunition parts and some cosmetics are legal in most states but banned or licensed in others. Shipping them to the wrong state can mean fines, seized parcels or a lost payment processor.
How to set it up
- Install Checkpost from the Shopify App Store.
- Open Templates and choose Restrict products in certain states.
- Tag restricted products, then list the state/province codes where they are not allowed.
- Use Try this rule to test a sample cart, then click Save rule.
The rule
Checkout is blocked when all of these conditions are true:
- Cart contains products tagged state-restricted
- State / province is any of CA, NY, MA
Shoppers see: “One or more items in your cart can't be shipped to your state. Please remove them to continue.” at the state / province field, once they reach checkout.
Rule definition (JSON)
{
"name": "Restricted products by state",
"match": "all",
"conditions": [
{
"kind": "cart_contains",
"filter": {
"productTags": [
"state-restricted"
]
}
},
{
"kind": "text",
"field": "ship_province",
"op": "equals_any",
"values": [
"CA",
"NY",
"MA"
]
}
],
"message": "One or more items in your cart can't be shipped to your state. Please remove them to continue.",
"target": "provinceCode",
"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
- Tag every restricted product (e.g. state-restricted) so new products are covered automatically.
- Create separate rules when different products have different banned states.
- Keep your list of restricted states under review: regulations change, and the rule is only as current as your list.
FAQ
Will the rest of the cart still be purchasable?
Yes. The shopper sees the message, removes the restricted items, and can check out with everything else.
Does this work for Canadian provinces or other regions?
Yes. Use the province or region code that Shopify stores for the address, e.g. ON or QC.
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).
Only allow listed postal codes (local delivery)
Allow checkout only when the shipping postal code is inside your delivery area — ideal for local bakeries, florists and grocery delivery.