What order are different types of key conditions evaluated in?
When a key has multiple key conditions, Locksmith evaluates them in a specific order to provide the best user experience. The evaluation order is designed to prioritize conditions based on the level of control a user has over their authorization.
Evaluation Order
Key conditions are evaluated in the following order:
(always permit)
is signed in
is tagged with...
(the product) is tagged with...
has one of many email addresses
has a list of email addresses
the customer's email contains...
has purchased...
has not placed an order in the last 24 hours
has placed at least x orders
has a certain product in their cart
has a certain variant in their cart
has at least $x in their cart
(custom Liquid)
is visiting after a certain date and time
is visiting before a certain date and time
is visiting a certain domain
is visiting from a certain location (city, country, etc)
has a certain IP address
is visiting from certain locations
arrives via a secret link...
arrives using a secret link code from an input list...
has an email address from an input list...
subscribes to your Mailchimp list
subscribes to your Klaviyo list
is a member of a Klaviyo segment or list
gives the passcode...
gives a passcode from an input list...
gives one of many passcodes...
the customer confirms the prompt
Why This Order Matters
The evaluation order is important because:
User Experience: Conditions with less user control (like IP address) are checked first, so users aren't prompted for passcodes only to be denied by location.
Performance: Local checks (like customer tags) are performed before remote ones (like API calls to external services).
Fail-Fast Principle: If a user will be denied access regardless of their input, they find out immediately rather than after entering information.
Multiple Keys on a Lock
When a lock has multiple keys, each key is evaluated independently. Access is granted if any key's conditions are all met. Within each key, all conditions must be satisfied for that key to grant access.
Related Topics
Last updated
Was this helpful?