Restricting a product so that it can only be purchased by new customers

In this guide, we'll show you how to set up a product so that it can only be purchased by customers who haven't yet made a purchase. This is great for samples and first time free products.

Note: This functionality requires the customer to have or create an account for access. There's more on that below.

You'll start by locking your product. You can search for it by name in the Locksmith search bar to create that lock.

Creating locks

Next, you'll need to set a key with two different conditions:

  • Permit if the customer is signed in, and

  • permit unless the customer has purchased "*"

For Locksmith to determine whether a customer has made a previous purchase, you must require customers be signed in to access this product. This is done by adding an "is signed in" key condition to your key.

The second condition checks the customer's order history to see if they've made any purchases at all. For this, combine the "has purchased..." key condition with the "is signed in" key condition. Adding an asterisk to the "Look for products matching..." field tells Locksmith to check for any purchase in the customers history. Finally, ensure you enable the "invert" option on this condition to block customers who have made a purchase before.

Combining key conditions

Here's what that should look like:

When the full key is created, your key should look like this:

When this is all set, the customer will be prompted to log in when they try to access the product. If they already have a purchase in their history, they'll see the Access Denied message.

You can edit the access messages on the Locksimth app's settings page, or editi the access messages for specific locks on the lock's settings page. Our guide on edditing access messages is linked below.

Customizing messages"Has purchased..." keySelling digital content on Shopify

Last updated