Coming soon: Blockly Checkout Customizer — validation rules, upsells & checkout analytics.Get early access
Tutorial

Block or Allow Checkout by Customer Tag on Shopify

Customer tags can control who is allowed to check out. Here is how to build wholesale-only products, VIP early access, and restrictions for repeat COD abusers using Shopify Functions.

Block or Allow Checkout by Customer Tag on Shopify

Customer tags are one of the most underused tools in Shopify. Most stores apply them for segmentation and email, then never use them again. But a tag is also a fast, reliable way to tell checkout who a customer is: a wholesale account, a VIP, or someone who has refused three cash-on-delivery parcels in a row.

With Shopify Functions, that tag can decide what happens at checkout. You can block certain customers, allow only certain customers, or quietly change which options they see. This guide walks through the patterns that work and how to set them up.

Why gate checkout by customer tag

Tag-based rules solve problems that cart-based rules cannot, because the issue is about the buyer rather than the products.

Wholesale-only products. You list bulk packs or trade pricing on the same store as retail. Retail customers who find those products should not be able to buy them.

VIP or member early access. A product drop opens to tagged members first. Everyone else can view the page but should not be able to complete checkout until the public launch.

Repeat COD abusers. Customers who repeatedly refuse cash-on-delivery parcels cost you shipping in both directions. Once tagged, they can be restricted. Our guide to tagging and blocking repeat fraud customers covers how to build that tag list.

Staff, ambassador, or partner programs. Certain products or discounts are only meant for a defined group.

Account-required purchases. Some products need a verified or approved account, such as professional-only supplies.

Your options on Shopify

Native Shopify features

Shopify lets you require customer accounts, and B2B features on Shopify Plus support company-specific catalogs and pricing. Those are good tools for full wholesale programs. But there is no native toggle for "only customers tagged vip can buy this product" on a regular store, and no native way to block a specific tagged customer from checking out.

Theme-based gating

Many stores hide the add-to-cart button with Liquid when customer.tags does not contain a tag. This is a reasonable visual layer, but it is not enforcement. A customer who is logged out, uses a direct checkout link, an old cart, or an express button can still reach checkout. Theme gating also does nothing when the customer is not logged in, which is when you most need it.

Shopify Functions

A Cart and Checkout Validation function can read the buyer's customer record, including tags, and return an error that blocks checkout. A Payment Customization function can read the same tags and hide specific payment methods instead of blocking the whole order. Both run server-side, so they apply however the customer arrived.

Public apps that use these functions work on all Shopify plans. Custom apps with functions generally require Shopify Plus. For the bigger picture of blocking options, see the Shopify checkout blocker guide.

Block vs allow: pick the right model

There are two basic models, and mixing them up is the most common mistake.

ModelHow it worksBest for
BlocklistBlock checkout if the customer HAS a tagFraud, abuse, chargebacks
AllowlistBlock checkout unless the customer HAS a tagWholesale, VIP, members, staff
Soft restrictionHide a payment method if the customer has a tagCOD abusers, higher-risk buyers

Allowlists have an important consequence: guests have no tags. Any allowlist rule effectively requires the customer to be logged in. That is usually what you want for wholesale and VIP access, but your message should tell guests to log in.

Step-by-step setup

1. Standardize your tags

Pick exact, lowercase tag names and document them: wholesale, vip, cod-blocked, staff. Tag matching is literal, so Wholesale and wholesale-approved will not match a rule written for wholesale.

2. Decide how tags are applied

Tags can be added manually, through Shopify Flow, through a loyalty or wholesale app, or by a fraud app. Make sure the process is reliable, because the checkout rule is only as accurate as the tags behind it.

3. Scope the rule to products

Most tag rules should not apply to the whole store. Tag or collect the restricted products, for example wholesale-only or vip-drop, and only run the rule when those products are in the cart.

4. Write a message for each audience

Guests, logged-in customers without the tag, and blocked customers need different wording. A wholesale message should mention how to apply for an account. A VIP message should mention when public access opens.

5. Test as each customer type

Test as a guest, as a logged-in customer without the tag, and as a tagged customer. Test with and without the restricted products in the cart.

Rule examples

Use caseConditionActionMessage
Wholesale-onlyCart has item tagged wholesale-only AND customer does not have tag wholesaleBlock checkoutWholesale products are available to approved trade accounts. Please log in or apply for an account.
VIP early accessCart has item tagged vip-drop AND customer does not have tag vipBlock checkoutThis release is open to VIP members first. Public access opens soon.
COD abuserCustomer has tag cod-blockedHide Cash on DeliveryNo message needed; prepaid methods remain available.
Hard blockCustomer has tag chargebackBlock checkoutWe're unable to process this order. Please contact support.
Staff productsCart has item tagged staff-only AND customer does not have tag staffBlock checkoutThis item is reserved for team members.
For COD abusers, hiding the payment method is usually better than blocking. Legitimate customers can still pay upfront.

The COD approach is covered in depth in hiding COD with Shopify Functions.

Pitfalls and edge cases

Guest checkout bypass on blocklists. A blocked customer who checks out as a guest with a new email has no tags. Blocklist rules work best combined with address or email signals, not tags alone.

Message leakage. Avoid messages that reveal why a customer is blocked, such as "You have been flagged for fraud." Keep hard-block messages neutral and route the customer to support.

Stale tags. VIP access tags that never expire turn early access into permanent access. Remove or rotate them after each drop.

B2B overlap. If you use Shopify Plus B2B company accounts, check whether your wholesale buyers check out as company contacts. Your rule may need to account for that rather than relying only on a tag. See our notes on wholesale and B2B fraud for related risks.

Discount code abuse. Tag rules control who can check out, not which discounts apply. If a VIP discount code leaks, pair the tag rule with discount restrictions.

Tag typos. One misspelled tag can lock out your entire wholesale list. Test with a real tagged account after every change.

Setting this up with Blockly Checkout Customizer

Blockly Checkout Customizer, launching soon on the Shopify App Store, is designed to make tag-based rules point-and-click. You will be able to choose "customer has tag" or "customer does not have tag," optionally limit the rule to specific products or collections, and then pick the action: block checkout with a custom message, or hide a payment or delivery method. Since it runs on Shopify Functions as a public app, these rules are intended to work on any Shopify plan.

Takeaway

Customer tags turn checkout from one-size-fits-all into something that knows who is buying. Use allowlists for wholesale, VIP, and staff products, and remember they require customers to log in. Use blocklists sparingly for clear abuse, and prefer hiding a payment method over blocking when a softer restriction will do. Keep tags consistent, write a message for each audience, and test as every customer type before going live.

Up nextHow to Reorder Payment Methods at Shopify Checkout

Related articles

More tutorial articles →
Free forever plan

Ready to protect
your store?

Join 5,000+ Shopify merchants. Install in 30 seconds and block your first bad actor today.

  • No credit card
  • 5-minute setup
  • Cancel anytime