How to block checkout if customer not associated with a company

“Require customers to sign in to their account before checkout” is already activated.

Somehow wholesale customers with accounts have been checking out without their account being linked to the company and not getting wholesale rates from the wholesale catalog.

I have not idea how the customers achieve this.

How can I block checkout if a customer is not associated with a company?

@DavidWard1 Hi! Even though “Require customers to sign in before checkout” is turned on, Shopify doesn’t automatically check if a signed-in customer is linked to a company or marked as wholesale. That’s why some wholesale accounts can still checkout without getting the correct rates.

To fix this, you need to make sure that only customers who are properly linked to a company or have the right wholesale tag can complete checkout. You can do this with a wholesale app like Wholesale Club or Bold Custom Pricing, or with a custom setup that checks the customer’s account before allowing checkout.

This way, only approved wholesale customers get the correct rates, and no one else can bypass it.

@davidward1 you’d need to set up a checkout validation function that checks if a customer is part of a company or not.

If they aren’t then they should be shown an error message showing why they weren’t allowed to make said purchase.

We at Dollarlabs: Ultimate Discounts help brands with cases like these through our function engine. I know the app title has “Discounts“ in the name, but it’s pretty flexible and should be able to help you set this logic up.

Please ping on chat to have this feature enabled for you, as we’re still beta-testing this new release out.

Thank you

Hi @DavidWard1 ,

I would explore as well using Shopify Checkout Blocks. You could display a dynamic banner saying for the customer to apply to become a b2b customer or something there and hide all of the payment and delivery options.

Something like:

Please let me know if you need additional help!

Even if “Require customers to sign in before checkout” is on, Shopify doesn’t automatically check whether a signed-in customer is linked to a company or tagged as wholesale. That’s why some wholesale accounts can still checkout without getting the correct rates.

To fix this, you need to make sure only customers associated with a company (or with the right wholesale tag) can complete checkout. You can do this using a wholesale app like Wholesale Club or Bold Custom Pricing, which can block checkout for unverified customers, or with a custom setup that checks the customer’s account before allowing checkout.

This way, only approved wholesale customers get the wholesale rates, and others can’t bypass the rules.

Adding to my earlier message. Here’s a quick screenshot of how you could set this up within the app.

You’d set a rule to check if the customer is part of a company or not or even just has a company attached to them.

Customer is B2B = True → If this fails, it will show the validation message that you’ve configured.

Hi there, thanks for reaching out. We’ve reviewed the issue and it looks like some customers are bypassing account-linked checkout, which prevents their company profile and wholesale prices from being applied.

We’ll need to block checkout for any user not associated with a company by adding an extra validation layer in Shopify Plus Checkout or through a custom app/script that stops checkout unless the customer’s company ID is detected. This ensures only verified wholesale accounts can proceed and prevents pricing errors or unauthorized retail checkouts.

We’re working on tightening this to avoid any risk of revenue loss or unapproved wholesale orders. Let’s sort this out.

@DavidWard1 If you would like to prevent non-B2B customers from completing checkout, you can use our app King Checkout Validation to achieve this.

The app allows you to create custom validation rules and define flexible combinations of conditions to block customers who do not meet your requirements.

When a non-B2B customer reaches the checkout page, a red banner will be displayed with a customizable error message, and the customer will be prevented from proceeding with the checkout.

Hi,

Can’t you do the exact same thing using Checkout Blocks?

Regards,

Rodrigo

Hey @DavidWard1,

The way Shopify B2B works is that it checks if the customer’s email is associated with a company location. If the email matches a company contact, they get B2B pricing. If not, they fall through to DTC experience even if they’re logged in. So your wholesale customers are likely logging in with a different email than what’s linked to their company, or they created a customer account that was never properly associated with their company location.

Solution using Checkout Blocks (Shopify’s own app - FREE):

Checkout Blocks has a Functions feature that lets you create checkout validation rules. You can set up an Order Limit Validation and apply it specifically to non-B2B customers. The trick is to set an impossibly high minimum (like $999,999) for customers who are NOT associated with a B2B company. This effectively blocks DTC checkout while letting B2B customers through.

Go to Apps > Checkout Blocks > Functions > Create Function > Order Limit Validation. In the “Assign to” section, you can target non-B2B customers specifically.

For tighter control - custom Shopify Function:

The Cart and Checkout Validation API gives you access to purchasingCompany in the input. You can write a simple function that returns a validation error if purchasingCompany is null. This blocks checkout entirely for anyone not associated with a company.

The validation error shows right at checkout with whatever message you set, like “This store is wholesale only. Please contact us to set up a B2B account.”

Quick fix while you sort this out:

Check your Companies section - make sure every wholesale customer’s email is actually added as a contact under their company location. One common issue is customers registered with personal emails while their company contact uses a business email. They need to log in with the email that’s linked to the company.

Please do not hesitate to reach out if you’ve any more questions.

Best,
Shubham | Untechnickle

Hey @DavidWard1

To solve this, you need checkout-level validation.

Using a checkout rules app like Checkout Boost, you can:

  • Detect if the logged-in customer is NOT linked to a company (or customer is/not B2B)
  • Block checkout or prevent order completion
  • Show a clear message like: “Please contact us to be added to your company account to access wholesale pricing.”

Screenshots for reference:

You can use any of these rules based on your specific needs.

This ensures:

  • Only customers properly associated with a company can proceed
  • Wholesale pricing is always applied correctly
  • No more accidental retail checkouts from wholesale customers

Hope that helps and best of luck!

Thanks,
Kev

This is a really useful thread — thanks to everyone who shared their approach. We’ve been trying to handle a similar situation with B2B customers and it’s helpful to see the different methods around account checks, customer tags, and checkout restrictions. The step-by-step explanations make the logic much clearer than the docs alone. I’m going to test some of these ideas in our setup and see which one fits best. Appreciate the detailed responses here.

Look forward to hearing back once you test out the suggested approaches!

What’s going on is that “require login before checkout” only checks that the customer is logged in, not that they’re linked to a B2B company. So a customer can log into a normal customer account (or even create one), hit checkout, and Shopify will let them through even if they’re not associated with a company — which means they fall back to retail pricing.

Out of the box, Shopify doesn’t give you a hard switch that says “block checkout unless this customer belongs to a company.”

The usual non-app workaround is:

  • Add a checkout validation (Shopify Plus only) or

  • Use theme + cart validation logic to block the Add to Cart / Checkout button unless customer.company exists
    This works, but it’s brittle — especially with dynamic carts, draft orders, or accelerated checkouts.

This is actually one of the reasons I built Latch. It lets you:

  • Block Add to Cart and checkout unless the customer is linked to a company (or has a specific tag)

  • Prevent non-company customers from even reaching checkout

  • Make sure wholesale pricing is only accessible when the correct access condition is met

That way, even if someone is logged in, they still won’t get through unless they’re properly associated.

App link:
https://apps.shopify.com/member-lock

I’m the developer — happy to help you sanity-check your current setup too, because this usually comes down to Shopify letting logged-in ≠ B2B slide through.

One thing worth emphasizing before jumping straight to validation: the quickest fix is usually fixing the data itself, not adding a gate.

Go to your Companies list in Shopify admin and spot-check a few of the customers who checked out at retail pricing. The most common cause is that the customer created an account using a personal email, but their company contact is saved under a different (usually work) email. Shopify checks the login email against the company contact email — if they don’t match, no company association is found and they fall through to DTC. Once you correct those mismatches, those specific customers should start getting wholesale rates again without any additional setup.

For preventing it going forward, the cleanest approach on Plus is a Shopify Function using the Cart and Checkout Validation API. You check for purchasingCompany in the checkout input — if it’s null, return a validation error. Something like ““This store is for approved wholesale accounts only. Contact us to get access.”” It fires server-side at checkout submission, so it can’t be bypassed by cart manipulation or accelerated checkout methods. The Checkout Blocks workaround TheUntechnickle mentioned works, but the $999,999 minimum trick is a bit fragile — if someone ever hits that threshold, or if there’s a cart-level discount applied, it could behave unexpectedly.

If you don’t have a developer available to write the function, several of the apps mentioned above (King Checkout Validation, Checkout Boost) expose the B2B / purchasingCompany condition without needing custom code.

Either way, I’d start with the email audit first — it’ll likely resolve a good chunk of the problem immediately.

If this isn’t enforced by default, you’ll likely need a checkout validation that blocks customers unless their account is linked to a company. Also check if express checkout options are bypassing the company association.