# Show a different set of sessions after customer has booked the introductory session?

**URL:** <https://forum.wixstudio.com/t/show-a-different-set-of-sessions-after-customer-has-booked-the-introductory-session/70139>\
**Category:** Ask the community\
**Tags:** wix-bookings-backend, wix-bookings, site-bookings, code, wix-studio\
**Created:** [April 5, 2025, 3:16am UTC](https://forum.wixstudio.com/t/show-a-different-set-of-sessions-after-customer-has-booked-the-introductory-session/70139 "2025-04-05T03:16:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![user5463](https://avatars.discourse-cdn.com/v4/letter/u/9de053/32.png) [@user5463](https://forum.wixstudio.com/u/user5463)\
**Post date:** [April 5, 2025, 3:16am UTC](https://forum.wixstudio.com/t/show-a-different-set-of-sessions-after-customer-has-booked-the-introductory-session/70139/1 "2025-04-05T03:16:44Z")

</div>

We have a personal training service using the booking calendar feature. But we don’t want people signing up for sessions without first attending the introductory session where a trainer can evaluate them / their needs. We’d like to have the other available sessions hidden until then. Is there a way to automate this?

**Product:**  
Wix Studio / dev

**What have you already tried:**  
So far, we’ve found ways to hide / show sessions based on user roles, but these need to be changed manually.. We’d prefer if after the introductory session the user has full access to all of the training sessions automatically. Is it possible with the API at all?

---

<div class="post-metadata">

**Author:** ![Pratham](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/pratham/32/119586_2.png) [@Pratham](https://forum.wixstudio.com/u/Pratham)\
**Post date:** [April 6, 2025, 11:54am UTC](https://forum.wixstudio.com/t/show-a-different-set-of-sessions-after-customer-has-booked-the-introductory-session/70139/2 "2025-04-06T11:54:38Z")

</div>

To achieve this, you would have to write custom code which will check if the user has booked the introductory session and only then let them see or book your other sessions.

---

<div class="post-metadata">

**Author:** ![user5463](https://avatars.discourse-cdn.com/v4/letter/u/9de053/32.png) [@user5463](https://forum.wixstudio.com/u/user5463)\
**Post date:** [April 7, 2025, 10:30pm UTC](https://forum.wixstudio.com/t/show-a-different-set-of-sessions-after-customer-has-booked-the-introductory-session/70139/3 "2025-04-07T22:30:28Z")

</div>

Is that possible though? The booking API doesn’t seem to return users, does it offer a hook for this or is there something we’re missing?

---

<div class="post-metadata">

**Author:** ![Pratham](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/pratham/32/119586_2.png) [@Pratham](https://forum.wixstudio.com/u/Pratham)\
**Post date:** [April 8, 2025, 7:56am UTC](https://forum.wixstudio.com/t/show-a-different-set-of-sessions-after-customer-has-booked-the-introductory-session/70139/4 "2025-04-08T07:56:21Z")

</div>

Yes, it is possible using the [**queryBookings()**](https://dev.wix.com/docs/velo/apis/wix-bookings-backend/bookings/query-bookings) function which allows you to query all bookings made by a specific **contactId** , which is essentially your member’s **\_id**.

With this, you can either pass the hardcoded **sessionId** for your Introductory Class, or you can simply pass the `contactId` with status `CONFIRMED` and check if the logged in user has atleast one confirmed booking (meaning they have booked the introductory session) to list your other services.

---

<div class="post-metadata">

**Author:** ![user5463](https://avatars.discourse-cdn.com/v4/letter/u/9de053/32.png) [@user5463](https://forum.wixstudio.com/u/user5463)\
**Post date:** [April 9, 2025, 12:11am UTC](https://forum.wixstudio.com/t/show-a-different-set-of-sessions-after-customer-has-booked-the-introductory-session/70139/5 "2025-04-09T00:11:41Z")

</div>

Thanks so much for your help Pratham. I’m wondering, does queryBookings() have the ability to return the date / time of a session? So theoretically we could use this information to detect if the logged in user (via contactId) has booked the specific session AND the time of that session has passed?

---

<div class="post-metadata">

**Author:** ![Pratham](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/pratham/32/119586_2.png) [@Pratham](https://forum.wixstudio.com/u/Pratham)\
**Post date:** [April 9, 2025, 9:30am UTC](https://forum.wixstudio.com/t/show-a-different-set-of-sessions-after-customer-has-booked-the-introductory-session/70139/6 "2025-04-09T09:30:44Z")

</div>

Oh yes absolutely!

**queryBookings()** does indeed return a start and end time for the booked service, and alternatively, you can also pass in the session end time while calling the function by setting the session’s `endTime` to **[le](https://dev.wix.com/docs/velo/apis/wix-bookings-backend/bookings/bookings-query-builder/le)** today. This way, the result will only contain sessions that have already ended in the past or today. Else your `result.items.length` would turn out to be 0, meaning the user hasn’t booked any session OR the introductory session isn’t complete yet.
