Checkpost

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

  1. Install Checkpost from the Shopify App Store.
  2. Open Templates and choose Restrict products in certain states.
  3. Tag restricted products, then list the state/province codes where they are not allowed.
  4. 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:

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

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

Add restrict products in certain states to your store