Availability Button

Show live “new patient appointments available today/tomorrow” on your own website — or, if you want, right down to the exact next time — as a drop-in button, or via a simple data endpoint you can wire into your existing buttons.

Turn a plain “Book Now” link on your website into “Book Now — new patient appointments available tomorrow”, updated live from your real availability. Two ways to do it: a drop-in script, or the raw data endpoint for full control.

Turn on Enable website button under New-Patient Availability in your admin Settings first. Until then both options below simply leave your plain button as-is.

Before you start

The availability shown is for your first listed new-patient appointment type. It’s an indicative “soonest available” — not a held slot. By default it’s shown at day level (“tomorrow”, “Friday”); if you’d rather entice with the exact next time (“Friday at 9:40am”), the {time} placeholder below opts you in.

Option 1: Drop-in button (no coding)

Mark any link or button on your site with data-yb-button, then add the script once (replace yourpractice with your subdomain):

<a data-yb-button href="https://yourpractice.yourbooking.au/book">Book Now</a>

<script src="https://yourbooking.au/ybbutton.js"
        data-tenant="yourpractice" async></script>

The button becomes “Book Now — new patient appointments available tomorrow” and links to your booking page. Style the element however you like — it’s your markup; the script only updates the text and the link.

Customising the wording

Add data-template with any of these placeholders: {label}, {text}, {day_label}, {time}, {message}.

<a data-yb-button data-template="{label} · {text}"
   href="https://yourpractice.yourbooking.au/book">Book Now</a>

Or lead with the exact next time — “Book Now · Friday at 9:40am”:

<a data-yb-button data-template="{label} · {day_label} at {time}"
   href="https://yourpractice.yourbooking.au/book">Book Now</a>

If availability can’t be shown, the button keeps your original label — so it always works.

Option 2: Use the data in your own code

Call the public endpoint and build whatever you like. No key needed; it’s read-only and safe to call straight from the browser.

GET https://yourpractice.yourbooking.au/api/v1/availability/peek

Example — enhance an existing button:

<a id="book" href="https://yourpractice.yourbooking.au/book">Book Now</a>
<script>
fetch('https://yourpractice.yourbooking.au/api/v1/availability/peek')
  .then(function (r) { return r.json(); })
  .then(function (d) {
    if (d.available) {
      document.getElementById('book').textContent =
        'Book Now — new patient appointments ' + d.text;
    }
  })
  .catch(function () {});
</script>

Response

Always returns HTTP 200. When there’s nothing to show, available is false and the other fields are null — hide your dynamic text and keep a plain button.

{
  "available": true,
  "next_date": "2026-06-12",
  "next_time": "9:40am",
  "next_datetime": "2026-06-12T09:40:00+10:00",
  "next_available": "later",
  "day_label": "Thursday 12 June",
  "text": "available from Thursday 12 June",
  "message": "New patient appointments are available from Thursday 12 June",
  "appointment_type": "Comprehensive Eye Exam",
  "booking_url": "https://yourpractice.yourbooking.au/book"
}

Good to know