Disable Shopify Ajax API

Topic summary

A user is seeking to completely disable Shopify’s Ajax API for a B2B/wholesale store where only authorized, logged-in users should access pricing information. The concern is preventing unauthorized visitors from using the Ajax API to fetch product details or add items to cart.

A response suggests an alternative approach:

  • Show/hide prices on product pages based on login status
  • Conditionally display/hide the “Add to Cart” button for non-logged-in users

The responder questions whether fully disabling the Ajax API is necessary, implying that conditional visibility controls may achieve the desired access restrictions without blocking the API entirely. The discussion remains open regarding whether complete API disabling is technically feasible or the best solution.

Summarized with AI on October 30. AI used: claude-sonnet-4-5-20250929.

Is it possible to disable Shopify Ajax API completely?

I have a shop where only authorized logged-in users should be able to see prices. I don’t want unauthorized users to be able to use Ajax API to fetch product information or add products to the cart.

I don’t get the point of not letting the user to use the ajax api but you can choose to show or hide price on the pdp page depending on customer if logged in or not.

You can also show or hide the the atc button depending on this condition.