---
title: "Customers Must Buy Products to Book Specific Resources"
slug: "must-buy-product-to-book-resource"
updated: 2022-10-05T15:46:13Z
published: 2022-10-05T15:46:13Z
canonical: "help.nexudus.com/must-buy-product-to-book-resource"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://help.nexudus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Customers must buy a product to book a resource

This validaton rule requires customer to purchase a product if they want to book a specific resource.

*For example, you want all customers to purchase a day pass if they don't have one already to book one of your meeting rooms.*

You need the following details to create this validation rule:

- The ID of the resource that shouldn't be booked without a specific product purchase.
- The ID of the product that should be purchased to book the resource.

          Don't have your resource or product IDs yet?

          

Check out [Finding Resource IDs](/v3/docs/finding-resource-ids) and [Finding Product IDs](/v3/docs/finding-product-ids) to get them.

---

1. Log in to [dashboard.nexudus.com](https://dashboard.nexudus.com/) if you aren't already.
2. Click [**Settings > Validation rules**](https://dashboard.nexudus.com/settings/3/0/0).
3. Click **Add rule**.
4. Click on **Manual entry**.
5. Name your validation rule.
6. Add a **Description** for your rule to let other admins know what it does at a glance.
7. Toggle on **This rule is active**.
8. Select **Bookings** in the **Record type**.
9. Add the **Error message to display if the validation rule is not met**.
10. Add the following code snippet to the **Formula** field.

```
record.Resource.Id<> 123 OR HasProduct(record, 432)
```

1. Replace **123** with your resource ID.
2. Replace **432** with your product ID.

Your rule should look similar to the one, with your resource and product IDs instead of 1234456789 and 98765432.

![VR_NoBookingIfNoProduct](https://cdn.document360.io/4f9a66c7-3dbb-4052-97d8-5439302e1512/Images/Documentation/VR_NoBookingIfNoProduct.png)

1. Click the **Save Changes** button.

---

All done! We recommend you test your validation rule by trying to book a resource on the Members Portal with a customer account that didn't purchase the required product. If you get the error message you've defined, your rule is ready to go!
