Docs/Merchants/Product Features
Connect exclusive product rules to checkout
Exclusive product rules decide who can buy a collection, and how. For Shopify to enforce those rules when a customer adds a product to the cart, you connect a validation function to Toki once, by pasting its ID on the Exclusive Products page. From then on, every time you save your rules, Toki sends the latest version to that function.
What the connection does
A validation function is a checkout rule in your Shopify admin. Once it's connected, it checks every cart against your exclusive product rules. A product that doesn't qualify stays out of the cart, and the customer sees a message you write.
The connection covers:
- Every rule where Purchase With is Money.
- Every rule that completes through Checkout (Cart), whether it's paid with money or points.
Rules paid with Points that complete through Draft Order create a draft order and send the customer to its checkout page, so they don't rely on the cart check.
Connect the validation function
- In your Shopify admin, open Settings, then Checkout. Scroll to the Checkout rules section and copy the ID of the validation function. If you don't see a Toki validation function in that section, chat with us and we'll set it up with you.
- In Toki, open Exclusive Products.
- In the Validation Function card, paste the ID into Validation Function ID. It's a number, like 12345678.
- Click Save. You see Saved when the connection is in place.
The help text under the field has a link that opens the Checkout rules section of your Shopify admin directly.
If the ID isn't accepted
When Shopify has no validation function with the ID you entered, Toki shows this message under the field:
Validation function with this id does not exist. Please check the validation function ID.
You also see a short notice: Validation function not found. Please check the form and try again. Go back to the Checkout rules section in your Shopify admin, copy the ID again, paste it, and save.
What the cart checks
Each check comes with its own message. You write the messages in the Cart validation messages section of each rule on the Exclusive Products page.
| What the cart checks | Which rules | Message the customer sees |
|---|---|---|
| The customer belongs to the rule's Segment | Rules with a Segment set. A rule with no segment applies to everyone. | Required access message |
| The customer is not in the rule's Blocked Segment | Rules with a Blocked Segment set | Blocked access message |
| The product is free in the cart, covered by the points discount | Rules paid with Points that complete through Checkout (Cart) | Free product message. Can include {{product_title}}, which becomes the product's name. |
| The quantity in the cart is within Maximum Quantity | Rules that complete through Checkout (Cart) with Limit Quantity turned on | Quantity limit message. Can include {{max_quantity}}, which becomes the limit. |
Each message field shows an example in gray. Write your own so the wording matches your store's voice.
Keep the connection current
- Each time you click Save on the Exclusive Products page, Toki sends your current rules to the connected validation function. Add, change, or remove rules as usual, then save.
- The field keeps the ID you saved last. To switch to a different validation function, paste its ID over the old one and save.
Plans
Exclusive Products, including the Validation Function ID field, is available on Toki's paid plans. Open Billing to compare plans.
Related
- Exclusive products — creating rules, access settings, and the four message fields
- Buy exclusive products with points — points rules, Checkout (Cart) versus Draft Order, and quantity limits
- Segments — the groups a rule applies to or blocks